Messages in this thread | ![/](/images/icornerl.gif) | | From | David Mosberger <> | Date | Mon, 7 Apr 2003 11:08:27 -0700 | Subject | Re: Same syscall is defined to different numbers on 3 different archs(was Re: Makefile issue) |
| |
>>>>> On Mon, 7 Apr 2003 11:26:49 -0500, "Robert Williamson" <robbiew@us.ibm.com> said:
Robert> Hmmm...so I guess the only viable solution for a single test Robert> to cover as many archs as possible, is to explicitly define Robert> the number for each arch.
Robert> Here's how I would do it Aniruddha: Robert> ------------------------------------------ Robert> #ifdef __i386__ Robert> #define __NR_timer_create 259 Robert> #endif
Robert> #ifdef __x86_64__ Robert> #define __NR_timer_create 222 Robert> #endif
Robert> #if defined(__ppc__) || defined(__ppc64__) Robert> #define __NR_timer_create 240 Robert> #else /* Not defined on this architecture */
Robert> #include "test.h" Robert> #include "usctest.h"
Robert> int TST_TOTAL = 0; /* Total number of testcases */
Robert> int main() Robert> { Robert> tst_resm(TCONF,"This system call is not defined for this architecture."); Robert> tst_exit(); Robert> /* NOT REACHED */ Robert> return(0); Robert> } Robert> #endif /* Not defined on this architecture */
Robert> <REST OF TEST HERE> Robert> ------------------------------------------
Robert> Any comments???
Why use such ugly, platform-dependent code when syscall(3) will do it just fine? (AFAIK, there is no man-page for syscall(3), but the glibc info manual documents it in detail.)
--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/
| ![\](/images/icornerr.gif) |