On 2018-09-07, at 19:06:51, Charles Mills wrote:
>
> Something like system("bpxmtext %x") where I substitute the errno2() value
> into the message. But (1) I read a warning about having to allocate stdin
> and so forth, ...
>
Where is that warning? In Doc? Or did it occur as an error message?
Why should bpxmtext need stdin?
> Environment is started task, POSIX(ON), C++, any current release of z/OS.
>
POSIX tells me:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/stdin.html#tag_16_565
...
stderr, stdin, stdout - standard I/O streams
...
At program start-up, three streams shall be predefined and
need not be opened explicitly: standard input (for reading
conventional input), standard output (for writing
conventional output), and standard error (for writing
diagnostic output).
The following symbolic values in <unistd.h> define the file
descriptors that shall be associated with the C-language
stdin, stdout, and stderr when the application is started:
STDIN_FILENO
Standard input value, stdin. Its value is 0.
STDOUT_FILENO
Standard output value, stdout. Its value is 1.
STDERR_FILENO
Standard error value, stderr. Its value is 2.
... So I'd expect descriptors 0, 1, and 2 to be inherited by
whatever utility is invoked by system().
But this is z/OS. Is it possible that stdin, stdout, and
stderr are bastard FILEs:
https://en.wikipedia.org/wiki/File:FilesFlat-Smooth-2ndCut-Bastard.jpg
... not the legitimate progeny of descriptors 1, 2, and 3?
Is there anything the programmer should do to make these
descriptors available in an (allegedly) POSIX C program?
Is POSIX POSIX? Is Truth Truth?
-- gil
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN