From: Alejandro Colomar <colomar.6.4.3@gmail.com>
To: наб <nabijaczleweli@nabijaczleweli.xyz>
Cc: linux-man@vger.kernel.org,
"G. Branden Robinson" <g.branden.robinson@gmail.com>,
Jakub Wilk <jwilk@jwilk.net>
Subject: Re: [PATCH] ioctl.2: note "int request" form, HISTORYise a bit
Date: Wed, 13 Sep 2023 17:24:53 +0200 [thread overview]
Message-ID: <171eade0-c2f9-4390-a2ff-c5dd9bfe6a99@gmail.com> (raw)
In-Reply-To: <israsi2qmpudilwpy2h6vj4dda7jofrc3oolhrcs4cpwvwzl5x@ur3oua7jxgs3>
[-- Attachment #1.1: Type: text/plain, Size: 3300 bytes --]
Hi наб,
On 2023-09-04 16:29, наб wrote:
> Bit me in https://github.com/thecoshman/http/issues/155:
> musl (and, thus, bionic) takes an int!
>
> Kill the "POSIX says 'request' is int" comment,
> POSIX says nothing about ioctl:
Please reword that; while it will say nothing soon, the current
standard is Issue 7, which still says. Something like your reply
to Jakub should be enough.
> it invented tc[gs]etattr() and tc[gs]etwinsize() to avoid having
> ioctl() at all, and STREAMS is long dead from POSIX.
>
> Note how the interface evolved in HISTORY. The NetBSD CVS has
> revision 1.1
> date: 1993-03-21 10:45:37 +0100; author: cgd; state: Exp;
> branches: 1.1.1;
> Initial revision
> ----------------------------
> revision 1.1.1.2
> date: 1995-02-27 11:49:43 +0100; author: cgd; state: Exp; lines: +6
> -6;
> from Lite
> ----------------------------
> revision 1.1.1.1
> date: 1993-03-21 10:45:37 +0100; author: cgd; state: Exp; lines: +0
> -0;
> initial import of 386bsd-0.1 sources
> ----------------------------
> and it's char * in 1.1.1.1 and 1.1.1.2 but ... in 1.1, so hell knows.
>
> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
> ---
> man2/ioctl.2 | 40 ++++++++++++++++++++++++++++++++++++----
> 1 file changed, 36 insertions(+), 4 deletions(-)
>
> diff --git a/man2/ioctl.2 b/man2/ioctl.2
> index 6b55d47c9..a658da354 100644
> --- a/man2/ioctl.2
> +++ b/man2/ioctl.2
> @@ -20,9 +20,8 @@ .SH SYNOPSIS
> .nf
> .B #include <sys/ioctl.h>
> .PP
> -.BI "int ioctl(int " fd ", unsigned long " request ", ...);"
> -.\" POSIX says 'request' is int, but glibc has the above
> -.\" See https://bugzilla.kernel.org/show_bug.cgi?id=42705
> +.BI "int ioctl(int " fd ", unsigned long " request ", ...);" "\fR /* glibc, BSD */\fP"
> +.BI "int ioctl(int " fd ", int " request ", ...);" "\fR /* musl, other UNIX */\fP"
LGTM.
> .fi
> .SH DESCRIPTION
> The
> @@ -103,7 +102,40 @@ .SH VERSIONS
> .SH STANDARDS
> None.
> .SH HISTORY
> -Version\~7 AT&T UNIX.
> +Version\~7 AT&T UNIX has
> +.nf
> +.ti +.5i
I prefer using man(7) macros. Please use
.PP
.in +4n
.nf
stuff here
.fi
.in
.PP
If you want to prevent the blanks that this adds, you can
enclose that in .PD 0 / .PD
(.in is not a man(7) macro, but it is already widespread.)
Cheers,
Alex
> +.BI "ioctl(int " fildes ", int " request ", struct sgttyb *" argp );
> +.fi
> +(where
> +.B struct sgttyb
> +has historically been used by
> +.BR stty (2)
> +and
> +.BR gtty(2),
> +and is polymorphic by request type (like a
> +.B void *
> +would be, if it had been available)).
> +.PP
> +SysIII documents
> +.I arg
> +without a type at all.
> +.PP
> +4.3BSD has
> +.nf
> +.ti +.5i
> +.BI "ioctl(int " d ", unsigned long " request ", char *" argp );
> +.fi
> +(with
> +.B char *
> +similarly in for
> +.BR "void *" ).
> +.PP
> +SysVr4 has
> +.nf
> +.ti +.5i
> +.BI "int ioctl(int " fildes ", int " request ", ... /* " arg " */);"
> +.fi
> .SH NOTES
> In order to use this call, one needs an open file descriptor.
> Often the
--
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2023-09-13 15:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-04 14:29 [PATCH] ioctl.2: note "int request" form, HISTORYise a bit наб
2023-09-04 15:41 ` Jakub Wilk
2023-09-04 15:58 ` наб
2023-09-13 15:24 ` Alejandro Colomar [this message]
2023-09-13 16:02 ` наб
2023-09-13 16:44 ` Alejandro Colomar
2023-09-13 17:49 ` G. Branden Robinson
2023-09-13 21:23 ` Alejandro Colomar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=171eade0-c2f9-4390-a2ff-c5dd9bfe6a99@gmail.com \
--to=colomar.6.4.3@gmail.com \
--cc=alx@kernel.org \
--cc=g.branden.robinson@gmail.com \
--cc=jwilk@jwilk.net \
--cc=linux-man@vger.kernel.org \
--cc=nabijaczleweli@nabijaczleweli.xyz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 NNTP newsgroup(s).