user/lib/libc/src/file/fclose.c
/**
 * Close the specified file descriptor.
 */
Close the specified file descriptor.
Close the specified file descriptor .
int fclose(FILE *stream) {
    int err = 0;
#ifndef LIBC_NOTLS
    UnregisterFdStream(stream);
#endif
    if(stream->close) {
        err = stream->close(stream);
    }
    free(stream);
    return err;
}
int fclose ( FILE * stream ) { int err = 0 ; #ifndef LIBC_NOTLS UnregisterFdStream ( stream ) ; #endif if ( stream -> close ) { err = stream -> close ( stream ) ; } free ( stream ) ; return err ; }
Close the specified file descriptor.
Close the specified file descriptor .
// unregister the FD // invoke the close handler // XXX: is it a guarantee all file streams are allocated via malloc()?