Home | History | Annotate | Download | only in darwin
      1 #include <stdio.h>
      2 #include <stdlib.h>
      3 
      4 #include <sys/syscall.h>
      5 #include <unistd.h>
      6 #include <fcntl.h>
      7 
      8 #ifndef SYS_mkfifo
      9 # define SYS_mkfifo 132
     10 #endif
     11 
     12 static char f_name[]="mkfifo_data_file";
     13 
     14 int mkfifo(const char *path)
     15 {
     16    return syscall(SYS_mkfifo, path);
     17 }
     18 
     19 int main(void)
     20 {
     21    int fd;
     22 
     23    fd = mkfifo(f_name);
     24 
     25    if (fd == -1)
     26       perror("mkfifo"), exit(1);
     27 
     28    unlink(f_name);
     29 
     30    return 0;
     31 }
     32