Advertisement
Guest User

Untitled

a guest
Mar 30th, 2015
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <unistd.h>
  2. #define SERVER "./fifo_server"
  3. #define CLIENT "./fifo_client"
  4. #define FIFO "/tmp/rotten_hack"
  5. /* a NON-ERROR-CHECKED driver for the FIFO server and client */
  6. main(int argc, char **argv)
  7. {
  8. mkfifo(FIFO, S_IRWXU);
  9. if(fork())
  10. {
  11. execl(SERVER, (char *) NULL);
  12. }
  13. if(fork())
  14. {
  15. execl(CLIENT, (char *) NULL);
  16. }
  17. unlink(FIFO); /* is there a synchronization issue here? */
  18. return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement