Back to index

glibc  2.9
Defines | Functions
xstat.c File Reference
#include <errno.h>
#include <stddef.h>
#include <sys/stat.h>
#include <kernel_stat.h>
#include <sysdep.h>
#include <sys/syscall.h>
#include <xstatconv.h>

Go to the source code of this file.


#define __xstat64   __xstat64_disable


int __xstat (int vers, const char *name, struct stat *buf)

Define Documentation

#define __xstat64   __xstat64_disable

Definition at line 20 of file xstat.c.

Function Documentation

int __xstat ( int  vers,
const char *  name,
struct stat buf 

Definition at line 35 of file xstat.c.

  int result, errno_out;
  struct kernel_stat kbuf;

  if (vers == _STAT_VER_KERNEL64 && !__libc_missing_axp_stat64)
      result = INTERNAL_SYSCALL (stat64, err, 2, name, buf);
      if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
       return result;
      errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
      if (errno_out != ENOSYS)
       goto fail;
      __libc_missing_axp_stat64 = 1;

  result = INTERNAL_SYSCALL (stat, err, 2, name, &kbuf);
  if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
    return __xstat_conv (vers, &kbuf, buf);
  errno_out = INTERNAL_SYSCALL_ERRNO (result, err);
  __set_errno (errno_out);
  return -1;

Here is the call graph for this function: