Back to index

glibc  2.9
Defines | Functions
lxstat.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 <bp-checks.h>
#include <kernel-features.h>
#include <xstatconv.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define __lxstat64   __lxstat64_disable

Functions

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

Define Documentation

#define __lxstat64   __lxstat64_disable

Definition at line 23 of file lxstat.c.


Function Documentation

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

Definition at line 48 of file lxstat.c.

{
#if __ASSUME_STAT64_SYSCALL == 0
  struct kernel_stat kbuf;
#endif
  int result;

  if (vers == _STAT_VER_KERNEL)
    return INLINE_SYSCALL (lstat, 2, CHECK_STRING (name), CHECK_1 ((struct kernel_stat *) buf));

#if __ASSUME_STAT64_SYSCALL > 0
  {
    struct stat64 buf64;

    result = INLINE_SYSCALL (lstat64, 2, CHECK_STRING (name), __ptrvalue (&buf64));
    if (result == 0)
      result = __xstat32_conv (vers, &buf64, buf);
    return result;
  }
#else

# if defined __NR_stat64
  /* To support 32 bit UIDs, we have to use stat64.  The normal stat call only returns
     16 bit UIDs.  */
  if (! __have_no_stat64)
    {
      struct stat64 buf64;
      result = INLINE_SYSCALL (lstat64, 2, CHECK_STRING (name), __ptrvalue (&buf64));

      if (result == 0)
       result = __xstat32_conv (vers, &buf64, buf);

      if (result != -1 || errno != ENOSYS)
       return result;

      __have_no_stat64 = 1;
    }
# endif

  result = INLINE_SYSCALL (lstat, 2, CHECK_STRING (name), __ptrvalue (&kbuf));
  if (result == 0)
    result = __xstat_conv (vers, &kbuf, buf);

  return result;
#endif
}

Here is the call graph for this function: