Sponsored Content
Top Forums Programming add more user-defined signals Post 302438624 by JohnGraham on Tuesday 20th of July 2010 08:15:55 AM
Old 07-20-2010
Quote:
Originally Posted by naamabm
1) In case I "take over" SIGHUP signal, can I use the "kill" function in order to raise it?
kill(pid, SIGHUP);
and the signal function in order to catch it on the other side?
signal(SIGHUP, sig_handler)
Yes - there is no real difference between SIGUSR1/SIGUSR2 and SIGHUP - you can kill() them in exactly the same way, and you set up the signal handler with signal() in the same way.


Quote:
Originally Posted by naamabm
2) Just to make sure I understand the second you were talking about (IPC messages / named pipe) it requires both processes to "pull" from the shared memory the details and don't have something to wake the process (or in other words- it doesn't signal the process) right?
If so, that doesn't help me...
I'm not sure about what you mean by "pull" from shared memory - there's certainly no requirement to actually use any shared memory. Both processes will need to know the name of the pipe. While it doesn't technically speaking "signal" the process, you can make a blocking read() from the pipe, and you're blocked until someone writes to it/there's an error, so your program will sit dormant until there's something to do.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Nawk user-defined function

HELP!!!! I am in an on-line shell programming class and have a question. Here is the data: Mike Harrington:(510) 548-1278:250:100:175 Christian Dobbins:(408) 538-2358:155:90:201 Susan Dalsass:(206) 654-6279:250:60:50 (There are 12 contribuors total) This database contains names, phone... (1 Reply)
Discussion started by: NewbieGirl
1 Replies

2. AIX

User defined signal 1

Hi, I am just running a incremental back-up on one of my server. But these days It abrubtly fails with below error. ========== User defined signal 1 =========== When I rerun the back-up, It completed successfully.Earlier this was not happening. Any Idea, what could be the problem... (0 Replies)
Discussion started by: nitesh_raj
0 Replies

3. UNIX for Dummies Questions & Answers

User defined service

I want to add a new IP service which executes a script on SCO OS5. I have amended /etc/services and added to port number (3333) I have amended /etc/inetd.conf and added a line for this service but I can't get it to execute my own shell script When I telnet to the IP address on port 3333 I... (1 Reply)
Discussion started by: markdrury
1 Replies

4. Shell Programming and Scripting

need help with User Defined Function

Dear Friends, I need a help regarding User defined function in shell script. My problem is as follows: my_func.sh my_funcI(){ grep 'mystring' I.dat } my_funcQ(){ grep 'mystring' Q.dat } myfuncI myfuncQ But As both the function has same function only the... (11 Replies)
Discussion started by: user_prady
11 Replies

5. Solaris

Wants to use User defined Macro in Makefile

I am converting 32-bit C++ code to 64-bit on Solaris. I have used unsigned long in number of files. I want it to convert to unsigned int for 64-bit. Total files are around 2000. Can you please help me if possible to do it in makefile using MACRO while build. If it is not possible any other... (2 Replies)
Discussion started by: amit_27
2 Replies

6. Shell Programming and Scripting

Unable to add user defined variable

Hi, I have a user defined variable _TIME1=xxx I am using awk command for pattern matching. cat $_LOCATION/catalina.txt | awk '/^`$_TIME1`:??:??/' It not taking the value of $_TIME! eg:I am using the command to get all the patter from 12:00:00 to 12:59:59 The user defined variable... (2 Replies)
Discussion started by: ahamed
2 Replies

7. Programming

how to add user defined tag in a mp3 file?

Hai all, Can anyone explain me about how to add an user defined tag in an mp3 file using MP3::Tag module in perl? (0 Replies)
Discussion started by: thillai_selvan
0 Replies

8. Shell Programming and Scripting

User defined functions in awk

Hi; Is der ne to to use user defined functions for the values in awk find $1 -type f -ls | nawk '{{print "|"$3"|"$5"|"$6"|"$8"|"$9"|"$10"|"} for(i=11;i<=NF;i++){printf("%s",$i)}}' In above command i want to append some values returned by user functions on line. thnks; ajay (1 Reply)
Discussion started by: ajaypadvi
1 Replies

9. UNIX for Dummies Questions & Answers

user defined commands

Hi, i would like to create user defined commands. e,g: if an user executes , mkdircd test then a directory called test should be created and it should be cd to test. How i can create the command mkdircd with below action: mkdir $1 && cd $1. Please help me in achieving this (7 Replies)
Discussion started by: pandeesh
7 Replies
ddi_can_receive_sig(9F) 				   Kernel Functions for Drivers 				   ddi_can_receive_sig(9F)

NAME
ddi_can_receive_sig - Test for ability to receive signals SYNOPSIS
#include <sys/ddi.h> #include <sys/sunddi.h> boolean_t ddi_can_receive_sig(void); INTERFACE LEVEL
Solaris DDI specific (Solaris DDI). PARAMETERS
None. DESCRIPTION
The ddi_can_receive_sig() function returns a boolean value indicating whether the current thread can receive signals sent by kill(2). If the return value is B_FALSE, then the calling thread cannot receive signals, and any call to qwait_sig(9F), cv_wait_sig(9F), or cv_timedwait_sig(9F) implicitly becomes qwait(9F), cv_wait(9F), or cv_timedwait(9F), respectively. Drivers that can block indefinitely awaiting an event should use this function to determine if additional means (such as timeout(9F)) may be necessary to avoid creating unkil- lable threads. RETURN VALUES
B_FALSE The calling thread is in a state in which signals cannot be received. For example, the thread is not associated with a user process or is in the midst of exit(2) handling. B_TRUE The calling thread may receive a signal while blocked on a condition variable. Note that this function does not check to determine whether signals are blocked (see sigprocmask(2)). CONTEXT
The ddi_can_receive_sig() function may be called from user, kernel, or interrupt context. SEE ALSO
close(9E), cv_wait(9F), qwait(9F) SunOS 5.10 15 Dec 2003 ddi_can_receive_sig(9F)
All times are GMT -4. The time now is 11:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy