[BusyBox] Re: ifconfig: Clean up. [PATCH]

Rob Landley rob at landley.net
Thu Jul 28 16:49:58 UTC 2005


On Wednesday 27 July 2005 07:10, Bernd Petrovitsch wrote:

> Given that I interpret your answer correctly, the man page of close(2)
> is wrong and error checking on close(2) is absolutely pointless.

The man page is describing posix.  This is a case where Linux diverges 
slightly from posix and is happy to stay that way.

> Actually the function prototype should be changed to "void
> close(void);".

That could break existing source code.

> This seems to resemble the current impülementation in the Linux kernel.
> Is this different on other kernels?

Yup.  Cacheing semantics differ.  Also, if your filesystem is mounted O_SYNC, 
presumably close() has at least the potential to return something useful.

> Apart from avoiding the confusion (which will surely come) in the above
> mentioned thread, why the fd is destroyed even if close(2) failed
> before.

The alternative would be that programs that _didn't_ check the return code 
(which vastly outnumber those that do) would potentially leak filehandles.

>  Bernd

Rob



More information about the busybox mailing list