develooper Front page | perl.perl5.porters | Postings from April 2003

Re: [PATCH++] all about the recent standard conforming glibc's nic

Thread Next
From:
Enache Adrian
Date:
April 23, 2003 12:51
Subject:
Re: [PATCH++] all about the recent standard conforming glibc's nic
Message ID:
20030423194820.GA874@ratsnest.hole
On Wed, Apr 23, 2003 at 07:58:32PM +0200, Tels wrote:
> What about the EXPORT_OK section?

I failed to see your point. POSIX.pm exports all those functions by
default - 

$ perl -MPOSIX -le 'print setgid $)'
0 but true

what is put in EXPORT and what in EXPORT_OK is "policy", and I have
no opinions about any policy (:x

and ouch! nice should return the same 0 but true, so:

--- /arc/bleadperl/ext/POSIX/POSIX.xs	2002-12-18 05:20:13.000000000 +0200
+++ perl/ext/POSIX/POSIX.xs	2003-04-23 22:32:19.000000000 +0300
@@ -1386,9 +1386,17 @@
     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()

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About