Back to index

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

Go to the source code of this file.

Functions

int __openat (int fd, const char *file, int oflag)
 libc_hidden_def (weak_alias(__openat)

Function Documentation

int __openat ( int  fd,
const char *  file,
int  oflag 
)

Definition at line 30 of file openat.c.

{
  int mode;

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

  if (fd != AT_FDCWD && file[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;
       }
    }

  if (oflag & O_CREAT)
    {
      va_list arg;
      va_start (arg, oflag);
      mode = va_arg (arg, int);
      va_end (arg);
    }

  __set_errno (ENOSYS);
  return -1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

libc_hidden_def ( weak_alias __openat)

Definition at line 68 of file openat.c.

{
  if (oflag & O_CREAT)
    __fortify_fail ("invalid openat call: O_CREAT without mode");

  return __openat (fd, file, oflag);
}

Here is the call graph for this function: