36 clock_xettime
EOF
-# Surprised that fcntl*, futimesat, utime, utimensat, and utimes tests
-# linked with musl use clock_gettime? Me too!
-grep -E -v '^(#|clock_|times$|fcntl|futimesat$|utime)' \
+# Surprised that fcntl* tests linked with musl use clock_gettime? Me too!
+grep -E -v '^(#|clock_|times$|fcntl)' \
< "$srcdir/pure_executables.list" > negative.list
while read s; do {
int
main(void)
{
- struct timeval tv;
- if (gettimeofday(&tv, NULL))
- perror_msg_and_fail("gettimeofday");
-
static const char sample[] = "futimesat_sample";
unsigned long dirfd = (unsigned long) 0xdeadbeef00000000ULL | -100U;
struct timeval *const ts = tail_alloc(sizeof(*ts) * 2);
dirfd = (unsigned long) 0xdeadbeefffffffffULL;
- ts[0].tv_sec = tv.tv_sec;
- ts[0].tv_usec = tv.tv_usec;
- ts[1].tv_sec = tv.tv_sec - 1;
- ts[1].tv_usec = tv.tv_usec + 1;
+ ts[0].tv_sec = 1492356708;
+ ts[0].tv_usec = 567891234;
+ ts[1].tv_sec = 1492357086;
+ ts[1].tv_usec = 678902345;
rc = syscall(__NR_futimesat, dirfd, 0, ts + 2);
printf("futimesat(%d, NULL, %p) = %ld %s (%m)\n",
{
static const char *const dummy_str = "dummy filename";
- const time_t t = time(NULL);
+ const time_t t = 1492350678;
const struct utimbuf u = { .actime = t, .modtime = t };
const struct utimbuf *const tail_u = tail_memdup(&u, sizeof(u));
const char *const dummy_filename =
#define PREFIX "utimensat(AT_FDCWD, \"utimensat\\nfilename\", "
printf(PREFIX "NULL, 0) = -1 ENOENT (%m)\n");
- struct timeval tv;
struct timespec ts[2];
-
- if (gettimeofday(&tv, NULL))
- perror_msg_and_skip("gettimeofday");
-
- ts[0].tv_sec = tv.tv_sec;
- ts[0].tv_nsec = tv.tv_usec;
- ts[1].tv_sec = tv.tv_sec - 1;
- ts[1].tv_nsec = tv.tv_usec + 1;
+ ts[0].tv_sec = 1492358706;
+ ts[0].tv_nsec = 123456789;
+ ts[1].tv_sec = 1492357068;
+ ts[1].tv_nsec = 234567890;
printf(PREFIX "[");
print_ts(&ts[0]);
int
main(void)
{
- struct timeval tv;
- if (gettimeofday(&tv, NULL))
- perror_msg_and_fail("gettimeofday");
-
static const char sample[] = "utimes_sample";
long rc = syscall(__NR_utimes, sample, 0);
struct timeval *const ts = tail_alloc(sizeof(*ts) * 2);
- ts[0].tv_sec = tv.tv_sec;
- ts[0].tv_usec = tv.tv_usec;
- ts[1].tv_sec = tv.tv_sec - 1;
- ts[1].tv_usec = tv.tv_usec + 1;
+ ts[0].tv_sec = 1492358607;
+ ts[0].tv_usec = 345678912;
+ ts[1].tv_sec = 1492356078;
+ ts[1].tv_usec = 456789023;
rc = syscall(__NR_utimes, 0, ts + 2);
printf("utimes(NULL, %p) = %ld %s (%m)\n", ts + 2, rc, errno2name());