Messages in this thread | | | From | "David Schwartz" <> | Subject | RE: fclose() again | Date | Fri, 14 Jul 2000 14:33:14 -0700 |
| |
> Well, according to the man page, fclose() should return EBADF if > the passed > argument is not an open stream. No where does it say that it > segfaults, and > the I don't see when it returns EBADF instead of segfaulting. > > I think the library might need to be patched, wherever it is segfaulting.
Bad pointers lead to segfaults. End of story.
The manual page tells you what the error means, it does not guarantee that every possible case where the error might be argued to apply will be detected and reported as such.
One could make a similar argument for, say, 'realloc', which can segfault of passed a bad pointer. The documentation says it should return NULL if the "request fails".
DS
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |