summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian M. Enache <enache@rdslink.ro>2003-04-24 01:48:20 +0300
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-04-27 20:09:01 +0000
commit15f0f28a65432bb5e8f8e84f9d63806555182655 (patch)
tree0e108e86b0b084455e7d0b2021fb4ffa3c60959c
parentbef58541c5c970d738b420d60bf573e3d728ab4f (diff)
downloadperl-15f0f28a65432bb5e8f8e84f9d63806555182655.tar.gz
Newer glibc's nice(2) return the new nice value, instead of 0 or -1.
Check errno to see if the call to nice(2) succeeded. Subject: Re: [PATCH++] all about the recent standard conforming glibc's nic Message-ID: <20030423194820.GA874@ratsnest.hole> p4raw-id: //depot/perl@19356
-rw-r--r--ext/POSIX/POSIX.xs10
1 files changed, 9 insertions, 1 deletions
diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs
index 519f741512..f1e1013673 100644
--- a/ext/POSIX/POSIX.xs
+++ b/ext/POSIX/POSIX.xs
@@ -1386,9 +1386,17 @@ lseek(fd, offset, whence)
OUTPUT:
RETVAL
-SysRet
+SV *
nice(incr)
int incr
+ PPCODE:
+ errno = 0;
+ if ((incr = nice(incr)) != -1 || errno == 0) {
+ if (incr == 0)
+ XPUSHs(sv_2mortal(newSVpvn("0 but true", 10)));
+ else
+ XPUSHs(sv_2mortal(newSViv(incr)));
+ }
void
pipe()