The purpose of this project is to code a small data exchange program using UNIX signals.
To generate text : https://www.lipsum.com/
Signals are software interrupts that provide a mechanism for handling asynchronous(not occurring at the same time ) events. These events can originate from outside the system, such as when the user generates the interrupt character by pressing Ctrl-C, or from activities within the program or kernel, such as when the process executes code that divides by zero. As a primitive form of interprocess communication (IPC), one process can also send a signal to another process. … the program handles the signals asynchronously.
First, a signal is raised (we sometimes also say it is sent or generated). The kernel then stores the signal until it is able to deliver it. Finally, once it is free to do so, the kernel handles the signal as appropriate.
Every signal has a symbolic name that starts with the prefix SIG. For example, SIGINT is the signal sent when the user presses Ctrl-C, SIGABRT is the signal sent when the process calls the abort() function, and SIGKILL is the signal sent when a process is forcefully terminated.
Global Variables (You can have one global variable per program (one for the client and one for the server), but you will have to justify their use.)
Global variables are defined outside a function, usually on top of the program. Global variables hold their values throughout the lifetime of your program and they can be accessed inside any of the functions defined for the program. A global variable can be accessed by any function. That is, a global variable is available for use throughout your entire program after its declaration.
Use this command : ps -ax
is a flexible tool for identifying the programs that are running on the system and the resources they are using. It displays statistics and status information about processes on the system, such as process or thread ID, I/O activity, CPU, and memory utilization.
The signal() function is very basic. Because it is part of the standard C library and therefore has to reflect minimal assumptions about the capabilities of the operating system on which it runs, it can offer only a lowest common denominator to signal management. As an alternative, POSIX standardizes the sigaction() system call, which provides much greater signal management capabilities.