From 5e9723e2718654b214e69e56174b3c1dfa0b6e69 Mon Sep 17 00:00:00 2001 From: Benjamin Kaduk Date: Sat, 5 Jan 2013 00:23:26 +0000 Subject: [PATCH] Fix some minor inaccuracies introduced in r243251. Also correct the comment in kern_synch.c which was the source of the problematic text. Reviewed by: kib (previous version) Approved by: hrs (mentor) --- share/man/man9/sleep.9 | 12 ++++++------ sys/kern/kern_synch.c | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/share/man/man9/sleep.9 b/share/man/man9/sleep.9 index 665aa1e7fecf..e65a189fd2c0 100644 --- a/share/man/man9/sleep.9 +++ b/share/man/man9/sleep.9 @@ -102,12 +102,11 @@ If .Fa priority includes the .Dv PCATCH -flag, pending -signals are checked before and after sleeping, otherwise signals are -not checked. +flag, pending signals are allowed to interrupt the sleep, otherwise +pending signals are ignored during the sleep. If .Dv PCATCH -is set and a signal needs to be delivered, +is set and a signal becomes pending, .Er ERESTART is returned if the current system call should be restarted if possible, and @@ -119,9 +118,10 @@ If the .Dv PBDRY flag is specified in addition to .Dv PCATCH , -then the sleeping thread is not stopped upon delivery of +then the sleeping thread is not stopped when .Dv SIGSTOP -or other stop action while it is sleeping. +becomes pending +or some other stop action occurs while it is sleeping. Instead, it is woken up, with the assumption that the stop will occur on reaching a stop point when returning to usermode. diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index e2e4081bf895..73dfd70ebfeb 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -133,10 +133,10 @@ sleepinit(void) * General sleep call. Suspends the current thread until a wakeup is * performed on the specified identifier. The thread will then be made * runnable with the specified priority. Sleeps at most timo/hz seconds - * (0 means no timeout). If pri includes PCATCH flag, signals are checked - * before and after sleeping, else signals are not checked. Returns 0 if + * (0 means no timeout). If pri includes the PCATCH flag, let signals + * interrupt the sleep, otherwise ignore them while sleeping. Returns 0 if * awakened, EWOULDBLOCK if the timeout expires. If PCATCH is set and a - * signal needs to be delivered, ERESTART is returned if the current system + * signal becomes pending, ERESTART is returned if the current system * call should be restarted if possible, and EINTR is returned if the system * call should be interrupted by the signal (return EINTR). *