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 <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 (const char *file, uid_t owner, gid_t group)

Function Documentation

int __chown ( const char *  file,
uid_t  owner,
gid_t  group 
)

Definition at line 38 of file chown.c.

{
#if __ASSUME_32BITUIDS > 0
  return INLINE_SYSCALL (chown32, 3, CHECK_STRING (file), owner, group);
#else
# 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) > (gid_t) ((__kernel_uid_t) -1U))
      || ((group + 1) > (gid_t) ((__kernel_gid_t) -1U)))
    {
      __set_errno (EINVAL);
      return -1;
    }

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

Here is the call graph for this function: