From: Mike F. <va...@us...> - 2006-08-22 05:43:19
|
Update of /cvsroot/ltp/ltp/testcases/kernel/timers/clock_gettime In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv8730/clock_gettime Modified Files: clock_gettime02.c clock_gettime03.c Log Message: move common defines/functions/etc... to one header file so we have to get it right just once Index: clock_gettime03.c =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/timers/clock_gettime/clock_gettime03.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** clock_gettime03.c 11 Feb 2006 07:27:16 -0000 1.3 --- clock_gettime03.c 22 Aug 2006 05:43:15 -0000 1.4 *************** *** 68,123 **** *****************************************************************************/ ! #include "test.h" ! #include "usctest.h" #include <errno.h> - #include <syscall.h> #include <time.h> ! #ifndef _syscall2 ! #include <linux/unistd.h> ! #endif ! ! ! #ifndef __NR_timer_create ! #if defined(__i386__) ! #define __NR_timer_create 259 ! #endif ! #endif ! ! #ifndef __NR_clock_gettime ! #if defined(__i386__) ! #define __NR_clock_gettime (__NR_timer_create + 6) ! #elif defined(__ppc__) ! #define __NR_clock_gettime 246 ! #elif defined(__powerpc64__) ! #define __NR_clock_gettime 246 ! #elif defined(__x86_64__) ! #define __NR_clock_gettime 228 ! #endif ! #endif ! ! #ifndef CLOCK_REALTIME ! #define CLOCK_REALTIME 0 ! #endif ! #ifndef CLOCK_PROCESS_CPUTIME_ID ! #define CLOCK_PROCESS_CPUTIME_ID 2 ! #endif ! #ifndef CLOCK_THREAD_CPUTIME_ID ! #define CLOCK_THREAD_CPUTIME_ID 3 ! #endif ! #ifndef CLOCK_REALTIME_HR ! #define CLOCK_REALTIME_HR 4 ! #endif ! #ifndef CLOCK_MONOTONIC_HR ! #define CLOCK_MONOTONIC_HR 5 ! #endif ! #ifndef MAX_CLOCKS ! #define MAX_CLOCKS 6 ! #endif ! ! /* Weak symbol. Newer glibc should have definition for clock_gettime. ! * Then, it will supersede the definition in this code ! */ ! #pragma weak clock_gettime static void setup(); --- 68,79 ---- *****************************************************************************/ ! #include <stdlib.h> #include <errno.h> #include <time.h> + #include <signal.h> ! #include "test.h" ! #include "usctest.h" ! #include "common_timers.h" static void setup(); *************** *** 144,150 **** }; - /* register clock_gettime as system call */ - _syscall2(int, clock_gettime, clockid_t, which_clock, struct timespec *, tp); - int main(int ac, char **av) --- 100,103 ---- Index: clock_gettime02.c =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/timers/clock_gettime/clock_gettime02.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** clock_gettime02.c 11 Feb 2006 07:27:16 -0000 1.3 --- clock_gettime02.c 22 Aug 2006 05:43:15 -0000 1.4 *************** *** 64,106 **** *****************************************************************************/ ! #include "test.h" ! #include "usctest.h" #include <errno.h> - #include <syscall.h> #include <time.h> ! #ifndef _syscall2 ! #include <linux/unistd.h> ! #endif ! ! ! #ifndef __NR_timer_create ! #if defined(__i386__) ! #define __NR_timer_create 259 ! #endif ! #endif ! ! #ifndef __NR_clock_gettime ! #if defined(__i386__) ! #define __NR_clock_gettime (__NR_timer_create + 6) ! #elif defined(__ppc__) ! #define __NR_clock_gettime 246 ! #elif defined(__powerpc64__) ! #define __NR_clock_gettime 246 ! #elif defined(__x86_64__) ! #define __NR_clock_gettime 228 ! #endif ! #endif ! #ifndef CLOCK_REALTIME ! #define CLOCK_REALTIME 0 ! #endif ! #ifndef CLOCK_MONOTONIC ! #define CLOCK_MONOTONIC 1 ! #endif ! ! /* Weak symbol. In newer glibc, clock_gettime should be defined. Then ! * it will superseed the definition from this file ! */ ! #pragma weak clock_gettime static void setup(); --- 64,75 ---- *****************************************************************************/ ! #include <stdlib.h> #include <errno.h> #include <time.h> + #include <signal.h> ! #include "test.h" ! #include "usctest.h" ! #include "common_timers.h" static void setup(); *************** *** 111,117 **** extern int Tst_count; /* Test Case counter for tst_* routines */ - /* register clock_gettime as system call */ - _syscall2(int, clock_gettime, clockid_t, which_clock, struct timespec *, tp); - int main(int ac, char **av) --- 80,83 ---- |