For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > November 2004 > atexit doubt









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author atexit doubt
Kelvin Moss

2004-11-30, 3:58 am

Hi all,

I have an application where I read input through telnet. Something like
-

telnet localhost 10999
a
b
c

I have registered a cleanup function with atexit. It gets invoked when
I press ctrl]q. I looked at strace to find which system call invokes
atexit. I don't see exit being called...is it shutdown that invokes
exit or something else ?

write(1, "telnet> ", 8telnet> ) = 8
read(0, q
"q\n", 1024) = 2
shutdown(3, 2 /* send and receive */) = 0
write(1, "Connection closed.\r\n", 20Connection closed.
) = 20
close(3) = 0
rt_sigaction(SIGTSTP, {0x804f290, [TSTP], SA_RESTART|0x4000000},
{SIG_DFL}, 8) = 0
ioctl(0, SNDCTL_TMR_STOP, {B38400 opost isig icanon echo ...}) = 0
ioctl(0, 0x5421, [1]) = 0
ioctl(1, 0x5421, [1]) = 0
select(2, NULL, [1], NULL, NULL) = 1 (out [1])
rt_sigaction(SIGTSTP, {SIG_DFL}, {0x804f290, [TSTP],
SA_RESTART|0x4000000}, 8) = 0
rt_sigprocmask(SIG_BLOCK, [], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], [], 8) = 0
ioctl(0, SNDCTL_TMR_STOP, {B38400 opost isig icanon echo ...}) = 0
ioctl(0, 0x5421, [0]) = 0
ioctl(1, 0x5421, [0]) = 0
rt_sigaction(SIGTSTP, {0x804f290, [TSTP], SA_RESTART|0x4000000},
{SIG_DFL}, 8) = 0
ioctl(0, SNDCTL_TMR_STOP, {B38400 opost isig icanon echo ...}) = 0
ioctl(0, 0x5421, [1]) = 0
ioctl(1, 0x5421, [1]) = 0
select(2, NULL, [1], NULL, NULL) = 1 (out [1])
rt_sigaction(SIGTSTP, {SIG_DFL}, {0x804f290, [TSTP],
SA_RESTART|0x4000000}, 8) = 0
rt_sigprocmask(SIG_BLOCK, [], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], [], 8) = 0
ioctl(0, SNDCTL_TMR_STOP, {B38400 opost isig icanon echo ...}) = 0
ioctl(0, 0x5421, [0]) = 0
ioctl(1, 0x5421, [0]) = 0
munmap(0x40014000, 4096) = 0
_exit(0)


Thanks.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com