Re: Same syscall is defined to different numbers on 3 different archs(was Re: Makefile issue)

From: David Mosberger (davidm@napali.hpl.hp.com)
Date: Mon Apr 07 2003 - 13:49:52 EST


>>>>> On Mon, 7 Apr 2003 13:16:21 -0500, "Robert Williamson" <robbiew@us.ibm.com> said:

  Robert> The original note had the testcases in question, which uses
  Robert> _syscall3......but since this was left off I'll summarize.
  Robert> The author did use the following:

  Robert> _syscall3 (int, timer_create, clockid_t, which_clock, struct sigevent *,
  Robert> timer_event_spec, timer_t *, timer_id);

  Robert> but compilation failed with:

  Robert> timer_delete01.c: In function `timer_create':
  Robert> timer_delete01.c:86: `__NR_timer_create' undeclared (first use in this
  Robert> function)

  Robert> The only way we were able to resolve this was to either to
  Robert> add the kernel includes to the include path: "-I
  Robert> /usr/src/linux-2.5.66/include". Obviously, this option will
  Robert> not work for the LTP and our users who frequently change
  Robert> kernel levels and install locations, we have to use "such
  Robert> ugly, platform-dependent code"

But you still can use syscall() instead of the non-portable syscallN()
macros. Also, it should go something like this:

#include <sys/syscall.h>

#ifndef SYS_timer_create
# if defined(__i386)
# define SYS_timer_create 259
# elif defined(...)
   ...
# endif
#endif

        --david
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Apr 07 2003 - 22:00:32 EST