lkml.org 
[lkml]   [2000]   [Jul]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: SIGSEGV on fclose.
Date
From
> Is it difficult for Linux to spot the the file isn't open and return EBADF?  
> What does POSIX have to say about this? IMHO making it easier to port your
> programs to Linux (and behaving a little more sanely :) is worth a couple of
> extra bytes of anyone's kernel.

Its very simple. If you fclose something which is not a valid fopen handle
your program may and will break. On other platforms you should fix it too
quite possibly you are getting away purely by luck and it may either break
or worse yet corrupt data undetected if you dont

close(bogusvalue)

returns -1, EBADF

fclose(bogusvalue)

is entitled to do as it pleases






-
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/

\
 
 \ /
  Last update: 2005-03-22 13:57    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site