I have been experiencing problems compiling proftpd as position independent code on my older glibc (RH 7.3). The problem is that with older glibcs' _syscallN() it is neccessary tu push/pop %ebx register around the syscall (%ebx is used as output, which is not acceptable in position independent code). As far as I know, however, newer glibcs do not suffer from this problem. --- JiKos --- cap_sys.c.old 2004-11-19 14:55:50 +0100 +++ cap_sys.c 2004-11-19 14:50:55 +0100 @@ -11,11 +11,20 @@ #define __LIBRARY__ #include -_syscall2(int, capget, +#define _syscall2_pic(type,name,type1,arg1,type2,arg2) \ +type name(type1 arg1,type2 arg2) \ +{ \ +long __res; \ +__asm__ volatile ("pushl %%ebx; movl %2,%%ebx; int $0x80; popl %%ebx" \ + : "=a" (__res) \ + : "0" (__NR_##name),"g" ((long)(arg1)),"c" ((long)(arg2))); \ +__syscall_return(type,__res); \ +} +_syscall2_pic(int, capget, cap_user_header_t, header, cap_user_data_t, data) -_syscall2(int, capset, +_syscall2_pic(int, capset, cap_user_header_t, header, const cap_user_data_t, data)