public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] grantpt.3: no-op on modern glibc and other UNIXes
@ 2023-06-19  0:14 наб
  2023-06-19  6:54 ` Jakub Wilk
  2023-06-19 22:11 ` [PATCH v2] " наб
  0 siblings, 2 replies; 17+ messages in thread
From: наб @ 2023-06-19  0:14 UTC (permalink / raw)
  To: Alejandro Colomar (man-pages); +Cc: linux-man

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

FreeBSD, OpenBSD, and Linux (/dev/ptmx) do all intialisation in open,
and grantpt() is a no-op (checking whether the fd is a pty, except on
musl).

The illumos gate and NetBSD do a ioctl (and, indeed, illumos-gate commit
 facf4a8d7b59fde89a8662b4f4c73a758e6c402c ("PSARC/2003/246 Filesystem
  Driven Device Naming"), which kills pt_chmod, notes that it's been
    6464196 bfu should remove pt_chmod, obsoleted by /dev filesystem).

glibc 2.33 completely kills BSD PTY support on Linux
(Debian hasn't configured with them on any architecture since 2007:
   https://bugs.debian.org/338404
 and even earlier on some arches; they're really all but trivia under
 Linux ‒ this may be better served stuffed into HISTORY as an explainer
 for the SIGCHLD thing, since regardless of the "version", the behaviour
 is well-defined and consistent).

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
---
 man3/grantpt.3 | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/man3/grantpt.3 b/man3/grantpt.3
index a19172a3e..fda2f9625 100644
--- a/man3/grantpt.3
+++ b/man3/grantpt.3
@@ -84,17 +84,15 @@ .SH ATTRIBUTES
 .ad
 .sp 1
 .SH VERSIONS
-Many systems implement this function via a set-user-ID helper binary
+Historical systems implemented this function via a set-user-ID helper binary
 called "pt_chown".
-On Linux systems with a devpts filesystem (present since Linux 2.2),
-the kernel normally sets the correct ownership and permissions
-for the pseudoterminal slave when the master is opened
-.RB ( posix_openpt (3)),
-so that nothing must be done by
-.BR grantpt ().
-Thus, no such helper binary is required
-(and indeed it is configured to be absent during the
-glibc build that is typical on many systems).
+glibc on Linux before 2.33 could do so as well,
+in order to support configurations with only BSD pseudoterminals;
+this support has been removed.
+On modern systems this is either a no-op\[em]with
+permissions configured on pty allocation,
+as is the case on Linux\[em]or a
+.BR ioctl (2).
 .SH STANDARDS
 POSIX.1-2008.
 .SH HISTORY
-- 
2.39.2

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

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

end of thread, other threads:[~2023-07-18 21:28 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-19  0:14 [PATCH] grantpt.3: no-op on modern glibc and other UNIXes наб
2023-06-19  6:54 ` Jakub Wilk
2023-06-19 22:11 ` [PATCH v2] " наб
2023-07-08 15:54   ` Alejandro Colomar
2023-07-08 19:59     ` [PATCH v3] " наб
2023-07-15 13:32       ` Alejandro Colomar
2023-07-15 18:49         ` [PATCH v4] " наб
2023-07-16  1:09           ` Alejandro Colomar
2023-07-16 11:55             ` [PATCH v5] " наб
2023-07-16 13:46               ` Alejandro Colomar
2023-07-16 14:52                 ` наб
2023-07-16 15:11                   ` Alejandro Colomar
2023-07-17 23:13               ` Alejandro Colomar
2023-07-17 23:31                 ` [PATCH v6] grantpt.3: no-op on modern glibc and other UNIXes, HISTORYise наб
2023-07-18 11:42                   ` Alejandro Colomar
2023-07-18 15:07                     ` наб
2023-07-18 21:28                       ` Alejandro Colomar

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