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