Subject: bug#53139: sleep return value error, with pselect6 system call on Linux

From: Christopher Baines <[email-masked]>
Date: Sun, 09 Jan 2022 09:58:19 +0000

The sleep procedure is documented as returning 0 when it's not
interrupted by a signal.

This behaviour seems to have changed in guile as distributed by GNU Guix
(see the time-machine commands below). Previously, guile used the select
system call which seemed to change the timeout argument to the time
left. The updated guile uses the pselect6 system call, which doesn't do
this.

→ guix time-machine --commit=b603554ed044638dd40b6863d5dada59eefe03b8 -- environment --ad-hoc guile -- guile -c '(peek (sleep 5))'

;;; (0)

select(4, [3], NULL, NULL, {tv_sec=5, tv_usec=0}) = 0 (Timeout)

→ guix time-machine --commit=6dffced09ecda024e0884e352778c221ad066fd6 -- environment --ad-hoc guile -- guile -c '(peek (sleep 5))'

;;; (5)

pselect6(4, [3], NULL, NULL, {tv_sec=5, tv_nsec=0}, NULL) = 0 (Timeout)