Back to index

glibc  2.9
Functions
intern-fd.c File Reference
#include <hurd.h>
#include <hurd/fd.h>

Go to the source code of this file.

Functions

int _hurd_intern_fd (io_t port, int flags, int dealloc)

Function Documentation

int _hurd_intern_fd ( io_t  port,
int  flags,
int  dealloc 
)

Definition at line 28 of file intern-fd.c.

{
  int fd;
  struct hurd_fd *d;

  HURD_CRITICAL_BEGIN;
  d = _hurd_alloc_fd (&fd, 0);
  if (d != NULL)
    {
      _hurd_port2fd (d, port, flags);
      __spin_unlock (&d->port.lock);
    }
  HURD_CRITICAL_END;

  if (d == NULL)
    {
      if (dealloc)
       __mach_port_deallocate (__mach_task_self (), port);
      return -1;
    }

  return fd;
}

Here is the call graph for this function:

Here is the caller graph for this function: