Lecture Operating systems: Lesson 11 - Dr. Syed Mansoor Sarwar. The main topics covered in this lesson include: use of FIFOs in a program; mknod system call; mkfifo library cal; example code; Client-Server code; process management commands in UNIX/Linux; managing Unix/Linux processes | Operating Systems Lecture 11 Agenda for Today Review of previous lecture Use of FIFOs in a program Example code Process management commands in UNIX Linux Recap of lecture 28 April 2022 Copyright Virtual University of Pakistan Review of Lecture 10 Input output and error redirection Use of FIFOs at the command line UNIX Linux commands cat find grep mkfifo tee wc 28 April 2022 Copyright Virtual University of Pakistan mknod System Call include include int mknod const char path mode_t mode dev_t dev mode should be permission mode OR-ed with S_IFIFO dev is set to 0 for a FIFO 28 April 2022 Copyright Virtual University of Pakistan mknod System Call mknod fails File with the given name exists Pathname too long A component in the pathname not searchable non-existent or non- directory Destination directory is read-only Not enough memory space available Signal caught during mknod 28 April 2022 Copyright Virtual University of Pakistan mkfifo Library Call include include int mkfifo const char path mode_t mode mode sets permission on FIFO Calls mknod 28 April 2022 Copyright Virtual University of Pakistan mkfifo Library Call mkfifo fails File with the given name exists Pathname too long A component in the pathname not searchable non-existent or non- directory Destination directory is read-only Not enough memory space available Signal caught during mkfifo 28 April 2022 Copyright Virtual University of Pakistan Example FIFO1 Server Client FIFO2 28 April 2022 Copyright Virtual University of Display Screen Pakistan Client-Server Code include include include include include extern int errno define FIFO1 quot tmp quot define FIFO2 quot tmp quot define PERMS 0666 define MESSAGE1 quot Hello world n quot define 28 April 2022MESSAGE2 quot Hello Copyright class n quot Virtual University of Pakistan Server Code include quot main char buff BUFSIZ int readfd writefd int n size if mknod FIFO1 S_IFIFO PERMS 0 lt 0 amp amp errno EEXIST perror quot mknod FIFO1 quot exit 1 28 .