}
int
-OS_pause (bool ignore_status_change)
+OS_pause (bool blockp, bool ignore_status_change)
{
- /* Wait-for-io must spin. */
return
- ((OS_process_any_status_change ())
+ ((!ignore_status_change && (OS_process_any_status_change ()))
? SELECT_PROCESS_STATUS_CHANGE
+ /* Wait-for-io must spin. */
: SELECT_INTERRUPT);
}
(select_registry_t registry, int blockp);
extern int OS_test_select_descriptor
(int fd, int blockp, unsigned int mode);
-extern int OS_pause (bool ignore_status_change);
+extern int OS_pause (bool blockp, bool ignore_status_change);
#endif /* SCM_OSIO_H */
if ((VECTOR_LENGTH (vmode)) < rl)
error_bad_range_arg (4);
result = ((rl == 0)
- ? (blockp ? (OS_pause (0)) : SELECT_INTERRUPT)
+ ? (OS_pause (blockp, 0))
: (OS_test_select_registry (r, blockp)));
if (result > 0)
{
#endif /* not HAVE_POLL */
int
-OS_pause (bool ignore_status_change)
+OS_pause (bool blockp, bool ignore_status_change)
{
-#ifdef HAVE_SIGSUSPEND
- sigset_t old, new;
int n;
- UX_sigfillset (&new);
- UX_sigprocmask (SIG_SETMASK, &new, &old);
- if (!ignore_status_change && OS_process_any_status_change ())
- n = SELECT_PROCESS_STATUS_CHANGE;
- else if ((GET_INT_CODE) != 0)
- n = SELECT_INTERRUPT;
- else
+ if (!blockp)
{
- UX_sigsuspend (&old);
- if (OS_process_any_status_change ())
- n = SELECT_PROCESS_STATUS_CHANGE;
- else
- n = SELECT_INTERRUPT;
+ if (!ignore_status_change && OS_process_any_status_change ())
+ return (SELECT_PROCESS_STATUS_CHANGE);
+ return (SELECT_INTERRUPT);
}
- UX_sigprocmask (SIG_SETMASK, &old, NULL);
+
+#ifdef HAVE_SIGSUSPEND
+ {
+ sigset_t old, new;
+
+ UX_sigfillset (&new);
+ UX_sigprocmask (SIG_SETMASK, &new, &old);
+ if (!ignore_status_change && OS_process_any_status_change ())
+ n = SELECT_PROCESS_STATUS_CHANGE;
+ else if ((GET_INT_CODE) != 0)
+ n = SELECT_INTERRUPT;
+ else
+ {
+ UX_sigsuspend (&old);
+ if (OS_process_any_status_change ())
+ n = SELECT_PROCESS_STATUS_CHANGE;
+ else
+ n = SELECT_INTERRUPT;
+ }
+ UX_sigprocmask (SIG_SETMASK, &old, NULL);
+ }
#else /* not HAVE_SIGSUSPEND */
INTERRUPTABLE_EXTENT
(n, (((!ignore_status_change && (OS_process_any_status_change ()))