1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
16 #include <sys/types.h>
19 int main(int argc, char **argv)
24 printf("Usage: %s <filename>\n", argv[0]);
28 fd = open(argv[1], O_RDONLY | O_CREAT, 0600);
30 printf("Error opening %s for create: %s\n", argv[1],
36 printf("Error closing %s: %s\n", argv[1], strerror(errno));
40 fd = open(argv[1], O_DIRECTORY);
42 printf("opening %s as directory should have returned an "
46 if (errno != ENOTDIR) {
47 printf("opening %s as directory, expected -ENOTDIR and got "
48 "%s\n", argv[1], strerror(errno));