C language programming assignment

Write a program called signal.c that performs the functions of the standard UNIX kill command.  We will call our program signal instead of kill so that it is clear we are not calling the built-in or standard kill command included on most systems).

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

The program should perform as follows:

1. If no command line arguments are provided, it should display the following usage information:

$ ./signal
Usage: ./signal [options] Options:
   -s   Sends   to    -l            Lists all signal numbers with their names

2. If no specific signal is provided using -s, then the SIGTERM is sent to the specified pid by default:

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

$ ./signal 1289

3. If a specific signal is provided using -s, then that signal is sent to the specified pid instead of TERM:

$ ./signal -s 9 1289

4. If the special (non) signal number 0 is specified, report if the specified pid exists and is able to receive signals.  For example, assuming pid 1289 exists and is ours, 1432 does not exist, and 1 (of course) exists and is not ours:

$ ./signal -s 0 1289
PID 1289 exists and is able to receive signals
or
$ ./signal -s 0 1432
PID 1432 does not exist
or
$ ./signal -s 0 1
PID 1 exists, but we can’t send it signals

Hint: Refer to the following manual pages for helpful details:

$ man 2 kill
$ man 3 errno

Upload your code (do your own work!) here as a single C file named abc123_signal.c

Still stressed from student homework?
Get quality assistance from academic writers!

Order your essay today and save 25% with the discount code LAVENDER