开发者

Which functions are interrupted by signals even with SA_RESTART?

开发者 https://www.devze.com 2023-02-19 00:19 出处:网络
Is there any reasonably complete list of which functions in POSIX are interrupted with EINTR when a signal is received or handled, even if there is no signal handler or if the handler was installed wi

Is there any reasonably complete list of which functions in POSIX are interrupted with EINTR when a signal is received or handled, even if there is no signal handler or if the handler was installed with SA_RESTART? Some examples:开发者_Go百科

  • select
  • nanosleep
  • etc.


tcsetattr is also not restartable, at least in Linux 2.6.18


POSIX says:

If the signal-catching function executes a return statement, the behavior of the interrupted function shall be as described individually for that function, except as noted for unsafe functions.

So, either you look through all functions individually or filter your man pages for EINTR and POSIX. I did the latter and got:

accept, aio_suspend, catclose, catgets, chmod, chown, clock_nanosleep, close, closedir, connect, dup, errno, exec, fallocate, fchdir, fchmod, fchown, fclose, fcntl, fflush, fgetc, fgetwc, fopen, fork, fputc, fputwc, freopen, fseek, fsetpos, fsync, ftruncate, getgrent, getgrgid, getgrnam, getmsg, getpwent, getpwnam, getpwuid, ioctl, lchown, lio_listio, lockf, mq_open, mq_receive, mq_send, msgop, msgrcv, msgsnd, nanosleep, open, pause, pclose, poll, posix_fallocate, posix_mem_offset, posix_trace_create, posix_trace_get_filter, posix_trace_getnext_event, posix_trace_open, posix_trace_start, posix_typed_mem_get_info, posix_typed_mem_open, printf, pthread_atfork, pthread_attr_getdetachstate, pthread_attr_getguardsize, pthread_attr_getinheritsched, pthread_attr_getschedparam, pthread_attr_getschedpolicy, pthread_attr_getscope, pthread_attr_getstack, pthread_attr_getstackaddr, pthread_attr_getstacksize, pthread_attr_init, pthread_barrier_init, pthread_barrier_wait, pthread_barrierattr_getpshared, pthread_barrierattr_init, pthread_cancel, pthread_cleanup_push, pthread_cond_init, pthread_cond_signal, pthread_cond_wait, pthread_condattr_getclock, pthread_condattr_getpshared, pthread_condattr_init, pthread_create, pthread_detach, pthread_equal, pthread_getconcurrency, pthread_getschedparam, pthread_getspecific, pthread_join, pthread_key_create, pthread_key_delete, pthread_kill, pthread_mutex_getprioceiling, pthread_mutex_init, pthread_mutex_lock, pthread_mutex_timedlock, pthread_mutexattr_getprioceiling, pthread_mutexattr_getprotocol, pthread_mutexattr_getpshared, pthread_mutexattr_gettype, pthread_mutexattr_init, pthread_once, pthread_rwlock_init, pthread_rwlock_rdlock, pthread_rwlock_timedrdlock, pthread_rwlock_timedwrlock, pthread_rwlock_unlock, pthread_rwlock_wrlock, pthread_rwlockattr_getpshared, pthread_rwlockattr_init, pthread_self, pthread_setschedprio, pthread_spin_init, pthread_spin_lock, pthread_spin_unlock, pthread_testcancel, putmsg, read, recv, recvfrom, recvmsg, scanf, select, select_tut, sem_open, sem_timedwait, sem_wait, semop, send, sendmsg, sendto, shm_open, sigaction, siginterrupt, sigpause, sigprocmask, sigset, sigsuspend, sigvec, sigwaitinfo, statfs, statvfs, system, tcdrain, tcsetattr, tmpfile, truncate, ualarm, usleep, wait, waitid and write


If anyone wonders, the manpage for signal(7) has more detail on what is and what isn't restarted:

0

精彩评论

暂无评论...
验证码 换一张
取 消