On Fri, Dec 9, 2011 at 3:02 PM, Ian Lance Taylor <i...@google.com> wrote:
> "H.J. Lu" <hjl.to...@gmail.com> writes:
>
>> On Fri, Dec 9, 2011 at 2:47 PM, Ian Lance Taylor <i...@google.com> wrote:
>>> "H.J. Lu" <hongjiu...@intel.com> writes:
>>>
>>>> Some my Linux system, system call numbers are defined as
>>>>
>>>> #define __NR_x32_rt_sigaction                 __NR_X32_SYSCALL(0)
>>>>
>>>> and
>>>>
>>>> __NR_X32_SYSCALL(0) is expanded to (0x40000000 | (512 + 0)).  This patch
>>>> tries to deal with by checking '^// unknowndefine SYS_[a-z]' and uses
>>>> "${CC} -E" to extract the real number.  Tested on Linux/x86-64.  OK
>>>> to install?
>>>
>>> This patch might be a little simpler.  Does it solve the problem?
>>>
>>
>> It doesn't work. I didn't define all system call numbers which are mapped to
>> sys_ni_syscall in kernel.  If you use them, you will get a compile
>> time error since those __NR_XXXX aren't defined.  I used
>>
>> +    ${CC} -E unknown-syscalls.c | \
>> +      grep "^const SYS_.*=" | \
>> +      grep -v __NR_ >> ${OUT}
>>
>> to filter them out.
>
> Can you send me your relevant syscall.h files?
>
> I'm hoping for something a little more generalizable than your patch,
> because we have the same issue for <sys/ioctl.h> on some systems.  It
> may not be solvable, but I'd like to try a little harder to see if it
> is.  Thanks.
>
> Ian

Here it is.  For x32, where __x86_64__ is defined and __LP64__ isn't defined,
not all __NR_XXX are defined, like __NR_epoll_ctl_old.


-- 
H.J.

Attachment: syscall.tar.bz2
Description: BZip2 compressed data

Reply via email to