#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>

enum exit_codes {
    exit_success,
    exit_failure,
    exit_arguments,
    exit_process,
    exit_signal,
    exit_file
};

void terminate(const char *msg, int code)
{
    perror(msg);
    exit(code);
}

int main()
{
    int fd;

    fd = open("fifo.t", O_WRONLY);
    if (fd == -1)
        terminate("fifo.t", exit_file);

    write(fd, "one", 3);

    return 0;
}
