Back to index

glibc  2.9
Functions
mkdirat.c File Reference
#include <errno.h>
#include <fcntl.h>
#include <stddef.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <stub-tag.h>

Go to the source code of this file.

Functions

int mkdirat (int fd, const char *path, mode_t mode)

Function Documentation

int mkdirat ( int  fd,
const char *  path,
mode_t  mode 
)

Definition at line 28 of file mkdirat.c.

{
  if (path == NULL)
    {
      __set_errno (EINVAL);
      return -1;
    }

  if (fd != AT_FDCWD && path[0] != '/')
    {
      /* Check FD is associated with a directory.  */
      struct stat64 st;
      if (__fxstat64 (_STAT_VER, fd, &st) != 0)
       return -1;

      if (!S_ISDIR (st.st_mode))
       {
         __set_errno (ENOTDIR);
         return -1;
       }
    }

  __set_errno (ENOSYS);
  return -1;
}

Here is the call graph for this function:

Here is the caller graph for this function: