3 ms·
Note, open is not part of C. A better comparison would be fopen which, according to the C99 draft I have, just returns NULL on failure.
by sausagefeet 15y ago
Note, open is not part of C. A better comparison would be fopen which, according to the C99 draft I have, just returns NULL on failure.
- JoachimSchipper 15y agoYou're technically correct, but that's not the "C" being discussed in this article. Also, fopen(3) on OpenBSD does document values errno after failure (by reference to the malloc(3) and open(2) man pages), and I expect that any reasonable system does likewise.