#include <stdio.h>
#include <stdlib.h>
#include <err.h>
#include <fcntl.h>
#include <unistd.h>

int
main(void)
{
    int fd;
    char buf[7];

    fd = open("log", O_CREAT | O_EXCL | O_RDONLY, S_IRWXU);
    if (fd == -1)
        err(EXIT_FAILURE, "open");
    if (read(fd, buf, 6) == -1)
        err(EXIT_FAILURE, "read");
    buf[6] = '\0';
    printf("<%s>\n", buf);
    exit(EXIT_SUCCESS);
}
