473,472 Members | 1,746 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

<signal.h>

9 New Member
hi,

when I start a compiled program in C (ex: ./program) it generates a process which "dies" at some time.

this is declared on my system with [1]+ 180 exit

how can I make a program which will read this exiting signal and do something else after that?


thank you all in advance
Apr 18 '07 #1
6 2129
antoniosk
9 New Member
let me add that I am using a unix bash shell
Apr 18 '07 #2
gpraghuram
1,275 Recognized Expert Top Contributor
Hi,
you have to have a signal handler inside tyour code and inside the signal handler u can do what u like to.
But the advice for signal handler is,it should be short and no processing should be done inside that.

Thanks
Raghuram
Apr 18 '07 #3
antoniosk
9 New Member
Hi,
you have to have a signal handler inside tyour code and inside the signal handler u can do what u like to.
But the advice for signal handler is,it should be short and no processing should be done inside that.

Thanks
Raghuram
can you please be more specific? what kind of signal should this handler be expecting from the termination of the program?
Apr 18 '07 #4
gpraghuram
1,275 Recognized Expert Top Contributor
Hi,
U have to check signal.h file for the signals.
You can catch all signals except for SIGKILL and SIGSTOP.
If ur process dies while executing, then it may be due to a memory error and u would have received a SISEGV signal.
So first check with ur code and the look at signal handling.

Thanks
Raghuram
Apr 18 '07 #5
ayan4u
86 New Member
have u run a debugger....if not thn use it to get the signal that the system throws and then use the appropriate signal handler......
Apr 18 '07 #6
JosAH
11,448 Recognized Expert MVP
let me add that I am using a unix bash shell
Doesn't have bash a status variable that contains the exit status of the last
terminated process? (I use csh myself, so no further help from me here ;-)

kind regards,

Jos
Apr 18 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Eshrath | last post by:
Hi, What I am trying to do: ======================= I need to form a table in html using the xsl but the table that is formed is quite long and cannot be viewed in our application. So we are...
2
by: Donald Firesmith | last post by:
I am having trouble having Google Adsense code stored in XSL converted properly into HTML. The <> unfortunately become &lt; and &gt; and then no longer work. XSL code is: <script...
1
by: RJN | last post by:
Hi I'm using XMLTextReader to parse the contents of XML. I have issues when the xml content itself has some special characters like & ,> etc. <CompanyName>Johnson & Jhonson</CompanyName>...
11
by: Jackie | last post by:
Hi everyone, I'd like to know when and how signals are used (e.g. SIGFPE, SIGABRT, SIGTERM, SIGSEGV, SIGINT)? Thank you so much.
1
by: JezB | last post by:
I'm binding a DataGrid web-control to data fetched from a database. However some of my data fields contain text that is within <...> characters - I notice that everything between the <> is...
1
by: RJN | last post by:
Hi I'm using XMLTextReader to parse the contents of XML. I have issues when the xml content itself has some special characters like & ,> etc. <CompanyName>Johnson & Jhonson</CompanyName>...
1
by: mike | last post by:
I've got some code like this: gametype_id = Request.Form("gametype_id") response.write "<br>gametype_id from form>" & gametype_id & "<" response.write "<br>gametype_id from database>" &...
3
by: ajay2552 | last post by:
Hi, I have a query. All html tags start with < and end with >. Suppose i want to display either '<' or '>' or say some text like '<Company>' in html how do i do it? One method is to use &lt,...
14
by: Michael | last post by:
Since the include function is called from within a PHP script, why does the included file have to identify itself as a PHP again by enclosing its code in <?php... <?> One would assume that the...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.