summaryrefslogtreecommitdiff
path: root/ext/POSIX/POSIX.xs
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-12-08 16:46:21 +0100
committerNicholas Clark <nick@ccl4.org>2011-12-30 11:36:39 +0100
commita387c53a5a2f3e13850addc6976624f827a26226 (patch)
tree9f5aed62be62f37269e9e83bd92bae669aa767e1 /ext/POSIX/POSIX.xs
parent937a45d0cc6e5b194e9242faa9cf78ba2122e6a3 (diff)
downloadperl-a387c53a5a2f3e13850addc6976624f827a26226.tar.gz
Convert POSIX::sleep to an XS wrapper for PerlProc_sleep().
Previously it was a Perl wrapper for CORE::sleep, converting CORE::sleep's return value of elapsed time slept into the POSIX return value of seconds remaining. However, that approach could sometimes return a negative result if CORE::sleep had slept for more than a second longer than the requested time.
Diffstat (limited to 'ext/POSIX/POSIX.xs')
-rw-r--r--ext/POSIX/POSIX.xs8
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs
index 1bad5e10d9..ab30a1c496 100644
--- a/ext/POSIX/POSIX.xs
+++ b/ext/POSIX/POSIX.xs
@@ -1885,6 +1885,14 @@ pause()
CLEANUP:
PERL_ASYNC_CHECK();
+unsigned int
+sleep(seconds)
+ unsigned int seconds
+ CODE:
+ RETVAL = PerlProc_sleep(seconds);
+ OUTPUT:
+ RETVAL
+
SysRet
setgid(gid)
Gid_t gid