Back to index

glibc  2.9
Functions
chown.c File Reference
#include <errno.h>
#include <unistd.h>
#include <sysdep.h>
#include <sys/syscall.h>
#include <shlib-compat.h>
#include <bp-checks.h>
#include <linux/posix_types.h>
#include <kernel-features.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int __chown_is_lchown (const char *__file, uid_t __owner, gid_t __group)
int __real_chown (const char *__file, uid_t __owner, gid_t __group)

Function Documentation

int __chown_is_lchown ( const char *  __file,
uid_t  __owner,
gid_t  __group 
)

Definition at line 133 of file chown.c.

{
  return INLINE_SYSCALL (chown, 3, CHECK_STRING (file), owner, group);
}

Here is the call graph for this function:

int __real_chown ( const char *  __file,
uid_t  __owner,
gid_t  __group 
)

Definition at line 51 of file chown.c.

{
#if __ASSUME_32BITUIDS > 0
  return INLINE_SYSCALL (chown32, 3, CHECK_STRING (file), owner, group);
#else
  static int __libc_old_chown;
  int result;

  if (!__libc_old_chown)
    {
      int saved_errno = errno;
# ifdef __NR_chown32
      if (__libc_missing_32bit_uids <= 0)
       {
         int result;
         int saved_errno = errno;

         result = INLINE_SYSCALL (chown32, 3, CHECK_STRING (file), owner, group);
         if (result == 0 || errno != ENOSYS)
           return result;

         __set_errno (saved_errno);
         __libc_missing_32bit_uids = 1;
       }
# endif /* __NR_chown32 */
      if (((owner + 1) > (uid_t) ((__kernel_uid_t) -1U))
         || ((group + 1) > (gid_t) ((__kernel_gid_t) -1U)))
       {
         __set_errno (EINVAL);
         return -1;
       }

      result = INLINE_SYSCALL (chown, 3, CHECK_STRING (file), owner, group);

      if (result >= 0 || errno != ENOSYS)
       return result;

      __set_errno (saved_errno);
      __libc_old_chown = 1;
    }

  return __lchown (file, owner, group);
#endif
}

Here is the call graph for this function: