Bug 195955
Summary: | sysconf(_SC_NPROCESSORS_ONLN) errno can be set to non-zerro on success | ||
---|---|---|---|
Product: | Documentation | Reporter: | Pavel Tikhomirov (ptikhomirov) |
Component: | man-pages | Assignee: | documentation_man-pages (documentation_man-pages) |
Status: | RESOLVED CODE_FIX | ||
Severity: | normal | CC: | mtk.manpages |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
URL: | https://sourceware.org/bugzilla/show_bug.cgi?id=21536 | ||
Kernel Version: | Subsystem: | ||
Regression: | No | Bisected commit-id: |
Description
Pavel Tikhomirov
2017-06-01 11:29:18 UTC
Yes, this looks like a very longstanding bug in the man page. That text is in general rather hard to parse, and I've rewritten it as below. Cheers, Michael RETURN VALUE The return value of sysconf() is one of the following: * On error, -1 is returned and errno is set to indicate the cause of the error (for example, EINVAL, indicating that name is invalid). * If name corresponds to a maximum or minimum limit, and that limit is indeterminate, -1 is returned and errno is not changed. (To distinguish an indeterminate limit from an error, set errno to zero before the call, and then check whether errno is nonzero when -1 is returned.) * If name corresponds to an option, -1 is returned if the option is not supported. * Otherwise, the current value of the option or limit is returned. This value will not be more restrictive than the corresponding value that was described to the application in <unistd.h> or <limits.h> when the application was compiled. |