From: Adrian M. Enache Date: Wed, 23 Apr 2003 22:48:20 +0000 (+0300) Subject: Newer glibc's nice(2) return the new nice value, instead of 0 or -1. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=15f0f28a65432bb5e8f8e84f9d63806555182655;p=p5sagit%2Fp5-mst-13.2.git 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 --- diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs index 519f741..f1e1013 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()