2002-03-07 01:19:24

by Laurent

[permalink] [raw]
Subject: ?chown and ?chown32 syscalls

In asm/unistd.h there are 2 series of syscalls for chown commands (chown,
lchown and fchown) : the ?chown and ?chown32
In 2.4.17 (ix86) the system is using the ?chown32 syscalls, when I intercept
the ?chown syscalls nothing happens. Are these syscalls deprecated ?

Thanks for any help.
Laurent Sinitambirivoutin
[email protected]

PS: please CC: me the answers since I'm not on the list... ;)


2002-03-07 03:55:05

by Christopher Allen Wing

[permalink] [raw]
Subject: Re: ?chown and ?chown32 syscalls

Laurent:

Prior to Linux 2.4, uid_t on i386 Linux was a 16 bit type. In Linux 2.4
uid_t was changed to be 32 bits on all Linux architectures. Those
architectures (such as x86) which formerly used a 16 bit uid_t needed to
have new syscall entries added, one of which is chown32.

At the same time, to preserve backwards compatibility with old software,
the existing 16 bit uid_t system calls were left intact, including the old
chown.

As of glibc 2.2, chown32 is used first if the kernel supports it, else
glibc falls back to using the old 16 bit uid_t syscalls.


If you use a version of glibc older than 2.2 or a Linux kernel older than
2.4, the old 16 bit uid_t system calls will be used on i386.

Note that Linux architectures which always used a 32 bit uid_t do not have
this second set of system calls, and chown32 will not be defined for them
in asm/unistd.h.

-Chris Wing
[email protected]


> In asm/unistd.h there are 2 series of syscalls for chown commands (chown,
> lchown and fchown) : the ?chown and ?chown32
> In 2.4.17 (ix86) the system is using the ?chown32 syscalls, when I intercept
> the ?chown syscalls nothing happens. Are these syscalls deprecated ?
>
> Thanks for any help.
> Laurent Sinitambirivoutin
> [email protected]