当接收或处理信号时,是否有任何合理完整的POSIX中哪些函数被EINTR
中断的列表,即使没有信号处理程序或者处理程序是否安装了SA_RESTART
?一些例子:
select
nanosleep
答案 0 :(得分:2)
tcsetattr也无法重启,至少在Linux 2.6.18
中答案 1 :(得分:1)
POSIX说:
如果信号捕获函数执行一个return语句,则中断函数的行为应该单独为该函数描述,除非注意到不安全函数。
因此,要么单独查看所有函数,要么过滤EINTR和POSIX的手册页。我做了后者并得到了:
接受, aio_suspend, catclose, catgets, 输入chmod, CHOWN, clock_nanosleep, 关, closedir, 连接, DUP, 错误号, EXEC, fallocate, fchdir, fchmod, fchown, FCLOSE, 的fcntl, fflush, 龟etc, fgetwc, FOPEN, 叉子, 的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, 打开, 暂停, pclose函数, 轮询, 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, 读, recv的, recvfrom的, recvmsg, scanf函数, 选择, select_tut, sem_open, sem_timedwait, sem_wait, 执行semop, 发送, SENDMSG, 发送至, 的shm_open, sigaction的, siginterrupt, 了sigpause, sigprocmask, sigset, sigsuspend, 了sigvec, sigwaitinfo, 的statfs, statvfs, 系统, tcdrain, tcsetattr, TMPFILE, 截短, ualarm, usleep, 等待, 等待和 写
答案 2 :(得分:1)
如果有人想知道,manpage for signal(7)
会更详细地说明什么是重新启动以及哪些没有重新启动: