SlideShare a Scribd company logo
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).
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:
$ ./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

More Related Content

PPTX
Unixppt (1) (1).pptx
PPTX
Unix signals
PPTX
07 Systems Software Programming-IPC-Signals.pptx
DOCX
AOS Chapter 6 for internal.docx
PDF
Signal Handling in Linux
PDF
System Programming Assignment Help- Signals
PPTX
PDF
Course 102: Lecture 19: Using Signals
Unixppt (1) (1).pptx
Unix signals
07 Systems Software Programming-IPC-Signals.pptx
AOS Chapter 6 for internal.docx
Signal Handling in Linux
System Programming Assignment Help- Signals
Course 102: Lecture 19: Using Signals

Similar to Write a program called signal.c that performs the functions of t.docx (20)

PPT
signal power point presentation it is useful
PPT
11_UNIX_Processes_Including_Select.ppt
PPT
SOGNAL DAEMON AND PROCESSING CRYPTOGRAPHY NOTES
PDF
PDF
Usp notes unit6-8
PPTX
Unix-module4.Unit 2 Virtualization Part I.pptx
PPT
Unit 3.2 Process Control.ppt (Process Control and Scheduling)
PDF
Unix presentation.pdf
PDF
System calls
PPTX
Process management
PPT
Traffic Signal Synchronization Operating Systems
PPT
signals & message queues overview
PDF
Systems Programming Assignment Help - Processes
PDF
Lecture2 process structure and programming
PDF
ODP
6. processes and threads
PDF
#define LOGFILE signal_log.txt Signal handlers void sigusr1.pdf
PPTX
unix- the process states, zombies, running jobs in background
PPT
process creation OS
PPTX
04_ForkPipe.pptx
signal power point presentation it is useful
11_UNIX_Processes_Including_Select.ppt
SOGNAL DAEMON AND PROCESSING CRYPTOGRAPHY NOTES
Usp notes unit6-8
Unix-module4.Unit 2 Virtualization Part I.pptx
Unit 3.2 Process Control.ppt (Process Control and Scheduling)
Unix presentation.pdf
System calls
Process management
Traffic Signal Synchronization Operating Systems
signals & message queues overview
Systems Programming Assignment Help - Processes
Lecture2 process structure and programming
6. processes and threads
#define LOGFILE signal_log.txt Signal handlers void sigusr1.pdf
unix- the process states, zombies, running jobs in background
process creation OS
04_ForkPipe.pptx
Ad

More from herminaprocter (20)

DOCX
2. Framework Graphic  Candidates will create a graphic that re.docx
DOCX
2. Research Article Review – Read one (1) research articles on T.docx
DOCX
2) In examining Document 4 and Document 6, how did the.docx
DOCX
2-3 pages in length (including exhibits, tables and appendices.docx
DOCX
2. Sandra is a parent who believes that play is just entertainment f.docx
DOCX
2.2 Discussion What Is LeadershipGetting StartedR.docx
DOCX
2.  You are a member of the Human Resource Department of a medium-si.docx
DOCX
2.1.  What is Strategic Human Resource Management Differentiate bet.docx
DOCX
2,___Use of no less than six slides and no more than seven .docx
DOCX
2. Multicultural Interview Paper Students may begin this.docx
DOCX
2-4A summary of your findings regarding sexual orientation and.docx
DOCX
2- to 4A description of the services in your local communi.docx
DOCX
2  or more paragraphAs previously noted, the Brocks have some of.docx
DOCX
2-1 IntroductionUber Technologies Inc. (Uber) is a tech startu.docx
DOCX
2 postsRe Topic 2 DQ 1Social determinants of health are fac.docx
DOCX
2 peer responses due in 4 hoursMALEETAS POSTWorld War .docx
DOCX
2 Pages for 4 questions below1) Some say that analytics in gener.docx
DOCX
2 Ethics Session 1.pptxEthics in Engineering Pra.docx
DOCX
2 1 5L e a r n I n g o b j e c t I v e sC H A P T E R.docx
DOCX
2 Requirements Elicitation A Survey of Techniques, Ap.docx
2. Framework Graphic  Candidates will create a graphic that re.docx
2. Research Article Review – Read one (1) research articles on T.docx
2) In examining Document 4 and Document 6, how did the.docx
2-3 pages in length (including exhibits, tables and appendices.docx
2. Sandra is a parent who believes that play is just entertainment f.docx
2.2 Discussion What Is LeadershipGetting StartedR.docx
2.  You are a member of the Human Resource Department of a medium-si.docx
2.1.  What is Strategic Human Resource Management Differentiate bet.docx
2,___Use of no less than six slides and no more than seven .docx
2. Multicultural Interview Paper Students may begin this.docx
2-4A summary of your findings regarding sexual orientation and.docx
2- to 4A description of the services in your local communi.docx
2  or more paragraphAs previously noted, the Brocks have some of.docx
2-1 IntroductionUber Technologies Inc. (Uber) is a tech startu.docx
2 postsRe Topic 2 DQ 1Social determinants of health are fac.docx
2 peer responses due in 4 hoursMALEETAS POSTWorld War .docx
2 Pages for 4 questions below1) Some say that analytics in gener.docx
2 Ethics Session 1.pptxEthics in Engineering Pra.docx
2 1 5L e a r n I n g o b j e c t I v e sC H A P T E R.docx
2 Requirements Elicitation A Survey of Techniques, Ap.docx
Ad

Recently uploaded (20)

PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
Cell Types and Its function , kingdom of life
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
RMMM.pdf make it easy to upload and study
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
A systematic review of self-coping strategies used by university students to ...
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
Pharma ospi slides which help in ospi learning
PPTX
Cell Structure & Organelles in detailed.
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PPTX
Institutional Correction lecture only . . .
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Cell Types and Its function , kingdom of life
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
RMMM.pdf make it easy to upload and study
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Supply Chain Operations Speaking Notes -ICLT Program
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
A systematic review of self-coping strategies used by university students to ...
Anesthesia in Laparoscopic Surgery in India
Pharma ospi slides which help in ospi learning
Cell Structure & Organelles in detailed.
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
Institutional Correction lecture only . . .
Module 4: Burden of Disease Tutorial Slides S2 2025
102 student loan defaulters named and shamed – Is someone you know on the list?
Microbial disease of the cardiovascular and lymphatic systems
O5-L3 Freight Transport Ops (International) V1.pdf

Write a program called signal.c that performs the functions of t.docx

  • 1. 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). 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: $ ./signal 1289
  • 2. 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
  • 3. Upload your code (do your own work!) here as a single C file named abc123_signal.c