Begin forwarded message:

(For the porters: the bug is that this:

% perl -le '$^E = -1728; print $^E+0 for 0,1'

Should return this:

        -1728
        -1728

But in some cases, returns this:

        -1728
        22

Odd.)

this is because perl's print writes to stdout, and that usually uses the linux implementation of C's stdio, and stdio uses isatty(3) on stdout at the first write to decide if stdout is a terminal (to decide what kind of output buffering to use). and isatty is usually implemented by trying some kernel system operation on the file descriptor, an operation that will fail if the file descriptor is not a terminal. in that case, the kernel operation fails and sets errno=22 (EINVAL) to indicate why it failed.



Reply via email to