public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
* Should aiocb(3type) say something about the order of fields?
@ 2026-02-14 11:51 Jonathan Wakely
  2026-02-14 12:30 ` Alejandro Colomar
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Wakely @ 2026-02-14 11:51 UTC (permalink / raw)
  To: linux-man

https://man7.org/linux/man-pages/man3/aiocb.3type.html doesn't tell
you that the order shown there is not the real order used on linux. It
does tell you to look at aio(7), which says:

    struct aiocb {
       /* The order of these fields is implementation-dependent */
       ...
       /* Various implementation-internal fields not shown */
    };

I think it would be helpful to repeat that in aiocb(3type) so you
don't need to go to a second page to get that info. If aiocb(3type)
shows actual C code with a struct definition it's reasonable to assume
that it is accurate, which isn't the case here. The comments in the
aio(7) page make that clearer.

The Glibc manual
<https://sourceware.org/glibc/manual/latest/html_node/Asynchronous-I_002fO.html>
just names the fields (not showing an actual struct definition) and
doesn't imply anything about the order.


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

* Re: Should aiocb(3type) say something about the order of fields?
  2026-02-14 11:51 Should aiocb(3type) say something about the order of fields? Jonathan Wakely
@ 2026-02-14 12:30 ` Alejandro Colomar
  2026-02-14 12:33   ` Alejandro Colomar
  0 siblings, 1 reply; 3+ messages in thread
From: Alejandro Colomar @ 2026-02-14 12:30 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: linux-man

[-- Attachment #1: Type: text/plain, Size: 1755 bytes --]

Hi Jonathan,

On 2026-02-14T11:51:36+0000, Jonathan Wakely wrote:
> https://man7.org/linux/man-pages/man3/aiocb.3type.html doesn't tell
> you that the order shown there is not the real order used on linux.

Hmmm, this was explained in system_data_types(7).  When the page was
split into many, that information remained there (and I still have
pending the move of the remaining two types in that page).

That page says:
     The structures described in this manual  page  shall  contain,  at
     least, the members shown in their definition, in no particular or‐
     der.

My intention was (and still is) to move that page to intro(3type), and
keep system_data_types as a link page to intro(3type).

> It
> does tell you to look at aio(7), which says:
> 
>     struct aiocb {
>        /* The order of these fields is implementation-dependent */

How about '/* members in no particular order */'?

>        ...
>        /* Various implementation-internal fields not shown */

I'd replace the second comment by '/* ... */'

>     };
> 
> I think it would be helpful to repeat that in aiocb(3type) so you
> don't need to go to a second page to get that info. If aiocb(3type)
> shows actual C code with a struct definition it's reasonable to assume
> that it is accurate, which isn't the case here. The comments in the
> aio(7) page make that clearer.
> 
> The Glibc manual
> <https://sourceware.org/glibc/manual/latest/html_node/Asynchronous-I_002fO.html>
> just names the fields (not showing an actual struct definition) and
> doesn't imply anything about the order.

I prefer the actual struct definition.  I think it's more readable.


Have a lovely day!
Alex

-- 
<https://www.alejandro-colomar.es>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: Should aiocb(3type) say something about the order of fields?
  2026-02-14 12:30 ` Alejandro Colomar
@ 2026-02-14 12:33   ` Alejandro Colomar
  0 siblings, 0 replies; 3+ messages in thread
From: Alejandro Colomar @ 2026-02-14 12:33 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: linux-man

[-- Attachment #1: Type: text/plain, Size: 2660 bytes --]

On 2026-02-14T13:30:05+0100, Alejandro Colomar wrote:
> Hi Jonathan,
> 
> On 2026-02-14T11:51:36+0000, Jonathan Wakely wrote:
> > https://man7.org/linux/man-pages/man3/aiocb.3type.html doesn't tell
> > you that the order shown there is not the real order used on linux.
> 
> Hmmm, this was explained in system_data_types(7).  When the page was
> split into many, that information remained there (and I still have
> pending the move of the remaining two types in that page).
> 
> That page says:
>      The structures described in this manual  page  shall  contain,  at
>      least, the members shown in their definition, in no particular or‐
>      der.
> 
> My intention was (and still is) to move that page to intro(3type), and
> keep system_data_types as a link page to intro(3type).
> 
> > It
> > does tell you to look at aio(7), which says:
> > 
> >     struct aiocb {
> >        /* The order of these fields is implementation-dependent */
> 
> How about '/* members in no particular order */'?
> 
> >        ...
> >        /* Various implementation-internal fields not shown */
> 
> I'd replace the second comment by '/* ... */'

How about this?

	$ diffman-git 
	--- HEAD:man/man3type/aiocb.3type
	+++ ./man/man3type/aiocb.3type
	@@ -10,6 +10,7 @@ SYNOPSIS
	      #include <aio.h>
	 
	      struct aiocb {
	+         /* members in no particular order */
		  int             aio_fildes;     /* File descriptor */
		  off_t           aio_offset;     /* File offset */
		  volatile void  *aio_buf;        /* Location of buffer */
	@@ -17,6 +18,7 @@ SYNOPSIS
		  int             aio_reqprio;    /* Request priority offset */
		  struct sigevent aio_sigevent;   /* Signal number and value */
		  int             aio_lio_opcode; /* Operation to be performed */
	+         /* ... */
	      };
	 
	 DESCRIPTION

> 
> >     };
> > 
> > I think it would be helpful to repeat that in aiocb(3type) so you
> > don't need to go to a second page to get that info. If aiocb(3type)
> > shows actual C code with a struct definition it's reasonable to assume
> > that it is accurate, which isn't the case here. The comments in the
> > aio(7) page make that clearer.
> > 
> > The Glibc manual
> > <https://sourceware.org/glibc/manual/latest/html_node/Asynchronous-I_002fO.html>
> > just names the fields (not showing an actual struct definition) and
> > doesn't imply anything about the order.
> 
> I prefer the actual struct definition.  I think it's more readable.
> 
> 
> Have a lovely day!
> Alex
> 
> -- 
> <https://www.alejandro-colomar.es>



-- 
<https://www.alejandro-colomar.es>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2026-02-14 12:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-14 11:51 Should aiocb(3type) say something about the order of fields? Jonathan Wakely
2026-02-14 12:30 ` Alejandro Colomar
2026-02-14 12:33   ` Alejandro Colomar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox