You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 7257 Reporter:@hannesm Assigned to:@gasche Status: closed (set by @xavierleroy on 2017-09-24T15:32:59Z) Resolution: fixed Priority: normal Severity: minor Platform: amd64 OS: FreeBSD Version: 4.03.0 Fixed in version: 4.04.0 +dev / +beta1 / +beta2 Category: runtime system and C interface Related to:#4023
Bug description
In OCaml < 4.03, a Unix.sleep 0 executed the syscall sleep (or nanosleep) with 0 seconds.
I use this mechanism to signal to DTrace the begin and finish of a test.
In 4.03, Unix.sleep 0 does not lead to a syscall anymore, it returns immediately.
Another regression is that sleep used to use nanosleep, but now it uses select (on this machine here), because of an unusual usage of _POSIX_C_SOURCE -- as far as I understand from http://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_02.html if your code uses a specific POSIX version, you should "#define _POSIX_C_SOURCE ", whereas sleep.c does a "#ifdef _POSIX_C_SOURCE >= 199309L". FreeBSD provides "nanosleep" as part of libc.
My impression is that instead of _POSIX_C_SOURCE, a check in configure should be used which tests whether nanosleep is available on the system.
Additional information
It would be great to get back support for Unix.sleep 0. Also, using nanosleep again, instead of select would be great. I can prepare a GPR if you agree that both are regressions.
The text was updated successfully, but these errors were encountered:
Original bug ID: 7257
Reporter: @hannesm
Assigned to: @gasche
Status: closed (set by @xavierleroy on 2017-09-24T15:32:59Z)
Resolution: fixed
Priority: normal
Severity: minor
Platform: amd64
OS: FreeBSD
Version: 4.03.0
Fixed in version: 4.04.0 +dev / +beta1 / +beta2
Category: runtime system and C interface
Related to: #4023
Bug description
In OCaml < 4.03, a
Unix.sleep 0
executed the syscall sleep (or nanosleep) with 0 seconds.I use this mechanism to signal to DTrace the begin and finish of a test.
In 4.03,
Unix.sleep 0
does not lead to a syscall anymore, it returns immediately.Another regression is that sleep used to use nanosleep, but now it uses select (on this machine here), because of an unusual usage of _POSIX_C_SOURCE -- as far as I understand from http://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_02.html if your code uses a specific POSIX version, you should "#define _POSIX_C_SOURCE ", whereas sleep.c does a "#ifdef _POSIX_C_SOURCE >= 199309L". FreeBSD provides "nanosleep" as part of libc.
My impression is that instead of _POSIX_C_SOURCE, a check in configure should be used which tests whether nanosleep is available on the system.
Additional information
It would be great to get back support for
Unix.sleep 0
. Also, using nanosleep again, instead of select would be great. I can prepare a GPR if you agree that both are regressions.The text was updated successfully, but these errors were encountered: