From patchwork Tue Apr 15 22:23:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H. Peter Anvin" X-Patchwork-Id: 110524 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 62A313857810 for ; Tue, 15 Apr 2025 22:24:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 62A313857810 Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (2048-bit key, unprotected) header.d=zytor.com header.i=@zytor.com header.a=rsa-sha256 header.s=2025032001 header.b=BS+a5pBy X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail.zytor.com (unknown [IPv6:2607:7c80:54:3::138]) by sourceware.org (Postfix) with ESMTPS id C7FA93858C48 for ; Tue, 15 Apr 2025 22:24:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C7FA93858C48 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=zytor.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=zytor.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C7FA93858C48 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:7c80:54:3::138 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1744755848; cv=none; b=jTPNGI/bmJZrtVprNCkYGsEOhdRl0cW6hJ6RpPPlFaMcqvuBkcoo88JKDUSuN8tToXFEMfsN64rIjxF4lK1vS10YSL2LjWXKSf+x3CANI2jTM7DPbzv3HN61v/9b/0kBrFZEO493g0S1xNlt6yFH2kuG3YDK6xhaw6nB379L4LY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1744755848; c=relaxed/simple; bh=1IjS6NEPJpvNBQjAf4C80ECdxpUkod81fyoKloJL6oI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=yBS1+lop7fdlFz/imz1l4/skR2RqNH5ZoHd0HMYOtrwDIZ3AhWCINt4EculSoEAzpyZKJxtQXjiy6oYVbVQRLa8OdKF/Pi4Ap+NA6rwkKQ0MDD4GxwaQqlvphIPEvEILN0V5F3xDxoRXNZysVjflubos9WLOTfhPXFP3LrfTUqQ= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C7FA93858C48 Received: from carbon-x1.hos.anvin.org ([IPv6:2601:646:8081:1f94:9d5:a0c2:3619:62ac]) (authenticated bits=0) by mail.zytor.com (8.18.1/8.17.1) with ESMTPSA id 53FMNifs3057836 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 15 Apr 2025 15:23:54 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 53FMNifs3057836 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2025032001; t=1744755835; bh=NDEXGDBvwgzFJBq+9b4dMpRrMDJ0OHdmSuFFjdKMtPE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BS+a5pByqXEk0NISM6dE4yGOMbUT2Q2P13sgjaGlRs0JW8Wz/QSCYdXUtCkpcfWAA ayt4dlL7oMsu8Zd7EwWBSGPnD4s4g5mxTqQaH2b5ZpF54bIXjXF7EnWzybfzwqtnX1 01c1qvLCsMmgyeyu1NrtjdWDG5gyUY/lpR6VPMzx73DDD523mGrQ/i3h/6hu5V7695 a4J+ZKxAmi52fnG9pJMoupceHFxfOAr8VloP2RidtnLjOTsKvcJ7vYb4NabZG3BkhR VZg6Mn7UpBclvfPrJhLoPKNqAzLVut1qWeNuVHePuunvmt0a5bOchRyzVwATMxsAGn 9/UdnkuPQdqWQ== From: "H. Peter Anvin" To: Florian Weimer , libc-alpha@sourceware.org Cc: Andreas Schwab , "H . Peter Anvin" , "Andreas K . Huettel" , "Carlos O'Donell" , Rich Felker Subject: [PATCH v2] linux/termio: remove and struct termio Date: Tue, 15 Apr 2025 15:23:37 -0700 Message-ID: <20250415222337.1682865-1-hpa@zytor.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250327205954.1090337-1-hpa@zytor.com> References: <20250327205954.1090337-1-hpa@zytor.com> MIME-Version: 1.0 X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, DKIM_INVALID, DKIM_SIGNED, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org The interface is absolutely ancient: it was obsoleted by already in the first version of POSIX (1988) and thus predates the very first version of Linux. Unfortunately, some constant macros are used both by and ; particularly problematic is the baud rate constants since the termio interface *requires* that the baud rate is set via an enumeration as part of c_cflag. In preparation of revamping the termios interface to support the arbitrary baud rate capability that the Linux kernel has supported since 2008, remove in the hope that no one still uses this archaic interface. Note that there is no actual code in glibc to support termio: it is purely an unabstracted ioctl() interface. [ v2: remove separate struct termio definitions for mips and sparc ] Signed-off-by: H. Peter Anvin (Intel) --- NEWS | 5 ++++- sysdeps/unix/sysv/linux/Makefile | 6 ------ sysdeps/unix/sysv/linux/bits/ioctl-types.h | 11 ----------- sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h | 12 ------------ sysdeps/unix/sysv/linux/powerpc/bits/ioctl-types.h | 11 ----------- sysdeps/unix/sysv/linux/termio.h | 6 ------ 6 files changed, 4 insertions(+), 47 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/termio.h diff --git a/NEWS b/NEWS index c2a978b46077..44ecd40dc733 100644 --- a/NEWS +++ b/NEWS @@ -20,7 +20,10 @@ Major new features: Deprecated and removed features, and other changes affecting compatibility: - [Add deprecations, removals and changes affecting compatibility here] +* On Linux, the header and the definition of struct termio + in have been removed. The termio interface has been + obsolete since the very first version of POSIX.1 in 1988, replaced + with . Changes to build and runtime requirements: diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index dcd87b295e8d..ebcf820403ff 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -506,12 +506,6 @@ sysdep_headers += \ # sysdep_headers endif -ifeq ($(subdir),termios) -sysdep_headers += \ - termio.h \ - # sysdep_headers -endif - ifeq ($(subdir),posix) sysdep_headers += \ bits/initspin.h \ diff --git a/sysdeps/unix/sysv/linux/bits/ioctl-types.h b/sysdeps/unix/sysv/linux/bits/ioctl-types.h index cc2c9d7af4ba..e8e5084f1e11 100644 --- a/sysdeps/unix/sysv/linux/bits/ioctl-types.h +++ b/sysdeps/unix/sysv/linux/bits/ioctl-types.h @@ -32,17 +32,6 @@ struct winsize unsigned short int ws_ypixel; }; -#define NCC 8 -struct termio - { - unsigned short int c_iflag; /* input mode flags */ - unsigned short int c_oflag; /* output mode flags */ - unsigned short int c_cflag; /* control mode flags */ - unsigned short int c_lflag; /* local mode flags */ - unsigned char c_line; /* line discipline */ - unsigned char c_cc[NCC]; /* control characters */ -}; - /* modem lines */ #define TIOCM_LE 0x001 #define TIOCM_DTR 0x002 diff --git a/sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h b/sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h index 03ebf1edbedb..84bb6fc6ef42 100644 --- a/sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h +++ b/sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h @@ -31,18 +31,6 @@ struct winsize unsigned short int ws_ypixel; }; -#define NCC 8 -struct termio - { - unsigned short int c_iflag; /* input mode flags */ - unsigned short int c_oflag; /* output mode flags */ - unsigned short int c_cflag; /* control mode flags */ - unsigned short int c_lflag; /* local mode flags */ - char c_line; /* line discipline */ - /* Yes, this is really NCCS. */ - unsigned char c_cc[32 /* NCCS */]; /* control characters */ - }; - /* modem lines */ #define TIOCM_LE 0x001 /* line enable */ #define TIOCM_DTR 0x002 /* data terminal ready */ diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/ioctl-types.h b/sysdeps/unix/sysv/linux/powerpc/bits/ioctl-types.h index f2b360c57d73..267fa0970530 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/ioctl-types.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/ioctl-types.h @@ -32,17 +32,6 @@ struct winsize unsigned short int ws_ypixel; }; -#define NCC 10 -struct termio - { - unsigned short int c_iflag; /* input mode flags */ - unsigned short int c_oflag; /* output mode flags */ - unsigned short int c_cflag; /* control mode flags */ - unsigned short int c_lflag; /* local mode flags */ - unsigned char c_line; /* line discipline */ - unsigned char c_cc[NCC]; /* control characters */ -}; - /* modem lines */ #define TIOCM_LE 0x001 #define TIOCM_DTR 0x002 diff --git a/sysdeps/unix/sysv/linux/termio.h b/sysdeps/unix/sysv/linux/termio.h deleted file mode 100644 index 0e610f0c569c..000000000000 --- a/sysdeps/unix/sysv/linux/termio.h +++ /dev/null @@ -1,6 +0,0 @@ -/* Compatible for old `struct termio' ioctl interface. - This is obsolete; use the POSIX.1 `struct termios' interface - defined in instead. */ - -#include -#include