Q: Linux system calls and calling conventions

Chris Wing (wingc@engin.umich.edu)
Wed, 10 Nov 1999 20:18:21 -0500 (EST)


Hi. In the 32-bit UID support patches I'm working on, I have tried to
avoid adding extra system calls wherever neessary. Instead of adding a new
version of setuid(), setgid(), setfsuid(), and setfsgid(), I have left the
original calls unchanged, keeping in mind that the arguments are being
passed in 32-bit registers.

This works at least on the Intel; old programs pass 16-bit values into the
32-bit registers in a sensible way, and new programs can pass 32-bit UIDs
and GIDs to the same calls.

However, someone pointed out to me in an email that this may not
necessarily be true on other platforms. So, my question is:

- is it safe to assume that the convention used in the kernel to
fetch a 16-bit value from a system call argument (such as a 16-bit UID
given to setuid()) is consistent with the convention used to fetch 32-bit
values?

- or rather, will my assumption not work on one or more non-i386
architectures?

Thanks,

Chris Wing
wingc@engin.umich.edu

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/