Ticket #19213: fu.c

File fu.c, 531 bytes (added by bhaible, 40 hours ago)

test case fu.c

Line 
1#include <sys/stat.h>
2#include <fcntl.h>
3#include <time.h>
4#include <stdio.h>
5#include <unistd.h>
6
7int main ()
8{
9 for (int i = 0; i < 10; i++) {
10 char buf[100];
11 sprintf (buf, "dummy%d", i);
12
13 int fd = open (buf, O_CREAT|O_RDWR, 0644);
14 if (fd < 0)
15 perror ("open");
16
17 close (fd);
18
19 struct timespec ts[2] = {
20 { .tv_sec = 1730303310, .tv_nsec = 0 },
21 { .tv_sec = 1730303310, .tv_nsec = 0 },
22 };
23 int ret = utimensat (AT_FDCWD, buf, ts, 0);
24 if (ret < 0)
25 perror ("utimensat");
26 }
27}