Re: close and ERESTART

2011-12-26 Thread Matthew Mondor
On Mon, 26 Dec 2011 05:19:22 + Taylor R Campbell wrote: > + > + error = fd_close(SCARG(uap, fd)); > + if (error == ERESTART) > + error = EINTR; > + > + return error; If it's also guaranteed that the file descriptor state is closed in the event of an ERESTART error, I

close and ERESTART

2011-12-25 Thread Taylor R Campbell
sys_close guarantees that it has closed the file descriptor when it returns, even if it returns EINTR. Thus, repeating a call to close(2) when it returns EINTR is always a mistake on NetBSD, and on other systems as well such as FreeBSD and Linux. (This conforms to POSIX, as would an implementatio