Skip to contentSkip to conversation

BUG (non-kernel), can hurt developers.

DISCUSSION [email protected] 2 participants 2 messages Nov 28, 2003

lore
Share & tools
lore
#0 lore raw
Quoted 2 lines

I believe it would be very useful to have this information included in the standard Linux signal(2) manpage.

OK. You might have included a patch. I made it say

The effects of this call in a multi-threaded process are unspecified.

The routine handler must be very careful, since processing elsewhere was interrupted at some arbitrary point. POSIX has the concept of "safe function". If a signal inter� rupts an unsafe function, and handler calls an unsafe function, then the behavior is undefined. Safe functions are listed explicitly in the various standards. The POSIX 1003.1-2003 list is

_Exit() _exit() abort() accept() access() aio_error() aio_return() aio_suspend() alarm() bind() cfgetispeed() cfgetospeed() cfsetispeed() cfsetospeed() chdir() chmod() chown() clock_gettime() close() connect() creat() dup() dup2() execle() execve() fchmod() fchown() fcntl() fdata� sync() fork() fpathconf() fstat() fsync() ftruncate() getegid() geteuid() getgid() getgroups() getpeername() getpgrp() getpid() getppid() getsockname() getsockopt() getuid() kill() link() listen() lseek() lstat() mkdir()
mkfifo() open() pathconf() pause() pipe() poll()
posix_trace_event() pselect() raise() read() readlink() recv() recvfrom() recvmsg() rename() rmdir() select() sem_post() send() sendmsg() sendto() setgid() setpgid()
setsid() setsockopt() setuid() shutdown() sigaction()
sigaddset() sigdelset() sigemptyset() sigfillset() sigis� member() sleep() signal() sigpause() sigpending() sigproc� mask() sigqueue() sigset() sigsuspend() socket() socket�
pair() stat() symlink() sysconf() tcdrain() tcflow()
tcflush() tcgetattr() tcgetpgrp() tcsendbreak() tcse�
tattr() tcsetpgrp() time() timer_getoverrun() timer_get� time() timer_settime() times() umask() uname() unlink() utime() wait() waitpid() write().

Andries

#1 lore raw
Quoted 7 lines · [email protected] wrote:

The routine handler must be very careful, since processing elsewhere was interrupted at some arbitrary point. POSIX has the concept of "safe function". If a signal inter­ rupts an unsafe function, and handler calls an unsafe function, then the behavior is undefined. Safe functions are listed explicitly in the various standards. The POSIX 1003.1-2003 list is

<snip>

You may also want to mention the SUS async-safe list as well, since there are some additional functions there.

Chris

Signature · 4 lines
Chris Friesen                    | MailStop: 043/33/F10
Nortel Networks                  | work: (613) 765-0557
3500 Carling Avenue              | fax:  (613) 765-2986
Nepean, ON K2H 8E9 Canada        | email: [email protected]