signal in process communication


 
Thread Tools Search this Thread
Top Forums Programming signal in process communication
# 1  
Old 06-22-2002
signal in process communication

signal in process communication:

I 'm a example in sun_unix that signal in process communication

It's here down but I only have freebsd in my machine.
how can i do the same in freebsd

eg:
#include <stdio.h>
#include <signal.h>
#include <unistd.h>
int
main( void ){
void sigset_catcher(int);
sighold(SIGUSR1);
sigset(SIGUSR2, sigset_catcher);
printf("Waiting for signal\n");
pause();
prntf("done\n");
exit(0);
}
void
sigset_catche( int n) {
printf("Recerved signal %d\n",n);
sigrelse(SIGUSR1);
printf("SIGUSR1 released!\n");
}

my computer errer is the sighold,sigset and the sigrelse are not exits.Smilie
# 2  
Old 06-22-2002
There are several "families" of signal system calls. This is a very confusing situation. sighold(), sigset(), and sigrelse() all originated on System 5 Release 3. They were also documented in the SVID (System V Interface Definition).

I don't have access to a freeBSD system, but I just reviewed the online docs for freeBSD. It has two signal families available: the Berkeley family, and the Posix family. You are going to need to switch families. And I suggest that you switch to the Posix family. It is especially important that you pick a family. Don't mix system calls from different families in the same program.

I saw FreeBSD man pages for the following Posix signal system calls:
sigaction()
sigsuspend()
sigaltstack() (you will rarely need to use this one)
sigpending()
sigprocmask()

These system calls are probably going to be found more often than the other families. They will work on Suns. If you start using these calls, you will maximize the portability of your code.
# 3  
Old 06-22-2002
thanks.

thanks,i'm trying now
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Application with communication between process

Hello I would like to create an application with communication between processes, application tightly coupled, have you please an idea about an API or a tool that allows me to generate such application? Thank you so much (11 Replies)
Discussion started by: chercheur857
11 Replies

2. Emergency UNIX and Linux Support

signal between parent process and child process

Hello, everyone. Here's a program: pid_t pid = fork(); if (0 == pid) // child process { execvp ...; } I send a signal (such as SIGINT) to the parent process, the child process receive the signal as well as the parent process. However I don't want to child process to receive the... (7 Replies)
Discussion started by: jackliang
7 Replies

3. Programming

C -- signal and background process

Hi all, Does a background process send a signal to its parent when completed? If so, how might i capture this signal? I'm trying to write shell in c so that when a background process finishes, it prints a message to the console. Thanks in advance for any advice. (1 Reply)
Discussion started by: jmelai
1 Replies

4. AIX

process caught signal 5

Hello, We are using AIX 5.2 ML 7. One of the process in its log file said the following and stopped running. Caught signal=5, exiting. What would cause the signal 5 to be generated on an AIX box. Please advise. Thx Jerardfjay (2 Replies)
Discussion started by: jerardfjay
2 Replies

5. Programming

C program using IPC (inter process communication)

i want to write a C chat program that communicates over IPC(inter process communication), that could be run using 2 seperate terminal windows within the same computer. so that wat u type in one terminal window , should appear on the other and vice versa... could some one please help me with the... (2 Replies)
Discussion started by: localp
2 Replies

6. Programming

catching a signal from child process

i am creating children processes using fork system call every child i create goes to sleep for random time. when child stops running how can i catch his signal and turminate the child (2 Replies)
Discussion started by: emil2006
2 Replies

7. UNIX for Advanced & Expert Users

Inter-process communication:pipes,doors,etc.

Hi, I am thinking about writing a log daemon for a multi-processed ksh application (yes - I know that high-level language would be a better option). My question is as follows: If many processes (many scripts) will try writing to a single log file: print "message" > common.log Will it work or... (2 Replies)
Discussion started by: adderek
2 Replies

8. UNIX for Advanced & Expert Users

Getting status of a signal in process?

Hi all, How can a process be aware of the signals it handles. I looked at available signal API, but couldn't find any help. If a process defines it own handler for a signal, the default handler for that signal becomes overridden. I am interested in getting to know the... (2 Replies)
Discussion started by: bluehive
2 Replies

9. Programming

Problem with signals - 3 process communication

Hello, I would like to ask you for a little help with program I'm working on. I have problems with signals and synchronizing processes (I'm quite new to this part of programming). Process "parent" creates new child process "child1" and this process creates new child process "child2". The... (2 Replies)
Discussion started by: Nightwright
2 Replies

10. Programming

Inter Process Communication

unix IPC i would like to know the method of usage of semaphores on shared memory segments the topic seems very difficult to understand mainly when difrent proceses communicate instantly and how do i avaoid deadlock situation (2 Replies)
Discussion started by: kamathanil
2 Replies
Login or Register to Ask a Question