SlideShare a Scribd company logo
1 of 3
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

More from herminaprocter

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

More from herminaprocter (20)

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

Recently uploaded

Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIShubhangi Sonawane
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 

Recently uploaded (20)

Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.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