Sponsored Content
Full Discussion: problem with signal()
Top Forums Programming problem with signal() Post 302145736 by porter on Thursday 15th of November 2007 04:40:45 AM
Old 11-15-2007
put this in suicide

Code:
void suicide(int num)
{
    write(1,"suicide\n",8);
}

or put a \n in your printf, or use fflush(stdout);
 

10 More Discussions You Might Find Interesting

1. Programming

[Problem] raise a signal in FreeBSD

I am trying to send a SIGUSR1 to a set of process. Please tell me how to do. I've tried the system call raise(int sig) but it just raise a signal of to the 'current process.' My program is about a network chat server. When a client connects in, The main process will fork a new process... (1 Reply)
Discussion started by: Namely
1 Replies

2. UNIX for Advanced & Expert Users

I have a problem using signal SIGUSR2

hi I have created a application which uses SIGUSR2. It send this signal to server and waits for signal SIGUSR2 from server after server performing some operation server sends SIGUSR2 back to the application. The application then quits. This works fine which ran from terminal , but when I... (3 Replies)
Discussion started by: khan_069
3 Replies

3. Programming

Signal Problem

I am using the signal function, and passing it a function named quit procedure...I get the following warning.... passing arg2 of signal from incompatible pointer type... void quit_procedure(void); //this is the way i define my prototype... signal(SIGINT, quit_procedure); Please guide... (5 Replies)
Discussion started by: jacques83
5 Replies

4. Programming

problem in SIGSEGV signal handling

i wrote handler for sigsegv such that i can allocate memory for a variable to which sigsegv generated for illlegal acces of memory. my code is #include <signal.h> #include<stdio.h> #include<stdlib.h> #include<string.h> char *j; void segv_handler(int dummy) { j=(char *)malloc(10); ... (4 Replies)
Discussion started by: pavan6754
4 Replies

5. Programming

problem in reforking and signal handling

hi friends i have a problem in signal handling ... let me explain my problem clearly.. i have four process .. main process forks two child process and each child process again forks another new process respectively... the problem is whenever i kill the child process it is reforking and the... (2 Replies)
Discussion started by: senvenugopal
2 Replies

6. Shell Programming and Scripting

Tricky little problem, send signal to other machine without user

Hi everyone! I want to be able to send a signal to another machine on the same network, and have it trigger a script on that machine. Here's the reason why I can't just ssh: I don't have a username on that machine, but there is a user that is always logged on that I can do stuff on. So, I want... (5 Replies)
Discussion started by: declannalced
5 Replies

7. Programming

UNIX signal problem

Hi all, Sorry about the title,at first i decided to ask a problem about the signal mechanism,however,i'm now figured it out.Sorry to forget modify the title:wall:.I had a small problem that if i use the code which is commented,the code would get a segment fault,while the above code NOT.what's... (4 Replies)
Discussion started by: homeboy
4 Replies

8. 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

9. Programming

Losing signal problem

I'm newbie in UNIX programming, I have a problem with signals. I'm writing multithread program, where threads can die at any moment. When thread dies it generates signal SIGUSR1 to main thread and then thread dies. Main thread gets a signal and waits for thread dead. I wrote program like this: ... (5 Replies)
Discussion started by: DendyGamer
5 Replies

10. Linux

Problem with dovecot (Killed with signal 15)

hey, i have been facing a very fatel error with dovecot.. i am getting this error in my dovecot.log file dovecot: Feb 13 15:21:02 Fatal: chdir(/var/mail/folders/user1) failed with uid 1001: Permission denied dovecot: Feb 13 15:21:02 Error: child 18732 (imap) returned error 89 dovecot: Feb... (3 Replies)
Discussion started by: htshshrm2
3 Replies
ssignal(3)						     Library Functions Manual							ssignal(3)

NAME
ssignal, ssignal_r, gsignal, gsignal_r - Set and raise a software signal LIBRARY
Standard C Library (libc.a) SYNOPSIS
#include <signal.h> void *ssignal( int signal, void (*function)(int))) (int); int gsignal( int signal); The following functions are supported to maintain backward compatibility with previous versions of the operating system. void *ssignal_r( int signal, void (*function) (int), void (*sigs[])(int))) (int); int gsignal_r( int signal, void (*sigs[])(int)); PARAMETERS
Defines the signal. Specifies the action associated with the signal. Specifies the array of signal functions. This structure must have at least 21 entries, each of which must be initialized to 0 (zero) by the caller. DESCRIPTION
These functions are obsolete and are retained for compatibility with earlier versions of the operating system. The ssignal() and gsignal() functions implement a facility similar to that of the signal() function and the kill() system call. However, there is no connection between the two facilities. User programs can use the ssignal() and gsignal() functions to handle exception pro- cessing within an application. signal() and related functions handle system-defined exceptions. The signals available are associated with integers in the range 1 to 15. Other values are reserved for use by the C library and should not be used. The ssignal() function associates the procedure specified by the function parameter with the signal specified by the signal parameter. The gsignal() function raises the signal, causing the procedure specified by the function parameter to be taken. The function parameter is either a pointer to a user-defined function, or either of the constants SIG_DFL (default action) or SIG_IGN (ignore signal). The ssignal() function returns the procedure that was previously established for that signal. If no procedure was estab- lished before or if the signal number is illegal, then ssignal() returns the value SIG_DFL. The gsignal() function raises the signal specified by the signal parameter by performing the following: If the procedure for signal is SIG_DFL, the gsignal() function returns a value of 0 (zero) and takes no other action. If the procedure for signal is SIG_IGN, the gsig- nal() function returns a value of 1 and takes no other action. If the procedure for signal is a function, the function value is reset to SIG_DFL and the function is called with signal passed as its parameter. The gsignal() function returns the value returned by the calling function with a single integer argument, which is the value of signal. If the procedure for signal is illegal or if no procedure is speci- fied for that signal, gsignal() returns a value of 0 (zero) and takes no other action. NOTES
The ssignal_r() and gsignal_r() functions are the reentrant versions of the ssignal() and gsignal() functions. They are supported in order to maintain backward compatibility with previous versions of the operating system. Upon successful completion, the ssignal_r() and gsig- nal_r() functions place pointers in or retrieve pointers from the signal structure in sigs. RETURN VALUES
The ssignal() and ssignal_r() functions return the value of the previously installed function if there was one, or SIG_DFL if there was not a previously installed function. If the value of signal was illegal the ssignal() and ssignal_r() functions return SIG_DFL. The gsignal() and gsignal_r() functions return a value of 0 (zero) if the procedure for signal is illegal, or if SIG_DFL is the action for signal. The gsignal() and gsignal_r() functions return a value of 1 if the procedure for signal is SIG_IGN. If none of these are true, then the gsignal() and gsignal_r() functions return the value returned by the calling function. RELATED INFORMATION
Functions: kill(2), signal(2). delim off ssignal(3)
All times are GMT -4. The time now is 10:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy