close 990265 thanks Vincent Lefevre dixit:
>Note that here, pwd is a builtin, so that there is no >"program start-up". So no constraints are violated. This is wrong. pwd is allowed to be a builtin or not, and POSIX is pretty specific in that this shall not make a difference. >Anyway, this was just an example. So, instead of a closed stdout, >let's write to a full file system: These are all user errors. >Whatever POSIX says, it is important to report an error in such >a case, at least for the robustness of scripts. Perhaps. But unless required by POSIX, I’m not going to do the work. Utilities can, in general, assume that the standard I/O streams work properly or it is either a user error or one they cannot do much about anyway, and not catching errors on write(2), printf(3), etc. is s̲o̲ common in the Unix world you’ll have to live with it. In almost all cases, there’s also nothing one can do about it. For pwd(1) especially, I can argue that failure to write the result is not actually an error. It determined the directory properly and sent the information out. I’d argue that making failure to write into an error for pwd(1) is a bug. bye, //mirabilos -- Gestern Nacht ist mein IRC-Netzwerk explodiert. Ich hatte nicht damit gerechnet, darum bin ich blutverschmiert… wer konnte ahnen, daß SIE so reagier’n… gestern Nacht ist mein IRC-Netzwerk explodiert~~~ (as of 2021-06-15 The MirOS Project temporarily reconvenes on OFTC)