Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

sysv_signal(3) [linux man page]

SYSV_SIGNAL(3)						     Linux Programmer's Manual						    SYSV_SIGNAL(3)

NAME
sysv_signal - signal handling with System V semantics SYNOPSIS
#define _GNU_SOURCE #include <signal.h> typedef void (*sighandler_t)(int); sighandler_t sysv_signal(int signum, sighandler_t handler); DESCRIPTION
The sysv_signal() function takes the same arguments, and performs the same task, as signal(2). However sysv_signal() provides the System V unreliable signal semantics, that is: a) the disposition of the signal is reset to the default when the handler is invoked; b) delivery of further instances of the signal is not blocked while the signal handler is executing; and c) if the handler interrupts (certain) blocking system calls, then the system call is not automatically restarted. RETURN VALUE
The sysv_signal() function returns the previous value of the signal handler, or SIG_ERR on error. ERRORS
As for signal(2). CONFORMING TO
This function is nonstandard. NOTES
Use of sysv_signal() should be avoided; use sigaction(2) instead. On older Linux systems, sysv_signal() and signal(2) were equivalent. But on newer systems, signal(2) provides reliable signal semantics; see signal(2) for details. The use of sighandler_t is a GNU extension; this type is only defined if the _GNU_SOURCE feature test macro is defined. SEE ALSO
sigaction(2), signal(2), bsd_signal(3), feature_test_macros(7), signal(7) COLOPHON
This page is part of release 3.27 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. 2007-05-04 SYSV_SIGNAL(3)

Check Out this Related Man Page

BSD_SIGNAL(3)						     Linux Programmer's Manual						     BSD_SIGNAL(3)

NAME
bsd_signal - signal handling with BSD semantics SYNOPSIS
#define _XOPEN_SOURCE /* See feature_test_macros(7) */ #include <signal.h> typedef void (*sighandler_t)(int); sighandler_t bsd_signal(int signum, sighandler_t handler); DESCRIPTION
The bsd_signal() function takes the same arguments, and performs the same task, as signal(2). The difference between the two is that bsd_signal() is guaranteed to provide reliable signal semantics, that is: a) the disposition of the signal is not reset to the default when the handler is invoked; b) delivery of further instances of the signal is blocked while the signal handler is executing; and c) if the handler interrupts a blocking system call, then the system call is automatically restarted. A portable application cannot rely on signal(2) to provide these guarantees. RETURN VALUE
The bsd_signal() function returns the previous value of the signal handler, or SIG_ERR on error. ERRORS
As for signal(2). CONFORMING TO
4.2BSD, POSIX.1-2001. POSIX.1-2008 removes the specification of bsd_signal(), recommending the use of sigaction(2) instead. NOTES
Use of bsd_signal() should be avoided; use sigaction(2) instead. On modern Linux systems, bsd_signal() and signal(2) are equivalent. But on older systems, signal(2) provided unreliable signal semantics; see signal(2) for details. The use of sighandler_t is a GNU extension; this type is only defined if the _GNU_SOURCE feature test macro is defined. SEE ALSO
sigaction(2), signal(2), sysv_signal(3), signal(7) COLOPHON
This page is part of release 3.44 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. 2009-03-15 BSD_SIGNAL(3)
Man Page

11 More Discussions You Might Find Interesting

1. Programming

Multiple Signals

I want to catch multiple instances of same signals serially ie the signal handler should be invoked recursively for multiple instances of the same signal.How it is possible ? (12 Replies)
Discussion started by: S.P.Prasad
12 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. Programming

Catching signal and piping

Hi, Recently I was reading some c coding by some colleagues and I noticed that the above trend. They will create a pipe for the process then they will use the standard signal handler to capture a particular signal and write that signal to the pipe. On the other end, the process will read the... (7 Replies)
Discussion started by: joseph_ng
7 Replies

4. Programming

signal handler problems

Hey guys, I am trying to write a little shell, and was writing a signal handler to handle SIGINT (I am using 'stty intr ^C' and using ctrl-C to give SIGINT). I wrote this signal handler: void handle_sigint() { write(2,"handling sigint\n",16); write(1,"\nshell% ",8); } ... (4 Replies)
Discussion started by: blowtorch
4 Replies

5. Programming

why printf() function don't go work?

I use FreeBSD,and use signal,like follows: signal(SIGHUP,sig_hup); signal(SIGIO,sig_io); when I run call following code,it can run,but I find a puzzled question,it should print some information,such as printf("execute main()") will print execute main(),but in fact,printf fuction print... (2 Replies)
Discussion started by: konvalo
2 Replies

6. Linux

does sending a signal cause task switching

Hi all, i am porting a system, that used to manipulate memory across processes using an interrupt handler - which means that upon return from the interrupt handler the memory change would be finished. I am trying to simulate this using signals on Linux 2.6.2x. What i would like to know is... (1 Reply)
Discussion started by: pfarre
1 Replies

7. Programming

how to discard instruction from previous signal

hello everyone, I'm having a problem doing signal handling so I post this thread to see if I could get help. I want asynchronous signal handling, that means when I'm processing a signal (signal 1), if the same signal comes (signal 2) that signal (signal 2) shall be processed; and moreover,... (7 Replies)
Discussion started by: nvhoang
7 Replies

8. Programming

Signal Handler Hangs

Hi, I have a problem with signal handler algorithm in linux. My code is hanging ( It is continuously looping inside the signal handler) . I am pasting my code here... Please provide me some help regarding this. I googled many places and wrote this code.. but doesnt seem to be working without... (6 Replies)
Discussion started by: sree_ec
6 Replies

9. Programming

problem in doing coding of signal handler

i m unble to execute code of signal handler using a) Wait b) Waitpid (1 Reply)
Discussion started by: madhura
1 Replies

10. Programming

Query on signal delay

Hi I have used setitmer function in C to notify the occurence of an event . setitimer function generates a SIGLALRM signal which I handled through a defined handler using signal system call. There are multiple processes running and using this handler to handler the SIGALRM . The handler is... (1 Reply)
Discussion started by: anktim
1 Replies

11. Programming

Serial port signal(IRQ) handler (using C)

Hello, I'm writing some serial(UART) handler but have stuck on few issues, maybe anyone can help to show me what I'm doing wrong. Basically I'm intending to write serial RX signal handler. Application receives defined packages of data over serial which contains header and payload. Handler... (3 Replies)
Discussion started by: Lauris_k
3 Replies