* Portability bug with `nice' on Solaris
@ 2004-09-06 12:38 Matthias Koeppe
2004-09-07 0:05 ` Kevin Ryde
0 siblings, 1 reply; 2+ messages in thread
From: Matthias Koeppe @ 2004-09-06 12:38 UTC (permalink / raw)
I tried to use the Guile procedure `nice' on Solaris:
guile> (nice 11)
ERROR: In procedure nice:
ERROR: Error 0
ABORT: (system-error)
In libguile/posix.c (scm_nice):
if (nice(SCM_INUM(incr)) != 0)
SCM_SYSERROR;
This way of error detection does not work on Solaris.
>From the Solaris man page nice(2):
RETURN VALUES
Upon successful completion, nice() returns the new nice
value minus NZERO. Otherwise, -1 is returned, the process's
nice value is not changed, and errno is set to indicate the
error.
USAGE
Since -1 is a permissible return value in a successful
situation, an application wishing to check for error situa-
tions should set errno to 0, then call nice(), and if it
returns -1, check to see if errno is non-zero.
Since I don't know what the interface is like on other systems, I am
not sending a patch.
--
Matthias Koeppe -- http://www.math.uni-magdeburg.de/~mkoeppe
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Portability bug with `nice' on Solaris
2004-09-06 12:38 Portability bug with `nice' on Solaris Matthias Koeppe
@ 2004-09-07 0:05 ` Kevin Ryde
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Ryde @ 2004-09-07 0:05 UTC (permalink / raw)
Cc: guile-devel
Matthias Koeppe <mkoeppe@merkur.math.uni-magdeburg.de> writes:
>
> if (nice(SCM_INUM(incr)) != 0)
> SCM_SYSERROR;
>
> This way of error detection does not work on Solaris.
Thanks. It's wrong everywhere else too :). I made a change.
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-09-07 0:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-06 12:38 Portability bug with `nice' on Solaris Matthias Koeppe
2004-09-07 0:05 ` Kevin Ryde
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).