-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_5187.c.BAK
33 lines (27 loc) · 886 Bytes
/
test_5187.c.BAK
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
static char mkostemp_tmpl[] = "/tmp/tmpXXXXXX";
static char mkostemps_tmpl[] = "/tmp/tmpXXXXXXsuff.tmp";
int
main(int argc, char **argv) {
int mkostemp_fd, mkostemps_fd;
mkostemp_fd = mkostemp64(mkostemp_tmpl, O_RDWR);
if (mkostemp_fd == -1) {
perror("error opening mkostemp_fd");
} else {
printf("mkostemp_fd openes %s\n", mkostemp_tmpl);
close(mkostemp_fd);
}
mkostemps_fd = mkostemps(mkostemps_tmpl, 8, O_RDWR);
if (mkostemps_fd == -1) {
perror("error opening mkostemps_fd");
} else {
printf("mkostemps_fd openes %s\n", mkostemps_tmpl);
close(mkostemps_fd);
}
return (0);
}