Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!pyrltd!root44!gwc From: gwc@root.co.uk (Geoff Clare) Newsgroups: comp.unix.programmer Subject: Re: List of routines safe to use in signals? Message-ID: <2566@root44.co.uk> Date: 17 Dec 90 16:22:58 GMT References: Organization: UniSoft Ltd., London, England Lines: 34 In rang@cs.wisc.edu (Anton Rang) writes: > Is there a list of library routines which can safely be used within >a signal handler under any of the "standard" UNIX versions (preferably >POSIX, but I'd like BSD 4.3 and SVR4 info as well)? Presumably this >is in the POSIX standard, but if anybody has an online copy of such a >list, I'd appreciate it. I've seen a lot of replies to this question saying effectively that the only safe thing you can do in a signal handler is set a flag of type sig_atomic_t. That may be what the 'C' standard, says but this is comp.unix.programmer, not comp.lang.c! And Anton specifically asked about POSIX in his question! There is a long list of interfaces that POSIX guarantees are safe to use in signal handlers. I've been waiting to see if anyone else posts the list, but nobody has, so I'll do it. I don't have the text of POSIX.1 on line, but I do have the latest draft of POSIX.3, and the list should be the same (I haven't checked it). Here it is: _exit, access, alarm, cfgetispeed, cfgetospeed, cfsetispeed, cfsetospeed, chdir, chmod, chown, close, creat, dup, dup2, execle, execve, fcntl, fork, fstat, getegid, geteuid, getgid, getgroups, getpgrp, getpid, getppid, getuid, kill, kill, link, lseek, mkdir, mkfifo, open, pathconf, pause, pipe, read, rename, rmdir, setgid, setpgid, setsid, setuid, sigaction, sigaddset, sigdelset, sigemptyset, sigfillset, sigpending, sigprocmask, sigprocmask, sigsimember, sigsuspend, sleep, stat, sysconf, tcflow, tcflush, tcgetattr, tcgetpgrp, tcsendbreak, tcsetattr, tcsetpgrp, time, times, umask, uname, unlink, ustat, utime wait, waitpid, and write. -- Geoff Clare (Dumb American mailers: ...!uunet!root.co.uk!gwc) UniSoft Limited, Hayne Street, London EC1A 9HH, England. Tel: +44-71-315-6600