guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Portability bug with `nice' on Solaris


From: Matthias Koeppe
Subject: Portability bug with `nice' on Solaris
Date: Mon, 06 Sep 2004 14:38:17 +0200

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]