CVSROOT: /cvs Module name: src Changes by: piro...@cvs.openbsd.org 2018/04/24 10:28:42
Modified files: lib/libc/thread: rthread_sync.c lib/librthread : rthread_rwlock.c rthread_sem.c sys/kern : kern_synch.c lib/libc/sys : __thrsleep.2 lib/libpthread/man: sem_wait.3 Log message: Validate timespec and return ECANCELED when interrupted with SA_RESTART. Discussing with mpi@ and guenther@, we decided to first fix the existing semaphore implementation with regards to SA_RESTART and POSIX compliant returns in the case where we deal with restartable signals. Currently we return EINTR everywhere which is mostly incorrect as the user can not know if she needs to recall the syscall or not. Return ECANCELED to signal that SA_RESTART was set and EINTR otherwise. Regression tests pass and so does the posixsuite. Timespec validation bits are needed to pass the later. OK mpi@, guenther@