1N/Ahdr time
1N/Alib clock_settime,gettimeofday,settimeofday,stime,utimes
1N/Alib nanosleep,usleep
1N/Alib utimensat -D_ATFILE_SOURCE sys/stat.h note{ complete utimensat implementation }end link{
1N/A #include <fcntl.h>
1N/A static struct timespec ts[2];
1N/A int
1N/A main()
1N/A {
1N/A ts[0].tv_nsec = UTIME_NOW;
1N/A ts[1].tv_nsec = UTIME_OMIT;
1N/A return utimensat(AT_FDCWD, ".", ts, AT_SYMLINK_NOFOLLOW) != 0;
1N/A }
1N/A}end
1N/A
1N/Aif ! mem timeval.tv_sec sys/time.h {
1N/A struct timeval
1N/A {
1N/A time_t tv_sec;
1N/A time_t tv_usec;
1N/A };
1N/A}
1N/Aendif
1N/A
1N/Alib clock_gettime execute{
1N/A #include <time.h>
1N/A int
1N/A main()
1N/A {
1N/A struct timespec tv;
1N/A return clock_gettime(CLOCK_REALTIME, &tv) != 0;
1N/A }
1N/A}end
1N/A
1N/Alib utimets link{
1N/A #include <time.h>
1N/A #include <sys/time.h>
1N/A static struct timespec tv;
1N/A int
1N/A main()
1N/A {
1N/A return utimets(".", &tv) != 0;
1N/A }
1N/A}end
1N/A
1N/Atst - -DN=1 - -DN=2 - -DN=3 - -DN=4 output{
1N/A #include <sys/types.h>
1N/A #include <sys/time.h>
1N/A int
1N/A main()
1N/A {
1N/A struct timeval tv;
1N/A#if N == 1
1N/A struct timezone tz;
1N/A if (gettimeofday(&tv, (struct timezone*)0) < 0)
1N/A return 1;
1N/A printf("#define tmgettimeofday(p) gettimeofday(p,(struct timezone*)0)\n");
1N/A#if _lib_settimeofday
1N/A printf("#define tmsettimeofday(p) settimeofday(p,(struct timezone*)0)\n");
1N/A#endif
1N/A#endif
1N/A#if N == 2
1N/A if (gettimeofday(&tv, (void*)0) < 0)
1N/A return 1;
1N/A printf("#define tmgettimeofday(p) gettimeofday(p,(void*)0)\n");
1N/A#if _lib_settimeofday
1N/A printf("#define tmsettimeofday(p) gettimeofday(p,(void*)0)\n");
1N/A#endif
1N/A#endif
1N/A#if N == 3
1N/A if (gettimeofday(&tv) < 0)
1N/A return 1;
1N/A printf("#define tmgettimeofday(p) gettimeofday(p)\n");
1N/A#if _lib_settimeofday
1N/A printf("#define tmsettimeofday(p) settimeofday(p)\n");
1N/A#endif
1N/A#endif
1N/A return 0;
1N/A }
1N/A}end