Sponsored Content
Top Forums Programming How to implement SIGKILL and SIGTERM and print a message? Post 302144824 by porter on Saturday 10th of November 2007 08:36:11 AM
Old 11-10-2007
Quote:
Originally Posted by matrixmadhan
... list of function calls that should not be called in a signal handler ?
Different operating systems have different implementations of functions, so it is better to err on the side of safety. It would be simpler to have a list of functions that can be called.

Quote:
Originally Posted by matrixmadhan
I have been thinking write () is uninterrupted until it is done - this is something new from the statement that it is ' partially ' atomic.
Also depends if you are using non-blocking IO.

Is there any way I could test this behavior by some kind of simulation ?

Here is one more point / question ,
with newer signal semantics - using sigaction

Quote:
Originally Posted by matrixmadhan
kernel guarantees the binary that when executing the handler registered for a possible signal, within that block another signal of the same kind would not be delivered until it returns - in such case why shouldn't a fflush operation be used ?
Good point, except alot of memory management his handled inside libc, not the kernel, so a signal can occur in the middle of, say, malloc or free, while the routine is updating a list of free memory pointers, if you interrupt and call in the middle another memory allocation routine you could upset the apple cart. Basically, those routines not being reentrant.

If you move onto threaded code, you don't use signal handlers at all, you use sigwait() to return you a signal once it occurs.
 

10 More Discussions You Might Find Interesting

1. Programming

signals - SIGTERM

Hi all, I need some urgent help. we are using Dynix/ptx V4.5 on i386, have several processes and instances are running on the box round the clock.we increased the processes recently. We have coded to handle the signals in our programs. Recently, we noticed most of our processes are... (2 Replies)
Discussion started by: reddyb
2 Replies

2. Shell Programming and Scripting

Why SIGKILL will occur?

Hi Gurus, I am executing my Datastage jobs on UNIX operating System. While running the jobs i am getting the following error: main_program: Unexpected termination by Unix signal 9(SIGKILL) Can any one please let me know what are the possible situations where this SIGKILL will arrise? ... (9 Replies)
Discussion started by: choppas
9 Replies

3. Solaris

To print Coloured Prelogin Message on SOLARIS--9................

Hiiii..... Every one...... I am using /etc/issue file to display Pre-login Message on my system, installed with SOLARIS-9. I am getting this Message in White fonts having Black background ( Colour of the Screen)..... So, is there ... (2 Replies)
Discussion started by: prashantshukla
2 Replies

4. Shell Programming and Scripting

Error while trying to print message

Hi all Geting this error while trying to print message as : ./logfunc: print: bad file unit number heres what i m trying to do : log_date="$(date '+%d/%m/%Y %H:%M:%S')" log_type="Message" print "${log_date}: ${log_type}" print -u3 "${log_date}: ${log_type}" this error is due to... (3 Replies)
Discussion started by: Navatha
3 Replies

5. Shell Programming and Scripting

Print a message at specific line on prompt

Hi Friends, I am using HP-UNIX(ksh). I want to print a message at specific line on the prompt screen. For Example: for num in 1 10 3 145 do echo $num // need to print this on the same line for each number sleep 2 done Actual Output: ========== 1 10 3 145 Expected Output:... (5 Replies)
Discussion started by: Niroj
5 Replies

6. Solaris

SIGQUIT and SIGKILL message

Dear All, I have machine with SunOS 5.10 Generic_138888-01 sun4v sparc SUNW,SPARC-Enterprise-T5120. Yesterday there is something at dmesg command : May 25 18:09:02 cacao_launcher: Timeout occured on heartbeat channel, cleanup engaged May 25 18:09:07 cacao_launcher: watchdog : warning,... (0 Replies)
Discussion started by: mbah_jiman
0 Replies

7. Shell Programming and Scripting

How to detect SIGTERM,SIGKILL signal in UNIX

Dear All We have JBOSS server running on Linux we need to track Graceful Shutdown(SIGTERM) and Forceful Shutdown(SIGKILL) timestamp and write it into one file, I am new to UNIX Signal processing if is it possible how to detect it? We generally do $kill PID For Graceful... (5 Replies)
Discussion started by: mnmonu
5 Replies

8. Shell Programming and Scripting

SIGSTOP and SIGKILL

Which is sent to a terminal when it closes? SIGKILL? Reason I ask is I have a script I want to run in the background, but want it to run even if the terminal window is closed. Or, I'd like it to background itself if the terminal is closed but not if its running in an open window. I will learn how... (5 Replies)
Discussion started by: DC Slick
5 Replies

9. UNIX for Advanced & Expert Users

Print message while using sqlplus

I want to connect to oracle database from solaris... After that i will drop and create a no.of tables.One of the table example is as below. sqlplus -s usrname/password@dbname << SQL >> $logfile 2>&1 echo " dropping the table1" | tee logfile DROP TABLE Table1 echo "creating the table1" |... (1 Reply)
Discussion started by: millan
1 Replies

10. Shell Programming and Scripting

Script to check the string in a file and print an attribute in the message

Hi, I am new to shell scripting and got a task to complete. Task is : we have a log file where in i need to traverse through the whole file to check the string "Person Type missing in message" and after that i need to get EMPLID=xxxxxx from the file and print details in a different file. ... (1 Reply)
Discussion started by: suren424
1 Replies
XtManageChildren(3X)						   XT FUNCTIONS 					      XtManageChildren(3X)

NAME
XtManageChildren - manage children SYNTAX
void XtManageChildren(children, num_children) WidgetList children; Cardinal num_children; ARGUMENTS
children Specifies a list of child widgets. num_children Specifies the number of children. DESCRIPTION
The XtManageChildren function performs the following: o Issues an error if the children do not all have the same parent or if the parent is not a subclass of compositeWidgetClass. o Returns immediately if the common parent is being destroyed; otherwise, for each unique child on the list, XtManageChildren ignores the child if it already is managed or is being destroyed and marks it if not. o If the parent is realized and after all children have been marked, it makes some of the newly managed children viewable: - Calls the change_managed routine of the widgets' parent. - Calls XtRealizeWidget on each previously unmanaged child that is unrealized. - Maps each previously unmanaged child that has map_when_managed True. Managing children is independent of the ordering of children and independent of creating and deleting children. The layout routine of the parent should consider children whose managed field is True and should ignore all other children. Note that some composite widgets, espe- cially fixed boxes, call XtManageChild from their insert_child procedure. If the parent widget is realized, its change_managed procedure is called to notify it that its set of managed children has changed. The parent can reposition and resize any of its children. It moves each child as needed by calling XtMoveWidget, which first updates the x and y fields and then calls XMoveWindow if the widget is realized. SEE ALSO
XtManageChild(3X), XtUnmanageChildren(3X), XtUnmanageChild(3X), XtChangeManagedSet(3X), XtIsManaged(3X) X Version 11 Release 6 XtManageChildren(3X)
All times are GMT -4. The time now is 11:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy