* Test that flopen() can create a file. */
| 45 | * Test that flopen() can create a file. |
| 46 | */ |
| 47 | const char * |
| 48 | test_flopen_create(void) |
| 49 | { |
| 50 | const char *fn = "test_flopen_create"; |
| 51 | const char *result = NULL; |
| 52 | int fd; |
| 53 | |
| 54 | unlink(fn); |
| 55 | fd = flopen(fn, O_RDWR|O_CREAT, 0640); |
| 56 | if (fd < 0) { |
| 57 | result = strerror(errno); |
| 58 | } else { |
| 59 | close(fd); |
| 60 | } |
| 61 | unlink(fn); |
| 62 | return (result); |
| 63 | } |
| 64 | |
| 65 | /* |
| 66 | * Test that flopen() can open an existing file. |