This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Deprecate and remove SYS_ system call numbers?


On Mon, Aug 8, 2016 at 2:36 PM, Florian Weimer <fweimer@redhat.com> wrote:
>
> Do you think it would be worthwhile to deprecate the SYS_ re-defines of the __NR_ system call numbers?
>
> The primary use of these macros is the syscall function, which allows you to do perform system calls without glibc wrappers.  The __NR_ macros come from the kernel headers, the SYS_ macros are synthesized from the kernel headers at glibc build time.  Programmers may not be aware of the difference and use the SYS_ macros for writing fallback code, unaware that older glibc releases may not have them.


I did a bit of scanning across Google's sources, and came up with
several thousand uses of SYS_ macros to syscall().  It seems to be a
variety of contexts, not just old code, or imports from external
projects.  The __NR_ macros are more popular though, by an order of
magnitude or so.

Not clear why the SYS_ versions are used, reasons could be as simple
as inertia or personal habit.  We do have Rosie (as described in last
month's CACM) to make mass changes, so deprecation would be a nuisance
but not a disaster. :-)

Stan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]