Back to index

glibc  2.9
Defines | Functions | Variables
openat.c File Reference
#include <errno.h>
#include <fcntl.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <kernel-features.h>
#include <sysdep-cancel.h>
#include <not-cancel.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define OPENAT   openat
#define __OPENAT_2   __openat_2
#define OPENAT_NOT_CANCEL   CONCAT (OPENAT)
#define CONCAT(name)   CONCAT2 (name)
#define CONCAT2(name)   __##name##_nocancel
#define UNDERIZE(name)   UNDERIZE_1 (name)
#define UNDERIZE_1(name)   __##name
#define __OPENAT   UNDERIZE (OPENAT)
#define MSG(s)   MSG2 (s)
#define MSG2(s)   "invalid " #s " call: O_CREAT without mode"

Functions

void attribute_hidden __atfct_seterrno (int errval, int fd, const char *buf)

Variables

int __have_atfcts
int int fd
const char * file
int oflag
mode_t mode

Define Documentation

#define __OPENAT   UNDERIZE (OPENAT)
#define __OPENAT_2   __openat_2

Definition at line 33 of file openat.c.

#define CONCAT (   name)    CONCAT2 (name)

Definition at line 71 of file openat.c.

#define CONCAT2 (   name)    __##name##_nocancel

Definition at line 72 of file openat.c.

#define MSG (   s)    MSG2 (s)
#define MSG2 (   s)    "invalid " #s " call: O_CREAT without mode"
#define OPENAT   openat

Definition at line 32 of file openat.c.

Definition at line 70 of file openat.c.

#define UNDERIZE (   name)    UNDERIZE_1 (name)
#define UNDERIZE_1 (   name)    __##name

Function Documentation

void attribute_hidden __atfct_seterrno ( int  errval,
int  fd,
const char *  buf 
)

Definition at line 40 of file openat.c.

{
  if (buf != NULL)
    {
      struct stat64 st;

      if (errval == ENOTDIR || errval == ENOENT)
       {
         /* This can mean either the file descriptor is invalid or
            /proc is not mounted.  */
         if (__fxstat64 (_STAT_VER, fd, &st) != 0)
           /* errno is already set correctly.  */
           return;

         /* If /proc is not mounted there is nothing we can do.  */
         if ((errval != ENOTDIR || S_ISDIR (st.st_mode))
             && (__xstat64 (_STAT_VER, "/proc/self/fd", &st) != 0
                || !S_ISDIR (st.st_mode)))
           errval = ENOSYS;
       }
    }

  __set_errno (errval);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 65 of file openat.c.

Definition at line 77 of file openat.c.

const char * file

Definition at line 78 of file openat.c.

Definition at line 80 of file openat.c.

Definition at line 79 of file openat.c.