Bug 246381 - popen(3) doesn't say if pclose sets errno when it returns -1
Summary: popen(3) doesn't say if pclose sets errno when it returns -1
Status: Closed Works As Intended
Alias: None
Product: Documentation
Classification: Unclassified
Component: Documentation (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-doc (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-11 19:15 UTC by Yuri Victorovich
Modified: 2021-02-16 18:36 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer 2020-05-11 19:15:23 UTC
The relevant part of popen(3) looks like this and doesn't say anything errno during pclose() failure.

>      The popen() function returns NULL if the fork(2) or pipe(2) calls fail,
>      or if it cannot allocate memory.
> 
>      The pclose() function returns -1 if stream is not associated with a
>      “popened” command, if stream already “pclosed”, or if wait4(2) returns an
>      error.
> 
> ERRORS
>      The popen() function does not reliably set errno.
Comment 1 Fernando Apesteguía freebsd_committer 2021-02-16 18:24:39 UTC
It says "The popen() function does not reliably set errno."

Do you mean something else?
Comment 2 Yuri Victorovich freebsd_committer 2021-02-16 18:36:05 UTC
Not sure now.