/* * I stole this from linux nfsd 2.2, which in its turn copied it from * libc. * * If you get errors complaining that setfsuid() is not defined, * add #include "fakesfuid.h" at the end of the #include list. */ #ifndef FAKESFUID_H #include /* stolen from /usr/include/asm/unistd.h */ static inline int setfsuid(uid_t fsuid) { long __res; __asm__ volatile ("int $0x80" : "=a" (__res) : "0" (__NR_setfsuid),"b" ((long)(fsuid))); if (__res >= 0) return (int) __res; errno = -__res; return -1; } static inline int setfsgid(gid_t fsgid) { long __res; __asm__ volatile ("int $0x80" : "=a" (__res) : "0" (__NR_setfsgid),"b" ((long)(fsgid))); if (__res >= 0) return (int) __res; errno = -__res; return -1; } #endif