From: Tom H. <th...@cy...> - 2003-04-22 08:05:08
|
In message <00f201c30869$f2414d20$120...@gs...> Matthew Emmerton <ma...@gs...> wrote: > I propose introducing a vg_syscall.h file that maps the platform's syscall > #defines to valgrind-specific #defines. This would limit the scope of the > syscall-related changes required on non-Linux platforms to vg_syscalls.[ch], > rather than <n> files (<n> currently 7 on FreeBSD) just to patch up the __NR > syscall symbols. > > Although this means another file to keep updated, it provides an easy place > to document various kernel API changes, with the corresponding > implementations in vg_syscalls.c. > > For example, on Linux, we'd have something like this: > > vg_syscall.h: > #define VKI_SC_exit __NR_exit > #define VKI_SC_getpid __NR_getpid > > And on FreeBSD, we'd have something like this: > > #define VKI_SC_exit SYS_exit > #define VKI_SC_getpid SYS_getpid Linux does already have defines for the SYS_xxx names and including sys/syscall.h should get you those defines, which are defined to the appropriate __NR_xxx name. Tom -- Tom Hughes (th...@cy...) Software Engineer, Cyberscience Corporation http://www.cyberscience.com/ |