Back to index

glibc  2.9
unlinkat.c File Reference
#include <errno.h>
#include <fcntl.h>
#include <stddef.h>
#include <unistd.h>
#include <hurd.h>
#include <hurd/fd.h>

Go to the source code of this file.


int unlinkat (int fd, const char *name, int flag)

Function Documentation

int unlinkat ( int  fd,
const char *  name,
int  flag 

Definition at line 30 of file unlinkat.c.

  error_t err;
  file_t dir;
  const char *file;

  if ((flag &~ AT_REMOVEDIR) != 0)
      __set_errno (EINVAL);
      return -1;

  dir = __directory_name_split_at (fd, name, (char **) &file);
  if (dir == MACH_PORT_NULL)
    return -1;

  err = ((flag & AT_REMOVEDIR) ? __dir_rmdir : __dir_unlink) (dir, file);
  __mach_port_deallocate (__mach_task_self (), dir);

  if (err)
    return __hurd_fail (err);
  return 0;

Here is the call graph for this function: