Ticket #19212: fu.c

File fu.c, 515 bytes (added by bhaible, 42 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 struct timespec ts[2] = {
18 { .tv_sec = 1730303310, .tv_nsec = 0 },
19 { .tv_sec = 1730303310, .tv_nsec = 0 },
20 };
21 int ret = futimens (fd, ts);
22 if (ret < 0)
23 perror ("futimens");
24
25 close (fd);
26 }
27}