Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 May 1998 11:19:43 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        dufault@hda.com, mike@smith.net.au
Cc:        current@FreeBSD.ORG
Subject:   Re: cdrecord trouble on currnet
Message-ID:  <199805290119.LAA20313@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>> Can you give an example of the correct mechanism for using sysconf() to 
>> determine the availability of the scheduler?  I'll fix it in the 
>> updates I'm working on.
>
>    if (sysconf(_SC_PRIORITY_SCHEDULING) == -1) {
>        if (errno != 0) {
>            /* This isn't valid:
>             */
>            err(EX_OSERR, "sysconf(_SC_PRIORITY_SCHEDULING)");
>        }
>        else {
>            errx(EX_UNAVAILABLE,
>            "No run-time support for POSIX priority scheduling");
>        }
>    }

The "This isn't valid" case isn't valid, since sysconf() doesn't change
errno if there is no error.  errno must be set before calling sysconf().

Bruce

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199805290119.LAA20313>