Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Not that it matters, but fclose() doesn't happen in the kernel, so the kernel devs can't do anything about it. All libcs have essentially the same implementation:

- is fp NULL or already already closed? return error

- call fflush() and return error if it fails (fflush also happens in userland, it does a seek() then a write() of the userland buffer)

- call close() and return error if it fails

close() follows essentially the same process inside the kernel: check fd is valid, call flush() (this time truly to disk), close it.



Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: