[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]
Re: [Re: signals ??]
Oh ! thanx for correcting me .. got the point .. i was just wondering that yes
global variables would have 2 copies but cannot the problem be solved by using
static global variables .
and yea i was facing a strange problem that my programm (simple UDP
sockets)was opening ports well (netstat -a)and even when sendto () calls were
returning >0 , the datagrams were not being recvd at other end of LAN ..any
idea for what i might be bungling up ? and yea you were correct about printf
in signals .. but isn't it asking for too much when it doesn't prints for if u
don't print /n at end .
thanx a lot again :)
"Prateek Gera" <prateekg@xxxxxxxxxxxxxxx> wrote:
1. The signal that you intend to send (SIGUSR1) to the child is not
lost but ignored because the fork has not occured yet and there is no child
process and the main process ignores it because of SIG_IGN. After you
create a child process , nowhere do you send a signal(SIGUSR1) to the
child. The value "int_occured2" is never incremented and your child process
enters an infinite loop printing "nahi main nahin maanonga" infinitely.
2. The printf inside the "handler" fn will be printed if you use the
newline correctly ie., \n .
3. There are some other mistakes also in your program, I've rectified your
code , please see the attached file.
(See attached file: signals.c)
Get free email and a permanent address at http://www.netaddress.com/?N=1