Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/lib/libc/sys



Taylor R Campbell wrote in
 <20241221185628.A4EFAFC1D%cvs.NetBSD.org@localhost>:
 |Module Name:  src
 |Committed By: riastradh
 |Date:         Sat Dec 21 18:56:28 UTC 2024
 |
 |Modified Files:
 | src/lib/libc/sys: close.2
 |
 |Log Message:
 |close(2): Document the finality of closing.
 |
 |Even if close(2) returns -1 on error, the descriptor is closed (or
 |was already closed).
 |
 |POSIX doesn't specify this, but that's a bug in POSIX (probably to

Actually i think there was lots of discussion of this for the 2024
version, and it says

  For all other error situations (except for [EBADF] where fildes
  was invalid), fildes shall be closed.

It only remains EINTR / POSIX_CLOSE_RESTART as a problem.
That is being defined as

  POSIX_CLOSE_RESTART
  Allows restarts if a signal interrupts a close operation. This
  constant shall not be 0 unless posix_close( ) never returns −1
  with errno set to [EINTR].

 |accommodate some buggy ancient proprietary Unix).  Every free
 |software OS kernel I checked works the same way and it is important
 |to be able to reliably close descriptors with finality.

I have not seen the diff, so it may the complete picture is
a different one.

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)
|
|In Fall and Winter, feel "The Dropbear Bard"s pint(er).
|
|The banded bear
|without a care,
|Banged on himself for e'er and e'er
|
|Farewell, dear collar bear


Home | Main Index | Thread Index | Old Index