On Thu, Apr 23, 2020 at 05:48:42PM -0400, Andras Farkas wrote: > I was reading the thread about STAILQ and SIMPLEQ and thought it was > interesting, so I then read a little about sys/queue.h and search.h > I noticed an error in insque.3: > https://man.openbsd.org/insque.3 > The words "next" and "previous" are swapped, as it is the first > pointer that points to the next element, and the second pointer that > points to the previous element. > I confirmed this both in insque.c (to make sure I understood the > directionality correctly): > https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdlib/insque.c?rev=1.3&content-type=text/x-cvsweb-markup > and in POSIX, which the man page states OpenBSD's insque() conforms to: > https://pubs.opengroup.org/onlinepubs/9699919799/functions/insque.html > > I have the diff to fix this both inline and attached. > Checksum for anyone trying to grab the diff from inline, since my > inline diffs usually get mangled: > SHA256 (insque3diff.txt) = > 8340d135c06abc46127a12307b9611d274e1ad3e35dc6cf662da15a1f4502dec > > Index: insque.3 > =================================================================== > RCS file: /cvs/src/lib/libc/stdlib/insque.3,v > retrieving revision 1.10 > diff -u -p -r1.10 insque.3 > --- insque.3 30 Nov 2014 20:19:12 -0000 1.10 > +++ insque.3 23 Apr 2020 21:13:10 -0000 > @@ -61,7 +61,7 @@ struct qelem { > .Ed > .Pp > The first two elements in the struct must be pointers of the > -same type that point to the previous and next elements in > +same type that point to the next and previous elements in > the queue respectively. > Any subsequent data in the struct is application-dependent. > .Pp >
hi. i just committed this part. > Also, I feel the phrasing isn't as clear as it could be. The way > "respectively" is used makes more sense in the way the other BSD man > pages use "first and second" (in "first and second members") rather > than the OpenBSD man page's "first two" (in "first two elements"). I > think "respectively" makes more sense when used in analogy, or pairing > up words. > https://www.freebsd.org/cgi/man.cgi?query=insque&apropos=0&sektion=0&manpath=FreeBSD+12.1-RELEASE+and+Ports&arch=default&format=html > https://netbsd.gw.com/cgi-bin/man-cgi?insque > https://leaf.dragonflybsd.org/cgi/web-man?command=insque§ion=ANY > Their wording is identical. > but could;t convince myself that this was any clearer. jmc > I have a larger diff as an option, in light of the above: > SHA256 (insque3difflarge.txt) = > c2e242221f016ae4bafa3b40a466f27016d4f44b3f58053a60204e06aecefaf9 > > Index: insque.3 > =================================================================== > RCS file: /cvs/src/lib/libc/stdlib/insque.3,v > retrieving revision 1.10 > diff -u -p -r1.10 insque.3 > --- insque.3 30 Nov 2014 20:19:12 -0000 1.10 > +++ insque.3 23 Apr 2020 21:42:07 -0000 > @@ -60,8 +60,8 @@ struct qelem { > }; > .Ed > .Pp > -The first two elements in the struct must be pointers of the > -same type that point to the previous and next elements in > +The first and second elements in the struct must be pointers of the > +same type that point to the next and previous elements in > the queue respectively. > Any subsequent data in the struct is application-dependent. > .Pp > > Thanks for reading! > Index: insque.3 > =================================================================== > RCS file: /cvs/src/lib/libc/stdlib/insque.3,v > retrieving revision 1.10 > diff -u -p -r1.10 insque.3 > --- insque.3 30 Nov 2014 20:19:12 -0000 1.10 > +++ insque.3 23 Apr 2020 21:13:10 -0000 > @@ -61,7 +61,7 @@ struct qelem { > .Ed > .Pp > The first two elements in the struct must be pointers of the > -same type that point to the previous and next elements in > +same type that point to the next and previous elements in > the queue respectively. > Any subsequent data in the struct is application-dependent. > .Pp > Index: insque.3 > =================================================================== > RCS file: /cvs/src/lib/libc/stdlib/insque.3,v > retrieving revision 1.10 > diff -u -p -r1.10 insque.3 > --- insque.3 30 Nov 2014 20:19:12 -0000 1.10 > +++ insque.3 23 Apr 2020 21:42:07 -0000 > @@ -60,8 +60,8 @@ struct qelem { > }; > .Ed > .Pp > -The first two elements in the struct must be pointers of the > -same type that point to the previous and next elements in > +The first and second elements in the struct must be pointers of the > +same type that point to the next and previous elements in > the queue respectively. > Any subsequent data in the struct is application-dependent. > .Pp