bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* close() behavior when there are multiple fds for a socket
@ 2021-10-14 23:03 Ben Pfaff
  2021-10-14 23:09 ` Paul Eggert
  0 siblings, 1 reply; 9+ messages in thread
From: Ben Pfaff @ 2021-10-14 23:03 UTC (permalink / raw)
  To: bug-gnulib

I guess this isn't the best place to ask this question, but I think there
are knowledgeable people here. I don't know the right place, so I'd
welcome being redirected to a better one.

The POSIX spec for close() is here:
https://pubs.opengroup.org/onlinepubs/9699919799/

This specification has a lot of cases that explicitly apply only to the
last close of an object, either using that language or by saying that
something happens when "all file descriptors associated with" an
object are closed. But it doesn't say that for sockets. Instead, it
just says, "If fildes refers to a socket, close() shall cause the
socket to be destroyed," which implies that closing any file
descriptor for a socket destroys the socket. I think that must be
wrong, because I don't think that's the behavior on the systems
I've used.

Do I misunderstand the spec? Or the behavior on real systems?
(Should I submit a request for clarification to the spec maintainers?)

Thanks,

Ben.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: close() behavior when there are multiple fds for a socket
  2021-10-14 23:03 close() behavior when there are multiple fds for a socket Ben Pfaff
@ 2021-10-14 23:09 ` Paul Eggert
  2021-10-14 23:53   ` Ben Pfaff
  0 siblings, 1 reply; 9+ messages in thread
From: Paul Eggert @ 2021-10-14 23:09 UTC (permalink / raw)
  To: Ben Pfaff; +Cc: bug-gnulib

On 10/14/21 16:03, Ben Pfaff wrote:

> https://pubs.opengroup.org/onlinepubs/9699919799/
> 
> This specification has a lot of cases that explicitly apply only to the
> last close of an object, either using that language or by saying that
> something happens when "all file descriptors associated with" an
> object are closed. But it doesn't say that for sockets.

Yes, and you're right that this is a typo.


> (Should I submit a request for clarification to the spec maintainers?)

Sure, and you can do so as described here:

https://www.opengroup.org/austin/

(look for "Defect Reports").


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: close() behavior when there are multiple fds for a socket
  2021-10-14 23:09 ` Paul Eggert
@ 2021-10-14 23:53   ` Ben Pfaff
  2021-10-14 23:55     ` Paul Eggert
  0 siblings, 1 reply; 9+ messages in thread
From: Ben Pfaff @ 2021-10-14 23:53 UTC (permalink / raw)
  To: Paul Eggert; +Cc: bug-gnulib

On Thu, Oct 14, 2021 at 4:09 PM Paul Eggert <eggert@cs.ucla.edu> wrote:
>
> On 10/14/21 16:03, Ben Pfaff wrote:
>
> > https://pubs.opengroup.org/onlinepubs/9699919799/
> >
> > This specification has a lot of cases that explicitly apply only to the
> > last close of an object, either using that language or by saying that
> > something happens when "all file descriptors associated with" an
> > object are closed. But it doesn't say that for sockets.
>
> Yes, and you're right that this is a typo.

Thanks.

> > (Should I submit a request for clarification to the spec maintainers?)
>
> Sure, and you can do so as described here:
>
> https://www.opengroup.org/austin/
>
> (look for "Defect Reports").

That's harder than it should be. To get a login to their bug tracker,
you have to email the chair of the group. The chair of the group
appears to be Andrew Josey, but he hides his email so you can't
find it. Anyway, after some web searches I think I found his real
email address, so I'll report it once he creates my account.

Thanks again!


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: close() behavior when there are multiple fds for a socket
  2021-10-14 23:53   ` Ben Pfaff
@ 2021-10-14 23:55     ` Paul Eggert
  2021-10-15 16:10       ` Ben Pfaff
  0 siblings, 1 reply; 9+ messages in thread
From: Paul Eggert @ 2021-10-14 23:55 UTC (permalink / raw)
  To: Ben Pfaff; +Cc: bug-gnulib

On 10/14/21 16:53, Ben Pfaff wrote:
> The chair of the group
> appears to be Andrew Josey, but he hides his email

Sorry, I should have told you it's Andrew Josey <ajosey@opengroup.org>.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: close() behavior when there are multiple fds for a socket
  2021-10-14 23:55     ` Paul Eggert
@ 2021-10-15 16:10       ` Ben Pfaff
  2021-10-15 18:40         ` Eric Blake
  0 siblings, 1 reply; 9+ messages in thread
From: Ben Pfaff @ 2021-10-15 16:10 UTC (permalink / raw)
  To: Paul Eggert; +Cc: bug-gnulib

On Thu, Oct 14, 2021 at 4:55 PM Paul Eggert <eggert@cs.ucla.edu> wrote:
>
> On 10/14/21 16:53, Ben Pfaff wrote:
> > The chair of the group
> > appears to be Andrew Josey, but he hides his email
>
> Sorry, I should have told you it's Andrew Josey <ajosey@opengroup.org>.

Thanks!

What a bureaucratic organization! The bug report form, once I got a login,
requires one to specify a page number and line number, but it seems that
you can only get the PDF version of the spec that has that information  if
you belong to an organization that is a member, so I filled those in with "?"
and am hoping for the best.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: close() behavior when there are multiple fds for a socket
  2021-10-15 16:10       ` Ben Pfaff
@ 2021-10-15 18:40         ` Eric Blake
  2021-10-15 18:41           ` Ben Pfaff
  0 siblings, 1 reply; 9+ messages in thread
From: Eric Blake @ 2021-10-15 18:40 UTC (permalink / raw)
  To: Ben Pfaff; +Cc: Paul Eggert, bug-gnulib

On Fri, Oct 15, 2021 at 09:10:04AM -0700, Ben Pfaff wrote:
> What a bureaucratic organization! The bug report form, once I got a login,
> requires one to specify a page number and line number, but it seems that
> you can only get the PDF version of the spec that has that information  if
> you belong to an organization that is a member, so I filled those in with "?"
> and am hoping for the best.

That's fine.  Adding page numbers after the fact is something that
happens rather frequently; and I've done in for your bug in particular
just now.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: close() behavior when there are multiple fds for a socket
  2021-10-15 18:40         ` Eric Blake
@ 2021-10-15 18:41           ` Ben Pfaff
  2021-10-21 22:02             ` Bernhard Voelker
  0 siblings, 1 reply; 9+ messages in thread
From: Ben Pfaff @ 2021-10-15 18:41 UTC (permalink / raw)
  To: Eric Blake; +Cc: Paul Eggert, bug-gnulib

On Fri, Oct 15, 2021 at 11:40 AM Eric Blake <eblake@redhat.com> wrote:
> On Fri, Oct 15, 2021 at 09:10:04AM -0700, Ben Pfaff wrote:
> > What a bureaucratic organization! The bug report form, once I got a login,
> > requires one to specify a page number and line number, but it seems that
> > you can only get the PDF version of the spec that has that information  if
> > you belong to an organization that is a member, so I filled those in with "?"
> > and am hoping for the best.
>
> That's fine.  Adding page numbers after the fact is something that
> happens rather frequently; and I've done in for your bug in particular
> just now.

Thanks so much!


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: close() behavior when there are multiple fds for a socket
  2021-10-15 18:41           ` Ben Pfaff
@ 2021-10-21 22:02             ` Bernhard Voelker
  2021-10-21 22:53               ` Ben Pfaff
  0 siblings, 1 reply; 9+ messages in thread
From: Bernhard Voelker @ 2021-10-21 22:02 UTC (permalink / raw)
  To: Ben Pfaff, Eric Blake; +Cc: Paul Eggert, bug-gnulib

On 10/15/21 20:41, Ben Pfaff wrote:
> On Fri, Oct 15, 2021 at 11:40 AM Eric Blake <eblake@redhat.com> wrote:
>> On Fri, Oct 15, 2021 at 09:10:04AM -0700, Ben Pfaff wrote:
>>> What a bureaucratic organization! The bug report form, once I got a login,
>>> requires one to specify a page number and line number, but it seems that
>>> you can only get the PDF version of the spec that has that information  if
>>> you belong to an organization that is a member, so I filled those in with "?"
>>> and am hoping for the best.
>>
>> That's fine.  Adding page numbers after the fact is something that
>> happens rather frequently; and I've done in for your bug in particular
>> just now.
> 
> Thanks so much!

Would you mind adding the opengroup bug here for reference?

Thanks & have a nice day,
Berny


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: close() behavior when there are multiple fds for a socket
  2021-10-21 22:02             ` Bernhard Voelker
@ 2021-10-21 22:53               ` Ben Pfaff
  0 siblings, 0 replies; 9+ messages in thread
From: Ben Pfaff @ 2021-10-21 22:53 UTC (permalink / raw)
  To: Bernhard Voelker; +Cc: bug-gnulib, Paul Eggert, Eric Blake

On Thu, Oct 21, 2021 at 3:02 PM Bernhard Voelker
<mail@bernhard-voelker.de> wrote:
> Would you mind adding the opengroup bug here for reference?

Here you go:
https://www.austingroupbugs.net/view.php?id=1525


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-10-21 22:54 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-14 23:03 close() behavior when there are multiple fds for a socket Ben Pfaff
2021-10-14 23:09 ` Paul Eggert
2021-10-14 23:53   ` Ben Pfaff
2021-10-14 23:55     ` Paul Eggert
2021-10-15 16:10       ` Ben Pfaff
2021-10-15 18:40         ` Eric Blake
2021-10-15 18:41           ` Ben Pfaff
2021-10-21 22:02             ` Bernhard Voelker
2021-10-21 22:53               ` Ben Pfaff

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).