Remove obsolete, never-implemented XSI STREAMS declarations
diff mbox series

Message ID 87zhqi626s.fsf@oldenburg2.str.redhat.com
State New
Headers show
Series
  • Remove obsolete, never-implemented XSI STREAMS declarations
Related show

Commit Message

Florian Weimer Feb. 26, 2019, 2:42 p.m. UTC
The stub implementations are turned into compat symbols.

Linux actually has two reserved system call numbers (for getpmsg
and putpmsg), but these system calls have never been implemented,
and there are no plans to implement them, so this patch replaces
the wrappers with the generic stubs.

According to <https://bugzilla.redhat.com/show_bug.cgi?id=436349>,
the presence of the XSI STREAMS declarations is a minor portability
hazard because they are not actually implemented.

2019-02-26  Florian Weimer  <fweimer@redhat.com>

	Remove obsolete, never-implemented XSI STREAMS declarations.
	* sysdeps/posix/sysconf.c (__sysconf): Always return -1 for
	_SC_STREAMS.
	* sysdeps/unix/sysv/linux/syscalls.list (getpmsg, putpmsg): Remove.
	* sysdeps/unix/inet/Subdirs (streams): Remove.
	* posix/compat-streams.c: New file.
	* posix/Makefile (routines): Add it.
	* bits/stropts.h: Remove file.
	* bits/xtitypes.h: Likewise.
	* conform/data/stropts.h-data: Likewise.
	* include/stropts.h: Likewise.
	* include/sys/stropts.h: Likewise.
	* include/xtitypes.h: Likewise.
	* streams/Makefile: Likewise.
	* streams/fattach.c: Likewise.
	* streams/fdetach.c: Likewise.
	* streams/getmsg.c: Likewise.
	* streams/getpmsg.c: Likewise.
	* streams/isastream.c: Likewise.
	* streams/putmsg.c: Likewise.
	* streams/putpmsg.c: Likewise.
	* streams/stropts.h: Likewise.
	* streams/sys/stropts.h: Likewise.
	* sysdeps/ia64/bits/xtitypes.h: Likewise.
	* sysdeps/s390/bits/xtitypes.h: Likewise.
	* sysdeps/unix/sysv/linux/i386/getmsg.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/putmsg.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/getmsg.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/putmsg.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/getmsg.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/putmsg.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/getmsg.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/putmsg.c: Likewise.
	* sysdeps/x86/bits/xtitypes.h: Likewise.

Comments

Andreas Schwab Feb. 26, 2019, 3:04 p.m. UTC | #1
Are there plans to remove the STREAMS option from future POSIX
revisions?

Andreas.
Florian Weimer Feb. 26, 2019, 3:09 p.m. UTC | #2
* Andreas Schwab:

> Are there plans to remove the STREAMS option from future POSIX
> revisions?

I think all the interfaces are tagged OB, which is described as:

| [OB] [Option Start] Obsolescent [Option End]
|
| The functionality described may be removed in a future version of this
| volume of POSIX.1-2017. Strictly Conforming POSIX Applications and
| Strictly Conforming XSI Applications shall not use obsolescent
| features.
|
| Where applicable, the material is identified by use of the OB margin
| legend.

To me, this suggests that a plan to remove them exists.

Thanks,
Florian
Andreas Schwab Feb. 26, 2019, 3:12 p.m. UTC | #3
On Feb 26 2019, Florian Weimer <fweimer@redhat.com> wrote:

> * Andreas Schwab:
>
>> Are there plans to remove the STREAMS option from future POSIX
>> revisions?
>
> I think all the interfaces are tagged OB, which is described as:
>
> | [OB] [Option Start] Obsolescent [Option End]
> |
> | The functionality described may be removed in a future version of this
> | volume of POSIX.1-2017. Strictly Conforming POSIX Applications and
> | Strictly Conforming XSI Applications shall not use obsolescent
> | features.
> |
> | Where applicable, the material is identified by use of the OB margin
> | legend.
>
> To me, this suggests that a plan to remove them exists.

The question is, how concrete is the plan?

Andreas.
Florian Weimer Feb. 26, 2019, 3:16 p.m. UTC | #4
* Andreas Schwab:

> On Feb 26 2019, Florian Weimer <fweimer@redhat.com> wrote:
>
>> * Andreas Schwab:
>>
>>> Are there plans to remove the STREAMS option from future POSIX
>>> revisions?
>>
>> I think all the interfaces are tagged OB, which is described as:
>>
>> | [OB] [Option Start] Obsolescent [Option End]
>> |
>> | The functionality described may be removed in a future version of this
>> | volume of POSIX.1-2017. Strictly Conforming POSIX Applications and
>> | Strictly Conforming XSI Applications shall not use obsolescent
>> | features.
>> |
>> | Where applicable, the material is identified by use of the OB margin
>> | legend.
>>
>> To me, this suggests that a plan to remove them exists.
>
> The question is, how concrete is the plan?

Why do you think the plans regarding removal from POSIX matter?

We removed the gets function, which has the same OB tag, and we actually
implemented it and there was software using it.

Furthermore, I think it is confusing to ship header files for something
that we aren't actually planning to implement, ever.

Thanks,
Florian
Andreas Schwab Feb. 26, 2019, 3:19 p.m. UTC | #5
On Feb 26 2019, Florian Weimer <fweimer@redhat.com> wrote:

> * Andreas Schwab:
>
>> On Feb 26 2019, Florian Weimer <fweimer@redhat.com> wrote:
>>
>>> * Andreas Schwab:
>>>
>>>> Are there plans to remove the STREAMS option from future POSIX
>>>> revisions?
>>>
>>> I think all the interfaces are tagged OB, which is described as:
>>>
>>> | [OB] [Option Start] Obsolescent [Option End]
>>> |
>>> | The functionality described may be removed in a future version of this
>>> | volume of POSIX.1-2017. Strictly Conforming POSIX Applications and
>>> | Strictly Conforming XSI Applications shall not use obsolescent
>>> | features.
>>> |
>>> | Where applicable, the material is identified by use of the OB margin
>>> | legend.
>>>
>>> To me, this suggests that a plan to remove them exists.
>>
>> The question is, how concrete is the plan?
>
> Why do you think the plans regarding removal from POSIX matter?

Just another data point.

Andreas.
Andreas Schwab Feb. 26, 2019, 3:44 p.m. UTC | #6
On Feb 26 2019, Florian Weimer <fweimer@redhat.com> wrote:

> We removed the gets function, which has the same OB tag, and we actually
> implemented it and there was software using it.

gets is still available if you select C<11 or C++<14.

Andreas.
Zack Weinberg Feb. 26, 2019, 3:57 p.m. UTC | #7
On Tue, Feb 26, 2019 at 9:43 AM Florian Weimer <fweimer@redhat.com> wrote:
> The stub implementations are turned into compat symbols.
>
> Linux actually has two reserved system call numbers (for getpmsg
> and putpmsg), but these system calls have never been implemented,
> and there are no plans to implement them, so this patch replaces
> the wrappers with the generic stubs.
>
> According to <https://bugzilla.redhat.com/show_bug.cgi?id=436349>,
> the presence of the XSI STREAMS declarations is a minor portability
> hazard because they are not actually implemented.

I think it is reasonable to remove these never-implemented and
obsolete-in-POSIX functions.  I don't think I can unilaterally approve
this patch, though, it needs consensus.

The content of the patch looks good to me.  unistd.h already doesn't
define _XOPEN_STREAMS, and we do not have an xti.h, so the only
additional change I request is: Please search the source tree for
additional references to STREAMS, XTI, stropts.h, xti[types].h, the
types defined by stropts.h, etc. and remove them or replace them with
notes that we do not implement STREAMS, as appropriate.  For instance,
this comment in conform/Makefile should be removed and perhaps
replaced with a note that XTI and STREAMS are not implemented in glibc.

> --- a/conform/Makefile
> +++ b/conform/Makefile
> @@ -55,7 +55,7 @@ conformtest-headers-XPG4 :=
>  # XPG42 includes XTI, but xti.h is outside the scope of these tests.

zw
Florian Weimer Feb. 26, 2019, 4:51 p.m. UTC | #8
* Zack Weinberg:

> On Tue, Feb 26, 2019 at 9:43 AM Florian Weimer <fweimer@redhat.com> wrote:
>> The stub implementations are turned into compat symbols.
>>
>> Linux actually has two reserved system call numbers (for getpmsg
>> and putpmsg), but these system calls have never been implemented,
>> and there are no plans to implement them, so this patch replaces
>> the wrappers with the generic stubs.
>>
>> According to <https://bugzilla.redhat.com/show_bug.cgi?id=436349>,
>> the presence of the XSI STREAMS declarations is a minor portability
>> hazard because they are not actually implemented.
>
> I think it is reasonable to remove these never-implemented and
> obsolete-in-POSIX functions.  I don't think I can unilaterally approve
> this patch, though, it needs consensus.

No worries, I'll wait for further comments.

> The content of the patch looks good to me.  unistd.h already doesn't
> define _XOPEN_STREAMS, and we do not have an xti.h, so the only
> additional change I request is: Please search the source tree for
> additional references to STREAMS, XTI, stropts.h, xti[types].h, the
> types defined by stropts.h, etc. and remove them or replace them with
> notes that we do not implement STREAMS, as appropriate.  For instance,
> this comment in conform/Makefile should be removed and perhaps
> replaced with a note that XTI and STREAMS are not implemented in glibc.
>
>> --- a/conform/Makefile
>> +++ b/conform/Makefile
>> @@ -55,7 +55,7 @@ conformtest-headers-XPG4 :=
>>  # XPG42 includes XTI, but xti.h is outside the scope of these tests.

I see.  What about the patch below?

I removed the isastream call from the pseudo-terminal example in the
manual, too.  I did not touch the obsolete Sun RPC code and its TIRPC
support (which is different from what libtirpc does).  It is not
compatible with glibc anyway.

We do not have <stropts.h> in Fedora, so there is no I_LOOK constant and
no isastream function declaration, and I'm not aware of any problems
resulting from that.  I do not see any references to isastream which do
not use a prototype, either.  (As everyone else, we still do not build
with -Werror=implicit-function-declaration.)

Thanks,
Florian

Remove obsolete, never-implemented XSI STREAMS declarations

The stub implementations are turned into compat symbols.

Linux actually has two reserved system call numbers (for getpmsg
and putpmsg), but these system calls have never been implemented,
and there are no plans to implement them, so this patch replaces
the wrappers with the generic stubs.

According to <https://bugzilla.redhat.com/show_bug.cgi?id=436349>,
the presence of the XSI STREAMS declarations is a minor portability
hazard because they are not actually implemented.

This commit does not change the TIRPC support code in
sunrpc/rpc_svcout.c.  It uses additional XTI functionality and
therefore never worked with glibc.

2019-02-26  Florian Weimer  <fweimer@redhat.com>

	Remove obsolete, never-implemented XSI STREAMS declarations.
	* manual/terminal.texi (Allocation): Remove portability note and
	adjust example.
	* sysdeps/posix/sysconf.c (__sysconf): Always return -1 for
	_SC_STREAMS.
	* sysdeps/unix/sysv/linux/syscalls.list (getpmsg, putpmsg): Remove.
	* sysdeps/unix/inet/Subdirs (streams): Remove.
	* conform/Makefile (conformtest-headers-XPG42): Remove stropts.h.
	(conformtest-headers-UNIX98): Likewise.
	(conformtest-headers-XOPEN2K): Likewise.
	(conformtest-headers-POSIX2008): Likewise.
	* posix/compat-streams.c: New file.
	* posix/Makefile (routines): Add it.
	* bits/stropts.h: Remove file.
	* bits/xtitypes.h: Likewise.
	* conform/data/stropts.h-data: Likewise.
	* include/stropts.h: Likewise.
	* include/sys/stropts.h: Likewise.
	* include/xtitypes.h: Likewise.
	* streams/Makefile: Likewise.
	* streams/fattach.c: Likewise.
	* streams/fdetach.c: Likewise.
	* streams/getmsg.c: Likewise.
	* streams/getpmsg.c: Likewise.
	* streams/isastream.c: Likewise.
	* streams/putmsg.c: Likewise.
	* streams/putpmsg.c: Likewise.
	* streams/stropts.h: Likewise.
	* streams/sys/stropts.h: Likewise.
	* sysdeps/ia64/bits/xtitypes.h: Likewise.
	* sysdeps/s390/bits/xtitypes.h: Likewise.
	* sysdeps/unix/sysv/linux/i386/getmsg.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/putmsg.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/getmsg.c: Likewise.
	* sysdeps/unix/sysv/linux/m68k/putmsg.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/getmsg.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/putmsg.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/getmsg.c: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/putmsg.c: Likewise.
	* sysdeps/x86/bits/xtitypes.h: Likewise.

diff --git a/NEWS b/NEWS
index 0a3b6c7a5a..1e66be0d11 100644
--- a/NEWS
+++ b/NEWS
@@ -22,6 +22,9 @@ Deprecated and removed features, and other changes affecting compatibility:
   definitions in libc will be used automatically, which have been available
   since glibc 2.17.
 
+* The obsolete and never-implemented XSI STREAMS header files <stropts.h>
+  and <sys/stropts.h> have been removed.
+
 Changes to build and runtime requirements:
 
 * GCC 6.2 or later is required to build the GNU C Library.
diff --git a/bits/stropts.h b/bits/stropts.h
deleted file mode 100644
index 1e8742f3b6..0000000000
--- a/bits/stropts.h
+++ /dev/null
@@ -1,230 +0,0 @@
-/* Copyright (C) 1998-2019 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#ifndef _STROPTS_H
-# error "Never include <bits/stropts.h> directly; use <stropts.h> instead."
-#endif
-
-#ifndef _BITS_STROPTS_H
-#define _BITS_STROPTS_H	1
-
-#include <bits/types.h>
-
-/* Macros used as `request' argument to `ioctl'.  */
-#define __SID		('S' << 8)
-
-#define I_NREAD	    (__SID | 1)	/* Counts the number of data bytes in the data
-				   block in the first message.  */
-#define I_PUSH	    (__SID | 2)	/* Push STREAMS module onto top of the current
-				   STREAM, just below the STREAM head.  */
-#define I_POP	    (__SID | 3)	/* Remove STREAMS module from just below the
-				   STREAM head.  */
-#define I_LOOK	    (__SID | 4)	/* Retrieve the name of the module just below
-				   the STREAM head and place it in a character
-				   string.  */
-#define I_FLUSH	    (__SID | 5)	/* Flush all input and/or output.  */
-#define I_SRDOPT    (__SID | 6)	/* Sets the read mode.  */
-#define I_GRDOPT    (__SID | 7)	/* Returns the current read mode setting.  */
-#define I_STR	    (__SID | 8)	/* Construct an internal STREAMS `ioctl'
-				   message and send that message downstream. */
-#define I_SETSIG    (__SID | 9)	/* Inform the STREAM head that the process
-				   wants the SIGPOLL signal issued.  */
-#define I_GETSIG    (__SID |10) /* Return the events for which the calling
-				   process is currently registered to be sent
-				   a SIGPOLL signal.  */
-#define I_FIND	    (__SID |11) /* Compares the names of all modules currently
-				   present in the STREAM to the name pointed to
-				   by `arg'.  */
-#define I_LINK	    (__SID |12) /* Connect two STREAMs.  */
-#define I_UNLINK    (__SID |13) /* Disconnects the two STREAMs.  */
-#define I_PEEK	    (__SID |15) /* Allows a process to retrieve the information
-				   in the first message on the STREAM head read
-				   queue without taking the message off the
-				   queue.  */
-#define I_FDINSERT  (__SID |16) /* Create a message from the specified
-				   buffer(s), adds information about another
-				   STREAM, and send the message downstream.  */
-#define I_SENDFD    (__SID |17) /* Requests the STREAM associated with `fildes'
-				   to send a message, containing a file
-				   pointer, to the STREAM head at the other end
-				   of a STREAMS pipe.  */
-#define I_RECVFD    (__SID |14) /* Non-EFT definition.  */
-#define I_SWROPT    (__SID |19) /* Set the write mode.  */
-#define I_GWROPT    (__SID |20) /* Return the current write mode setting.  */
-#define I_LIST	    (__SID |21) /* List all the module names on the STREAM, up
-				   to and including the topmost driver name. */
-#define I_PLINK	    (__SID |22) /* Connect two STREAMs with a persistent
-				   link.  */
-#define I_PUNLINK   (__SID |23) /* Disconnect the two STREAMs that were
-				   connected with a persistent link.  */
-#define I_FLUSHBAND (__SID |28) /* Flush only band specified.  */
-#define I_CKBAND    (__SID |29) /* Check if the message of a given priority
-				   band exists on the STREAM head read
-				   queue.  */
-#define I_GETBAND   (__SID |30) /* Return the priority band of the first
-				   message on the STREAM head read queue.  */
-#define I_ATMARK    (__SID |31) /* See if the current message on the STREAM
-				   head read queue is "marked" by some module
-				   downstream.  */
-#define I_SETCLTIME (__SID |32) /* Set the time the STREAM head will delay when
-				   a STREAM is closing and there is data on
-				   the write queues.  */
-#define I_GETCLTIME (__SID |33) /* Get current value for closing timeout.  */
-#define I_CANPUT    (__SID |34) /* Check if a certain band is writable.  */
-
-
-/* Used in `I_LOOK' request.  */
-#define FMNAMESZ	8	/* compatibility w/UnixWare/Solaris.  */
-
-/* Flush options.  */
-#define FLUSHR		0x01	/* Flush read queues.  */
-#define FLUSHW		0x02	/* Flush write queues.  */
-#define FLUSHRW		0x03	/* Flush read and write queues.  */
-#ifdef __USE_GNU
-# define FLUSHBAND	0x04	/* Flush only specified band.  */
-#endif
-
-/* Possible arguments for `I_SETSIG'.  */
-#define S_INPUT		0x0001	/* A message, other than a high-priority
-				   message, has arrived.  */
-#define S_HIPRI		0x0002	/* A high-priority message is present.  */
-#define S_OUTPUT	0x0004	/* The write queue for normal data is no longer
-				   full.  */
-#define S_MSG		0x0008	/* A STREAMS signal message that contains the
-				   SIGPOLL signal reaches the front of the
-				   STREAM head read queue.  */
-#define S_ERROR		0x0010	/* Notification of an error condition.  */
-#define S_HANGUP	0x0020	/* Notification of a hangup.  */
-#define S_RDNORM	0x0040	/* A normal message has arrived.  */
-#define S_WRNORM	S_OUTPUT
-#define S_RDBAND	0x0080	/* A message with a non-zero priority has
-				   arrived.  */
-#define S_WRBAND	0x0100	/* The write queue for a non-zero priority
-				   band is no longer full.  */
-#define S_BANDURG	0x0200	/* When used in conjunction with S_RDBAND,
-				   SIGURG is generated instead of SIGPOLL when
-				   a priority message reaches the front of the
-				   STREAM head read queue.  */
-
-/* Option for `I_PEEK'.  */
-#define RS_HIPRI	0x01	/* Only look for high-priority messages.  */
-
-/* Options for `I_SRDOPT'.  */
-#define RNORM		0x0000	/* Byte-STREAM mode, the default.  */
-#define RMSGD		0x0001	/* Message-discard mode.   */
-#define RMSGN		0x0002	/* Message-nondiscard mode.   */
-#define RPROTDAT	0x0004	/* Deliver the control part of a message as
-				   data.  */
-#define RPROTDIS	0x0008	/* Discard the control part of a message,
-				   delivering any data part.  */
-#define RPROTNORM	0x0010	/* Fail `read' with EBADMSG if a message
-				   containing a control part is at the front
-				   of the STREAM head read queue.  */
-#ifdef __USE_GNU
-# define RPROTMASK	0x001C	/* The RPROT bits */
-#endif
-
-/* Possible mode for `I_SWROPT'.  */
-#define SNDZERO		0x001	/* Send a zero-length message downstream when a
-				   `write' of 0 bytes occurs.  */
-#ifdef __USE_GNU
-# define SNDPIPE	0x002	/* Send SIGPIPE on write and putmsg if
-				   sd_werror is set.  */
-#endif
-
-/* Arguments for `I_ATMARK'.  */
-#define ANYMARK		0x01	/* Check if the message is marked.  */
-#define LASTMARK	0x02	/* Check if the message is the last one marked
-				   on the queue.  */
-
-/* Argument for `I_UNLINK'.  */
-#ifdef __USE_GNU
-# define MUXID_ALL	(-1)	/* Unlink all STREAMs linked to the STREAM
-				   associated with `fildes'.  */
-#endif
-
-
-/* Macros for `getmsg', `getpmsg', `putmsg' and `putpmsg'.  */
-#define MSG_HIPRI	0x01	/* Send/receive high priority message.  */
-#define MSG_ANY		0x02	/* Receive any message.  */
-#define MSG_BAND	0x04	/* Receive message from specified band.  */
-
-/* Values returned by getmsg and getpmsg */
-#define MORECTL		1	/* More control information is left in
-				   message.  */
-#define MOREDATA	2	/* More data is left in message.  */
-
-
-/* Structure used for the I_FLUSHBAND ioctl on streams.  */
-struct bandinfo
-  {
-    unsigned char bi_pri;
-    int bi_flag;
-  };
-
-struct strbuf
-  {
-    int maxlen;		/* Maximum buffer length.  */
-    int len;		/* Length of data.  */
-    char *buf;		/* Pointer to buffer.  */
-  };
-
-struct strpeek
-  {
-    struct strbuf ctlbuf;
-    struct strbuf databuf;
-    t_uscalar_t flags;			/* UnixWare/Solaris compatibility.  */
-  };
-
-struct strfdinsert
-  {
-    struct strbuf ctlbuf;
-    struct strbuf databuf;
-    t_uscalar_t flags;			/* UnixWare/Solaris compatibility.  */
-    int fildes;
-    int offset;
-  };
-
-struct strioctl
-  {
-    int ic_cmd;
-    int ic_timout;
-    int ic_len;
-    char *ic_dp;
-  };
-
-struct strrecvfd
-  {
-    int fd;
-    uid_t uid;
-    gid_t gid;
-    char __fill[8];			/* UnixWare/Solaris compatibility */
-  };
-
-
-struct str_mlist
-  {
-    char l_name[FMNAMESZ + 1];
-  };
-
-struct str_list
-  {
-    int sl_nmods;
-    struct str_mlist *sl_modlist;
-  };
-
-#endif /* bits/stropts.h */
diff --git a/bits/xtitypes.h b/bits/xtitypes.h
deleted file mode 100644
index 92c8bca888..0000000000
--- a/bits/xtitypes.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* bits/xtitypes.h -- Define some types used by <bits/stropts.h>.  Generic.
-   Copyright (C) 2002-2019 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#ifndef _STROPTS_H
-# error "Never include <bits/xtitypes.h> directly; use <stropts.h> instead."
-#endif
-
-#ifndef _BITS_XTITYPES_H
-#define _BITS_XTITYPES_H	1
-
-#include <bits/types.h>
-
-/* This type is used by some structs in <bits/stropts.h>.  */
-typedef __SLONGWORD_TYPE __t_scalar_t;
-typedef __ULONGWORD_TYPE __t_uscalar_t;
-
-
-#endif /* bits/xtitypes.h */
diff --git a/conform/Makefile b/conform/Makefile
index 77709b86b9..59d569c4c5 100644
--- a/conform/Makefile
+++ b/conform/Makefile
@@ -52,44 +52,44 @@ conformtest-headers-XPG4 := $(conformtest-headers-ISO) cpio.h dirent.h \
 			    sys/wait.h tar.h termios.h ulimit.h unistd.h \
 			    utime.h varargs.h wordexp.h
 # Missing XPG42 expectations for: re_comp.h regexp.h wchar.h.
-# XPG42 includes XTI, but xti.h is outside the scope of these tests.
+# XPG42 includes XTI and STREAMS, but those are not implemented by glibc.
 conformtest-headers-XPG42 := $(conformtest-headers-XPG4) arpa/inet.h fmtmsg.h \
 			    libgen.h ndbm.h netdb.h netinet/in.h poll.h \
-			    strings.h stropts.h sys/mman.h sys/resource.h \
+			    strings.h sys/mman.h sys/resource.h \
 			    sys/socket.h sys/statvfs.h sys/time.h sys/timeb.h \
 			    sys/uio.h sys/un.h syslog.h ucontext.h utmpx.h
 # Missing UNIX98 expectations for: inttypes.h re_comp.h regexp.h.
 # The online UNIX98 includes XCURSES, but curses.h, term.h and
 # unctrl.h are outside the scope of these tests.  It also includes
-# XTI, but xti.h is outside the scope of these tests.
+# XTI and STREAMS, but those are not implemented by glibc.
 conformtest-headers-UNIX98 := $(conformtest-headers-POSIX) arpa/inet.h cpio.h \
 			      dlfcn.h fmtmsg.h ftw.h iconv.h iso646.h \
 			      langinfo.h libgen.h monetary.h ndbm.h netdb.h \
 			      netinet/in.h nl_types.h poll.h search.h \
-			      strings.h stropts.h sys/ipc.h sys/msg.h \
+			      strings.h sys/ipc.h sys/msg.h \
 			      sys/resource.h sys/sem.h sys/shm.h sys/socket.h \
 			      sys/statvfs.h sys/time.h sys/timeb.h sys/uio.h \
 			      sys/un.h syslog.h ucontext.h ulimit.h utmpx.h \
 			      varargs.h wchar.h wctype.h
-# Missing XOPEN2K expectations for: trace.h.
+# Missing XOPEN2K expectations for: trace.h, stropts.h.
 conformtest-headers-XOPEN2K := $(conformtest-headers-POSIX) arpa/inet.h \
 			       complex.h cpio.h dlfcn.h fenv.h fmtmsg.h ftw.h \
 			       iconv.h inttypes.h iso646.h langinfo.h \
 			       libgen.h monetary.h ndbm.h net/if.h netdb.h \
 			       netinet/in.h netinet/tcp.h nl_types.h poll.h \
 			       search.h spawn.h stdbool.h stdint.h strings.h \
-			       stropts.h sys/ipc.h sys/msg.h sys/resource.h \
+			       sys/ipc.h sys/msg.h sys/resource.h \
 			       sys/select.h sys/sem.h sys/shm.h sys/socket.h \
 			       sys/statvfs.h sys/time.h sys/timeb.h sys/uio.h \
 			       sys/un.h syslog.h tgmath.h ucontext.h ulimit.h \
 			       utmpx.h wchar.h wctype.h
-# Missing POSIX2008 expectations for: trace.h.
+# Missing POSIX2008 expectations for: trace.h, stropts.h.
 conformtest-headers-POSIX2008 := $(conformtest-headers-POSIX) arpa/inet.h \
 				 complex.h cpio.h dlfcn.h fenv.h iconv.h \
 				 inttypes.h iso646.h langinfo.h monetary.h \
 				 net/if.h netdb.h netinet/in.h netinet/tcp.h \
 				 nl_types.h poll.h spawn.h stdbool.h stdint.h \
-				 strings.h stropts.h sys/select.h \
+				 strings.h sys/select.h \
 				 sys/socket.h sys/statvfs.h sys/un.h tgmath.h \
 				 wchar.h wctype.h
 # Missing XOPEN2K8 expectations for: trace.h.
diff --git a/conform/data/stropts.h-data b/conform/data/stropts.h-data
deleted file mode 100644
index c4b1343411..0000000000
--- a/conform/data/stropts.h-data
+++ /dev/null
@@ -1,140 +0,0 @@
-#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined XPG4
-type {struct bandinfo}
-
-element {struct bandinfo} {unsigned char} bi_pri
-element {struct bandinfo} int bi_flag
-
-type {struct strpeek}
-
-element {struct strpeek} {struct strbuf} ctlbuf
-element {struct strpeek} {struct strbuf} databuf
-element {struct strpeek} t_uscalar_t flags
-
-type {struct strbuf}
-
-element {struct strbuf} int maxlen
-element {struct strbuf} int len
-element {struct strbuf} {char*} buf
-
-type {struct strfdinsert}
-
-element {struct strfdinsert} {struct strbuf} ctlbuf
-element {struct strfdinsert} {struct strbuf} databuf
-element {struct strfdinsert} t_uscalar_t flags
-element {struct strfdinsert} int fildes
-element {struct strfdinsert} int offset
-
-type {struct strioctl}
-
-element {struct strioctl} int ic_cmd
-element {struct strioctl} int ic_timout
-element {struct strioctl} int ic_len
-element {struct strioctl} {char*} ic_dp
-
-type {struct strrecvfd}
-
-element {struct strrecvfd} int fd
-element {struct strrecvfd} uid_t uid
-element {struct strrecvfd} gid_t gid
-
-type uid_t
-type gid_t
-
-type t_uscalar_t
-
-type {struct str_list}
-
-element {struct str_list} int sl_nmods
-element {struct str_list} {struct str_mlist*} sl_modlist
-
-type {struct str_mlist}
-
-element {struct str_mlist} char l_name [FMNAMESZ+1]
-
-macro I_PUSH
-macro I_POP
-macro I_LOOK
-macro FMNAMESZ
-macro I_FLUSH
-macro FLUSHR
-macro FLUSHW
-macro FLUSHRW
-macro I_FLUSHBAND
-macro I_SETSIG
-macro S_RDNORM
-macro S_RDBAND
-macro S_INPUT
-macro S_HIPRI
-macro S_OUTPUT
-macro S_WRNORM
-macro S_WRBAND
-macro S_MSG
-macro S_ERROR
-macro S_HANGUP
-macro S_BANDURG
-macro I_GETSIG
-macro I_FIND
-macro I_PEEK
-macro RS_HIPRI
-macro I_SRDOPT
-macro RNORM
-macro RMSGD
-macro RMSGN
-macro RPROTNORM
-macro RPROTDAT
-macro RPROTDIS
-macro I_GRDOPT
-macro I_NREAD
-macro I_FDINSERT
-macro I_STR
-macro I_SWROPT
-macro SNDZERO
-macro I_GWROPT
-macro I_SENDFD
-macro I_RECVFD
-macro I_LIST
-macro I_ATMARK
-macro ANYMARK
-macro LASTMARK
-macro I_CKBAND
-macro I_GETBAND
-macro I_CANPUT
-macro I_SETCLTIME
-macro I_GETCLTIME
-macro I_LINK
-macro I_UNLINK
-macro I_PLINK
-macro I_PUNLINK
-
-macro MSG_ANY
-macro MSG_BAND
-macro MSG_HIPRI
-macro MORECTL
-macro MOREDATA
-
-function int isastream (int)
-function int getmsg (int, struct strbuf*, struct strbuf*, int*)
-function int getpmsg (int, struct strbuf*, struct strbuf*, int*, int*)
-// Bug 14362: wrong type for ioctl.
-xfail-function int ioctl (int, int, ...)
-function int putmsg (int, const struct strbuf*, const struct strbuf*, int)
-function int putpmsg (int, const struct strbuf*, const struct strbuf*, int, int)
-function int fattach (int, const char*)
-function int fdetach (const char*)
-
-allow-header unistd.h
-
-allow bi_*
-allow ic_*
-allow l_*
-allow sl_*
-allow str_*
-allow FLUSH*
-allow I_*
-allow M_*
-allow MUXID_R*
-allow S_*
-allow SND*
-allow STR*
-allow *_t
-#endif
diff --git a/include/stropts.h b/include/stropts.h
deleted file mode 100644
index 27ab60ac7f..0000000000
--- a/include/stropts.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <streams/stropts.h>
diff --git a/include/sys/stropts.h b/include/sys/stropts.h
deleted file mode 100644
index 711f1502dd..0000000000
--- a/include/sys/stropts.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <streams/sys/stropts.h>
diff --git a/manual/terminal.texi b/manual/terminal.texi
index d830baacd7..7293bfb393 100644
--- a/manual/terminal.texi
+++ b/manual/terminal.texi
@@ -2117,12 +2117,6 @@ at @var{buf} with length @var{len}.
 This function is a GNU extension.
 @end deftypefun
 
-@strong{Portability Note:} On @w{System V} derived systems, the file
-returned by the @code{ptsname} and @code{ptsname_r} functions may be
-STREAMS-based, and therefore require additional processing after opening
-before it actually behaves as a pseudo terminal.
-@c FIXME: xref STREAMS
-
 Typical usage of these functions is illustrated by the following example:
 @smallexample
 int
@@ -2145,13 +2139,6 @@ open_pty_pair (int *amaster, int *aslave)
   if (slave == -1)
     goto close_master;
 
-  if (isastream (slave))
-    @{
-      if (ioctl (slave, I_PUSH, "ptem") < 0
-          || ioctl (slave, I_PUSH, "ldterm") < 0)
-        goto close_slave;
-    @}
-
   *amaster = master;
   *aslave = slave;
   return 1;
diff --git a/posix/Makefile b/posix/Makefile
index 93c3a290d7..8ac6743ad7 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -64,7 +64,8 @@ routines :=								      \
 	spawnattr_getsigmask spawnattr_getschedpolicy spawnattr_getschedparam \
 	spawnattr_setsigmask spawnattr_setschedpolicy spawnattr_setschedparam \
 	posix_madvise							      \
-	get_child_max sched_cpucount sched_cpualloc sched_cpufree
+	get_child_max sched_cpucount sched_cpualloc sched_cpufree \
+	streams-compat
 
 aux		:= init-posix environ
 tests		:= test-errno tstgetopt testfnm runtests runptests \
diff --git a/posix/streams-compat.c b/posix/streams-compat.c
new file mode 100644
index 0000000000..30e9b5743a
--- /dev/null
+++ b/posix/streams-compat.c
@@ -0,0 +1,101 @@
+/* Compatibility symbols for the unimplemented XSI STREAMS extension.
+   Copyright (C) 1998-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <shlib-compat.h>
+
+#if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_30)
+
+# include <errno.h>
+# include <fcntl.h>
+
+struct strbuf;
+
+int
+attribute_compat_text_section
+fattach (int fildes, const char *path)
+{
+  __set_errno (ENOSYS);
+  return -1;
+}
+compat_symbol (libc, fattach, fattach, GLIBC_2_1);
+
+int
+attribute_compat_text_section
+fdetach (const char *path)
+{
+  __set_errno (ENOSYS);
+  return -1;
+}
+compat_symbol (libc, fdetach, fdetach, GLIBC_2_1);
+
+
+int
+attribute_compat_text_section
+getmsg (int fildes, struct strbuf *ctlptr, struct strbuf *dataptr, int *flagsp)
+{
+  __set_errno (ENOSYS);
+  return -1;
+}
+compat_symbol (libc, getmsg, getmsg, GLIBC_2_1);
+
+int
+attribute_compat_text_section
+getpmsg (int fildes, struct strbuf *ctlptr, struct strbuf *dataptr, int *bandp,
+	 int *flagsp)
+{
+  __set_errno (ENOSYS);
+  return -1;
+}
+compat_symbol (libc, getpmsg, getpmsg, GLIBC_2_1);
+
+int
+attribute_compat_text_section
+isastream (int fildes)
+{
+  /* In general we do not have a STREAMS implementation and therefore
+     return 0.  But for invalid file descriptors we have to return an
+     error.  */
+  if (__fcntl (fildes, F_GETFD) < 0)
+    return -1;
+
+  /* No STREAM.  */
+  return 0;
+}
+compat_symbol (libc, isastream, isastream, GLIBC_2_1);
+
+int
+attribute_compat_text_section
+putmsg (int fildes, const struct strbuf *ctlptr, const struct strbuf *dataptr,
+	int flags)
+{
+  __set_errno (ENOSYS);
+  return -1;
+}
+compat_symbol (libc, putmsg, putmsg, GLIBC_2_1);
+
+int
+attribute_compat_text_section
+putpmsg (int fildes, const struct strbuf *ctlptr, const struct strbuf *dataptr,
+	 int band, int flags)
+{
+  __set_errno (ENOSYS);
+  return -1;
+}
+compat_symbol (libc, putpmsg, putpmsg, GLIBC_2_1);
+
+#endif /* SHLIB_COMPAT */
diff --git a/streams/Makefile b/streams/Makefile
deleted file mode 100644
index 916147f382..0000000000
--- a/streams/Makefile
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright (C) 1998-2019 Free Software Foundation, Inc.
-# This file is part of the GNU C Library.
-
-# The GNU C Library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-
-# The GNU C Library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-
-# You should have received a copy of the GNU Lesser General Public
-# License along with the GNU C Library; if not, see
-# <http://www.gnu.org/licenses/>.
-
-#
-#	Makefile for streams.
-#
-subdir	:= streams
-
-include ../Makeconfig
-
-headers		= stropts.h sys/stropts.h bits/stropts.h bits/xtitypes.h
-routines	= isastream getmsg getpmsg putmsg putpmsg fattach fdetach
-
-include ../Rules
diff --git a/streams/Versions b/streams/Versions
deleted file mode 100644
index 9a6f4d756c..0000000000
--- a/streams/Versions
+++ /dev/null
@@ -1,15 +0,0 @@
-libc {
-  GLIBC_2.1 {
-    # f*
-    fattach; fdetach;
-
-    # g*
-    getmsg; getpmsg;
-
-    # i*
-    isastream;
-
-    # p*
-    putmsg; putpmsg;
-  }
-}
diff --git a/streams/fattach.c b/streams/fattach.c
deleted file mode 100644
index 8ab904653a..0000000000
--- a/streams/fattach.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Copyright (C) 1998-2019 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <errno.h>
-#include <stropts.h>
-
-int
-fattach (int fildes, const char *path)
-{
-  __set_errno (ENOSYS);
-  return -1;
-}
-
-
-stub_warning (fattach)
diff --git a/streams/fdetach.c b/streams/fdetach.c
deleted file mode 100644
index 2016b6699a..0000000000
--- a/streams/fdetach.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Copyright (C) 1998-2019 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <errno.h>
-#include <stropts.h>
-
-int
-fdetach (const char *path)
-{
-  __set_errno (ENOSYS);
-  return -1;
-}
-
-
-stub_warning (fdetach)
diff --git a/streams/getmsg.c b/streams/getmsg.c
deleted file mode 100644
index 93bc0ddaf7..0000000000
--- a/streams/getmsg.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Copyright (C) 1998-2019 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <errno.h>
-#include <stropts.h>
-
-int
-getmsg (int fildes, struct strbuf *ctlptr, struct strbuf *dataptr, int *flagsp)
-{
-  __set_errno (ENOSYS);
-  return -1;
-}
-
-
-stub_warning (getmsg)
diff --git a/streams/getpmsg.c b/streams/getpmsg.c
deleted file mode 100644
index b3912d38ab..0000000000
--- a/streams/getpmsg.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Copyright (C) 1998-2019 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <errno.h>
-#include <stropts.h>
-
-int
-getpmsg (int fildes, struct strbuf *ctlptr, struct strbuf *dataptr, int *bandp,
-	 int *flagsp)
-{
-  __set_errno (ENOSYS);
-  return -1;
-}
-
-
-stub_warning (getpmsg)
diff --git a/streams/isastream.c b/streams/isastream.c
deleted file mode 100644
index 328b355c47..0000000000
--- a/streams/isastream.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Copyright (C) 1998-2019 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <stropts.h>
-
-int
-isastream (int fildes)
-{
-  /* In general we do not have a STREAMS implementation and therefore
-     return 0.  But for invalid file descriptors we have to return an
-     error.  */
-  if (__fcntl (fildes, F_GETFD) < 0)
-    return -1;
-
-  /* No STREAM.  */
-  return 0;
-}
diff --git a/streams/putmsg.c b/streams/putmsg.c
deleted file mode 100644
index f6383b153a..0000000000
--- a/streams/putmsg.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Copyright (C) 1998-2019 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <errno.h>
-#include <stropts.h>
-
-int
-putmsg (int fildes, const struct strbuf *ctlptr, const struct strbuf *dataptr,
-	int flags)
-{
-  __set_errno (ENOSYS);
-  return -1;
-}
-
-
-stub_warning (putmsg)
diff --git a/streams/putpmsg.c b/streams/putpmsg.c
deleted file mode 100644
index fac3d22c5d..0000000000
--- a/streams/putpmsg.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Copyright (C) 1998-2019 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <errno.h>
-#include <stropts.h>
-
-int
-putpmsg (int fildes, const struct strbuf *ctlptr, const struct strbuf *dataptr,
-	 int band, int flags)
-{
-  __set_errno (ENOSYS);
-  return -1;
-}
-
-
-stub_warning (putpmsg)
diff --git a/streams/stropts.h b/streams/stropts.h
deleted file mode 100644
index 97b9428ee8..0000000000
--- a/streams/stropts.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/* Copyright (C) 1998-2019 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#ifndef _STROPTS_H
-#define _STROPTS_H	1
-
-#include <features.h>
-#include <bits/types.h>
-#include <bits/xtitypes.h>
-
-#ifndef __gid_t_defined
-typedef __gid_t gid_t;
-# define __gid_t_defined
-#endif
-
-#ifndef __uid_t_defined
-typedef __uid_t uid_t;
-# define __uid_t_defined
-#endif
-
-typedef __t_scalar_t t_scalar_t;
-typedef __t_uscalar_t t_uscalar_t;
-
-/* Get system specific constants.  */
-#include <bits/stropts.h>
-
-
-__BEGIN_DECLS
-
-/* Test whether FILDES is associated with a STREAM-based file.  */
-extern int isastream (int __fildes) __THROW;
-
-/* Receive next message from a STREAMS file.
-
-   This function is a cancellation point and therefore not marked with
-   __THROW.  */
-extern int getmsg (int __fildes, struct strbuf *__restrict __ctlptr,
-		   struct strbuf *__restrict __dataptr,
-		   int *__restrict __flagsp);
-
-/* Receive next message from a STREAMS file, with *FLAGSP allowing to
-   control which message.
-
-   This function is a cancellation point and therefore not marked with
-   __THROW.  */
-extern int getpmsg (int __fildes, struct strbuf *__restrict __ctlptr,
-		    struct strbuf *__restrict __dataptr,
-		    int *__restrict __bandp, int *__restrict __flagsp);
-
-/* Perform the I/O control operation specified by REQUEST on FD.
-   One argument may follow; its presence and type depend on REQUEST.
-   Return value depends on REQUEST.  Usually -1 indicates error.  */
-extern int ioctl (int __fd, unsigned long int __request, ...) __THROW;
-
-/* Send a message on a STREAM.
-
-   This function is a cancellation point and therefore not marked with
-   __THROW.  */
-extern int putmsg (int __fildes, const struct strbuf *__ctlptr,
-		   const struct strbuf *__dataptr, int __flags);
-
-/* Send a message on a STREAM to the BAND.
-
-   This function is a cancellation point and therefore not marked with
-   __THROW.  */
-extern int putpmsg (int __fildes, const struct strbuf *__ctlptr,
-		    const struct strbuf *__dataptr, int __band, int __flags);
-
-/* Attach a STREAMS-based file descriptor FILDES to a file PATH in the
-   file system name space.  */
-extern int fattach (int __fildes, const char *__path) __THROW;
-
-/* Detach a name PATH from a STREAMS-based file descriptor.  */
-extern int fdetach (const char *__path) __THROW;
-
-__END_DECLS
-
-#endif /* stropts.h */
diff --git a/streams/sys/stropts.h b/streams/sys/stropts.h
deleted file mode 100644
index 5b5bc02f40..0000000000
--- a/streams/sys/stropts.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <stropts.h>
diff --git a/sysdeps/ia64/bits/xtitypes.h b/sysdeps/ia64/bits/xtitypes.h
deleted file mode 100644
index f5d5f49c52..0000000000
--- a/sysdeps/ia64/bits/xtitypes.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* bits/xtitypes.h -- Define some types used by <bits/stropts.h>.  IA64
-   Copyright (C) 2002-2019 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#ifndef _STROPTS_H
-# error "Never include <bits/xtitypes.h> directly; use <stropts.h> instead."
-#endif
-
-#ifndef _BITS_XTITYPES_H
-#define _BITS_XTITYPES_H	1
-
-#include <bits/types.h>
-
-/* This type is used by some structs in <bits/stropts.h>.  */
-typedef __S32_TYPE __t_scalar_t;
-typedef __U32_TYPE __t_uscalar_t;
-
-
-#endif /* bits/xtitypes.h */
diff --git a/sysdeps/posix/sysconf.c b/sysdeps/posix/sysconf.c
index c1929b312f..0c4f9432e8 100644
--- a/sysdeps/posix/sysconf.c
+++ b/sysdeps/posix/sysconf.c
@@ -1116,11 +1116,7 @@ __sysconf (int name)
 #endif
 
     case _SC_STREAMS:
-#ifdef _XOPEN_STREAMS
-      return _XOPEN_STREAMS;
-#else
       return -1;
-#endif
 
     case _SC_HOST_NAME_MAX:
 #ifdef HOST_NAME_MAX
diff --git a/sysdeps/s390/bits/xtitypes.h b/sysdeps/s390/bits/xtitypes.h
deleted file mode 100644
index 2f207845d9..0000000000
--- a/sysdeps/s390/bits/xtitypes.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* bits/xtitypes.h -- Define some types used by <bits/stropts.h>.  S390/S390x
-   Copyright (C) 2002-2019 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#ifndef _STROPTS_H
-# error "Never include <bits/xtitypes.h> directly; use <stropts.h> instead."
-#endif
-
-#ifndef _BITS_XTITYPES_H
-#define _BITS_XTITYPES_H	1
-
-#include <bits/types.h>
-
-/* This type is used by some structs in <bits/stropts.h>.  */
-typedef __S32_TYPE __t_scalar_t;
-typedef __U32_TYPE __t_uscalar_t;
-
-
-#endif /* bits/xtitypes.h */
diff --git a/sysdeps/unix/inet/Subdirs b/sysdeps/unix/inet/Subdirs
index 0a02dd4447..90791e6e07 100644
--- a/sysdeps/unix/inet/Subdirs
+++ b/sysdeps/unix/inet/Subdirs
@@ -5,4 +5,3 @@ sunrpc
 nis
 nscd
 nss
-streams
diff --git a/sysdeps/unix/sysv/linux/i386/getmsg.c b/sysdeps/unix/sysv/linux/i386/getmsg.c
deleted file mode 100644
index 90a2788feb..0000000000
--- a/sysdeps/unix/sysv/linux/i386/getmsg.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Copyright (C) 1998-2019 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <errno.h>
-#include <stddef.h>
-#include <stropts.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-
-#ifdef __NR_getpmsg
-int
-getmsg (int fildes, struct strbuf *ctlptr, struct strbuf *dataptr, int *flagsp)
-{
-  return INLINE_SYSCALL (getpmsg, 5, fildes, ctlptr, dataptr, NULL, flagsp);
-}
-#else
-# include <streams/getmsg.c>
-#endif
diff --git a/sysdeps/unix/sysv/linux/i386/putmsg.c b/sysdeps/unix/sysv/linux/i386/putmsg.c
deleted file mode 100644
index f1476cc89e..0000000000
--- a/sysdeps/unix/sysv/linux/i386/putmsg.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Copyright (C) 1998-2019 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <errno.h>
-#include <stddef.h>
-#include <stropts.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-
-#ifdef __NR_putpmsg
-int
-putmsg (int fildes, const struct strbuf *ctlptr, const struct strbuf *dataptr,
-	int flags)
-{
-  return INLINE_SYSCALL (putpmsg, 5, fildes, ctlptr, dataptr, -1, flags);
-}
-#else
-# include <streams/putmsg.c>
-#endif
diff --git a/sysdeps/unix/sysv/linux/m68k/getmsg.c b/sysdeps/unix/sysv/linux/m68k/getmsg.c
deleted file mode 100644
index 3a1fa08525..0000000000
--- a/sysdeps/unix/sysv/linux/m68k/getmsg.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/getmsg.c>
diff --git a/sysdeps/unix/sysv/linux/m68k/putmsg.c b/sysdeps/unix/sysv/linux/m68k/putmsg.c
deleted file mode 100644
index ebc1680ca7..0000000000
--- a/sysdeps/unix/sysv/linux/m68k/putmsg.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/putmsg.c>
diff --git a/sysdeps/unix/sysv/linux/mips/getmsg.c b/sysdeps/unix/sysv/linux/mips/getmsg.c
deleted file mode 100644
index 3a1fa08525..0000000000
--- a/sysdeps/unix/sysv/linux/mips/getmsg.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/getmsg.c>
diff --git a/sysdeps/unix/sysv/linux/mips/putmsg.c b/sysdeps/unix/sysv/linux/mips/putmsg.c
deleted file mode 100644
index ebc1680ca7..0000000000
--- a/sysdeps/unix/sysv/linux/mips/putmsg.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/putmsg.c>
diff --git a/sysdeps/unix/sysv/linux/powerpc/getmsg.c b/sysdeps/unix/sysv/linux/powerpc/getmsg.c
deleted file mode 100644
index 3a1fa08525..0000000000
--- a/sysdeps/unix/sysv/linux/powerpc/getmsg.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/getmsg.c>
diff --git a/sysdeps/unix/sysv/linux/powerpc/putmsg.c b/sysdeps/unix/sysv/linux/powerpc/putmsg.c
deleted file mode 100644
index ebc1680ca7..0000000000
--- a/sysdeps/unix/sysv/linux/powerpc/putmsg.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <sysdeps/unix/sysv/linux/i386/putmsg.c>
diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list
index 544ab5d54a..25424e1399 100644
--- a/sysdeps/unix/sysv/linux/syscalls.list
+++ b/sysdeps/unix/sysv/linux/syscalls.list
@@ -20,7 +20,6 @@ getegid		-	getegid		Ei:	__getegid	getegid
 geteuid		-	geteuid		Ei:	__geteuid	geteuid
 getpgid		-	getpgid		i:i	__getpgid	getpgid
 getpgrp		-	getpgrp		Ei:	getpgrp
-getpmsg		-	getpmsg		i:ipppp	getpmsg
 getppid		-	getppid		Ei:	__getppid	getppid
 getresuid	-	getresuid	i:ppp	getresuid
 getresgid	-	getresgid	i:ppp	getresgid
@@ -46,7 +45,6 @@ pipe		-	pipe		i:f	__pipe		pipe
 pipe2		-	pipe2		i:fi	__pipe2		pipe2
 pivot_root	EXTRA	pivot_root	i:ss	pivot_root
 prctl		EXTRA	prctl		i:iiiii	__prctl		prctl
-putpmsg		-	putpmsg		i:ippii	putpmsg
 query_module	EXTRA	query_module	i:sipip	__compat_query_module	query_module@GLIBC_2.0:GLIBC_2.23
 quotactl	EXTRA	quotactl	i:isip	quotactl
 remap_file_pages -	remap_file_pages i:piiii	__remap_file_pages remap_file_pages
diff --git a/sysdeps/x86/bits/xtitypes.h b/sysdeps/x86/bits/xtitypes.h
deleted file mode 100644
index 4d045415a8..0000000000
--- a/sysdeps/x86/bits/xtitypes.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* bits/xtitypes.h -- Define some types used by <bits/stropts.h>.  x86-64.
-   Copyright (C) 2002-2019 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#ifndef _STROPTS_H
-# error "Never include <bits/xtitypes.h> directly; use <stropts.h> instead."
-#endif
-
-#ifndef _BITS_XTITYPES_H
-#define _BITS_XTITYPES_H	1
-
-#include <bits/types.h>
-
-/* This type is used by some structs in <bits/stropts.h>.  */
-typedef __SLONG32_TYPE __t_scalar_t;
-typedef __ULONG32_TYPE __t_uscalar_t;
-
-
-#endif /* bits/xtitypes.h */
Zack Weinberg Feb. 26, 2019, 7:33 p.m. UTC | #9
On Tue, Feb 26, 2019 at 11:51 AM Florian Weimer <fweimer@redhat.com> wrote:
> * Zack Weinberg:
>
> > Please search the source tree for
> > additional references to STREAMS, XTI, stropts.h, xti[types].h, the
> > types defined by stropts.h, etc. and remove them or replace them with
> > notes that we do not implement STREAMS, as appropriate.
>
> I see.  What about the patch below?

Seems reasonable (I didn't do a search for more references myself)

> I removed the isastream call from the pseudo-terminal example in the
> manual, too.

Yeah, this also seems fine.  The only reason to keep this around would
be if some current Unix still needed it, and if that were the case
POSIX probably wouldn't have obsolesced STREAMS.  (Does anyone know
for sure?)

zw
Stan Shebs Feb. 26, 2019, 8:13 p.m. UTC | #10
On Tue, Feb 26, 2019 at 1:33 PM Zack Weinberg <zackw@panix.com> wrote:
>
> On Tue, Feb 26, 2019 at 11:51 AM Florian Weimer <fweimer@redhat.com> wrote:
> > * Zack Weinberg:
> >
> > > Please search the source tree for
> > > additional references to STREAMS, XTI, stropts.h, xti[types].h, the
> > > types defined by stropts.h, etc. and remove them or replace them with
> > > notes that we do not implement STREAMS, as appropriate.
> >
> > I see.  What about the patch below?
>
> Seems reasonable (I didn't do a search for more references myself)
>
> > I removed the isastream call from the pseudo-terminal example in the
> > manual, too.
>
> Yeah, this also seems fine.  The only reason to keep this around would
> be if some current Unix still needed it, and if that were the case
> POSIX probably wouldn't have obsolesced STREAMS.  (Does anyone know
> for sure?)

Searching in Google's mega-monorepo-o-gigantude, I see just 46
references to isastream(),
all in glibc sources/headers except for a call in the ancient X11 file
Xtranslcl.c.

getpmsg() has 100-odd appearances outside of glibc sources, but no
actual calls to it;
the references seem to all be in different flavors of
semi-mechanically-generated
whitelisting, auditing, and analysis code.

Stan
Florian Weimer March 5, 2019, 10:54 a.m. UTC | #11
* Florian Weimer:

> 2019-02-26  Florian Weimer  <fweimer@redhat.com>
>
> 	Remove obsolete, never-implemented XSI STREAMS declarations.
> 	* manual/terminal.texi (Allocation): Remove portability note and
> 	adjust example.
> 	* sysdeps/posix/sysconf.c (__sysconf): Always return -1 for
> 	_SC_STREAMS.
> 	* sysdeps/unix/sysv/linux/syscalls.list (getpmsg, putpmsg): Remove.
> 	* sysdeps/unix/inet/Subdirs (streams): Remove.
> 	* conform/Makefile (conformtest-headers-XPG42): Remove stropts.h.
> 	(conformtest-headers-UNIX98): Likewise.
> 	(conformtest-headers-XOPEN2K): Likewise.
> 	(conformtest-headers-POSIX2008): Likewise.
> 	* posix/compat-streams.c: New file.
> 	* posix/Makefile (routines): Add it.
> 	* bits/stropts.h: Remove file.
> 	* bits/xtitypes.h: Likewise.
>	* conform/data/stropts.h-data: Likewise.
>	* include/stropts.h: Likewise.
>	* include/sys/stropts.h: Likewise.

Any further comments on this patch?

  <https://sourceware.org/ml/libc-alpha/2019-02/msg00607.html>

Joseph, do you agree with the patch and the conform/ changes?

Thanks,
Florian
Joseph Myers March 6, 2019, 9:11 p.m. UTC | #12
On Tue, 5 Mar 2019, Florian Weimer wrote:

> Any further comments on this patch?
> 
>   <https://sourceware.org/ml/libc-alpha/2019-02/msg00607.html>
> 
> Joseph, do you agree with the patch and the conform/ changes?

I believe the conform/ changes reflect how we commonly handle optional 
POSIX features in those baselines.  I have not reviewed the patch.
Carlos O'Donell March 13, 2019, 9:47 p.m. UTC | #13
On 2/26/19 11:51 AM, Florian Weimer wrote:
> * Zack Weinberg:
> 
>> On Tue, Feb 26, 2019 at 9:43 AM Florian Weimer <fweimer@redhat.com> wrote:
>>> The stub implementations are turned into compat symbols.
>>>
>>> Linux actually has two reserved system call numbers (for getpmsg
>>> and putpmsg), but these system calls have never been implemented,
>>> and there are no plans to implement them, so this patch replaces
>>> the wrappers with the generic stubs.
>>>
>>> According to <https://bugzilla.redhat.com/show_bug.cgi?id=436349>,
>>> the presence of the XSI STREAMS declarations is a minor portability
>>> hazard because they are not actually implemented.
>>
>> I think it is reasonable to remove these never-implemented and
>> obsolete-in-POSIX functions.  I don't think I can unilaterally approve
>> this patch, though, it needs consensus.
> 
> No worries, I'll wait for further comments.

I think this is good. Review below. I've looked at doing this twice in
the past based on the Fedora patch, but never got to consensus around
how to make the change.

>> The content of the patch looks good to me.  unistd.h already doesn't
>> define _XOPEN_STREAMS, and we do not have an xti.h, so the only
>> additional change I request is: Please search the source tree for
>> additional references to STREAMS, XTI, stropts.h, xti[types].h, the
>> types defined by stropts.h, etc. and remove them or replace them with
>> notes that we do not implement STREAMS, as appropriate.  For instance,
>> this comment in conform/Makefile should be removed and perhaps
>> replaced with a note that XTI and STREAMS are not implemented in glibc.
>>
>>> --- a/conform/Makefile
>>> +++ b/conform/Makefile
>>> @@ -55,7 +55,7 @@ conformtest-headers-XPG4 :=
>>>  # XPG42 includes XTI, but xti.h is outside the scope of these tests.
> 
> I see.  What about the patch below?
> 
> I removed the isastream call from the pseudo-terminal example in the
> manual, too.  I did not touch the obsolete Sun RPC code and its TIRPC
> support (which is different from what libtirpc does).  It is not
> compatible with glibc anyway.
> 
> We do not have <stropts.h> in Fedora, so there is no I_LOOK constant and
> no isastream function declaration, and I'm not aware of any problems
> resulting from that.  I do not see any references to isastream which do
> not use a prototype, either.  (As everyone else, we still do not build
> with -Werror=implicit-function-declaration.)
> 
> Thanks,
> Florian
> 
> Remove obsolete, never-implemented XSI STREAMS declarations
> 
> The stub implementations are turned into compat symbols.
> 
> Linux actually has two reserved system call numbers (for getpmsg
> and putpmsg), but these system calls have never been implemented,
> and there are no plans to implement them, so this patch replaces
> the wrappers with the generic stubs.
> 
> According to <https://bugzilla.redhat.com/show_bug.cgi?id=436349>,
> the presence of the XSI STREAMS declarations is a minor portability
> hazard because they are not actually implemented.

Yes.

> This commit does not change the TIRPC support code in
> sunrpc/rpc_svcout.c.  It uses additional XTI functionality and
> therefore never worked with glibc.

OK for master.

Reviewed-by: Carlos O'Donell <carlos@rehdat.com>

> 2019-02-26  Florian Weimer  <fweimer@redhat.com>
> 
> 	Remove obsolete, never-implemented XSI STREAMS declarations.
> 	* manual/terminal.texi (Allocation): Remove portability note and
> 	adjust example.
> 	* sysdeps/posix/sysconf.c (__sysconf): Always return -1 for
> 	_SC_STREAMS.
> 	* sysdeps/unix/sysv/linux/syscalls.list (getpmsg, putpmsg): Remove.
> 	* sysdeps/unix/inet/Subdirs (streams): Remove.
> 	* conform/Makefile (conformtest-headers-XPG42): Remove stropts.h.
> 	(conformtest-headers-UNIX98): Likewise.
> 	(conformtest-headers-XOPEN2K): Likewise.
> 	(conformtest-headers-POSIX2008): Likewise.
> 	* posix/compat-streams.c: New file.
> 	* posix/Makefile (routines): Add it.
> 	* bits/stropts.h: Remove file.
> 	* bits/xtitypes.h: Likewise.
> 	* conform/data/stropts.h-data: Likewise.
> 	* include/stropts.h: Likewise.
> 	* include/sys/stropts.h: Likewise.
> 	* include/xtitypes.h: Likewise.
> 	* streams/Makefile: Likewise.
> 	* streams/fattach.c: Likewise.
> 	* streams/fdetach.c: Likewise.
> 	* streams/getmsg.c: Likewise.
> 	* streams/getpmsg.c: Likewise.
> 	* streams/isastream.c: Likewise.
> 	* streams/putmsg.c: Likewise.
> 	* streams/putpmsg.c: Likewise.
> 	* streams/stropts.h: Likewise.
> 	* streams/sys/stropts.h: Likewise.
> 	* sysdeps/ia64/bits/xtitypes.h: Likewise.
> 	* sysdeps/s390/bits/xtitypes.h: Likewise.
> 	* sysdeps/unix/sysv/linux/i386/getmsg.c: Likewise.
> 	* sysdeps/unix/sysv/linux/i386/putmsg.c: Likewise.
> 	* sysdeps/unix/sysv/linux/m68k/getmsg.c: Likewise.
> 	* sysdeps/unix/sysv/linux/m68k/putmsg.c: Likewise.
> 	* sysdeps/unix/sysv/linux/mips/getmsg.c: Likewise.
> 	* sysdeps/unix/sysv/linux/mips/putmsg.c: Likewise.
> 	* sysdeps/unix/sysv/linux/powerpc/getmsg.c: Likewise.
> 	* sysdeps/unix/sysv/linux/powerpc/putmsg.c: Likewise.
> 	* sysdeps/x86/bits/xtitypes.h: Likewise.
> 
> diff --git a/NEWS b/NEWS
> index 0a3b6c7a5a..1e66be0d11 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -22,6 +22,9 @@ Deprecated and removed features, and other changes affecting compatibility:
>    definitions in libc will be used automatically, which have been available
>    since glibc 2.17.
>  
> +* The obsolete and never-implemented XSI STREAMS header files <stropts.h>
> +  and <sys/stropts.h> have been removed.

OK. This might break builds, should it get a packaging change entry here?
https://sourceware.org/glibc/wiki/Release/2.30#Packaging_Changes

> +
>  Changes to build and runtime requirements:
>  
>  * GCC 6.2 or later is required to build the GNU C Library.
> diff --git a/bits/stropts.h b/bits/stropts.h
> deleted file mode 100644
> index 1e8742f3b6..0000000000
> --- a/bits/stropts.h
> +++ /dev/null
> @@ -1,230 +0,0 @@
> -/* Copyright (C) 1998-2019 Free Software Foundation, Inc.
> -   This file is part of the GNU C Library.
> -
> -   The GNU C Library is free software; you can redistribute it and/or
> -   modify it under the terms of the GNU Lesser General Public
> -   License as published by the Free Software Foundation; either
> -   version 2.1 of the License, or (at your option) any later version.
> -
> -   The GNU C Library is distributed in the hope that it will be useful,
> -   but WITHOUT ANY WARRANTY; without even the implied warranty of
> -   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> -   Lesser General Public License for more details.
> -
> -   You should have received a copy of the GNU Lesser General Public
> -   License along with the GNU C Library; if not, see
> -   <http://www.gnu.org/licenses/>.  */
> -
> -#ifndef _STROPTS_H
> -# error "Never include <bits/stropts.h> directly; use <stropts.h> instead."
> -#endif
> -
> -#ifndef _BITS_STROPTS_H
> -#define _BITS_STROPTS_H	1
> -
> -#include <bits/types.h>
> -
> -/* Macros used as `request' argument to `ioctl'.  */
> -#define __SID		('S' << 8)
> -
> -#define I_NREAD	    (__SID | 1)	/* Counts the number of data bytes in the data
> -				   block in the first message.  */
> -#define I_PUSH	    (__SID | 2)	/* Push STREAMS module onto top of the current
> -				   STREAM, just below the STREAM head.  */
> -#define I_POP	    (__SID | 3)	/* Remove STREAMS module from just below the
> -				   STREAM head.  */
> -#define I_LOOK	    (__SID | 4)	/* Retrieve the name of the module just below
> -				   the STREAM head and place it in a character
> -				   string.  */
> -#define I_FLUSH	    (__SID | 5)	/* Flush all input and/or output.  */
> -#define I_SRDOPT    (__SID | 6)	/* Sets the read mode.  */
> -#define I_GRDOPT    (__SID | 7)	/* Returns the current read mode setting.  */
> -#define I_STR	    (__SID | 8)	/* Construct an internal STREAMS `ioctl'
> -				   message and send that message downstream. */
> -#define I_SETSIG    (__SID | 9)	/* Inform the STREAM head that the process
> -				   wants the SIGPOLL signal issued.  */
> -#define I_GETSIG    (__SID |10) /* Return the events for which the calling
> -				   process is currently registered to be sent
> -				   a SIGPOLL signal.  */
> -#define I_FIND	    (__SID |11) /* Compares the names of all modules currently
> -				   present in the STREAM to the name pointed to
> -				   by `arg'.  */
> -#define I_LINK	    (__SID |12) /* Connect two STREAMs.  */
> -#define I_UNLINK    (__SID |13) /* Disconnects the two STREAMs.  */
> -#define I_PEEK	    (__SID |15) /* Allows a process to retrieve the information
> -				   in the first message on the STREAM head read
> -				   queue without taking the message off the
> -				   queue.  */
> -#define I_FDINSERT  (__SID |16) /* Create a message from the specified
> -				   buffer(s), adds information about another
> -				   STREAM, and send the message downstream.  */
> -#define I_SENDFD    (__SID |17) /* Requests the STREAM associated with `fildes'
> -				   to send a message, containing a file
> -				   pointer, to the STREAM head at the other end
> -				   of a STREAMS pipe.  */
> -#define I_RECVFD    (__SID |14) /* Non-EFT definition.  */
> -#define I_SWROPT    (__SID |19) /* Set the write mode.  */
> -#define I_GWROPT    (__SID |20) /* Return the current write mode setting.  */
> -#define I_LIST	    (__SID |21) /* List all the module names on the STREAM, up
> -				   to and including the topmost driver name. */
> -#define I_PLINK	    (__SID |22) /* Connect two STREAMs with a persistent
> -				   link.  */
> -#define I_PUNLINK   (__SID |23) /* Disconnect the two STREAMs that were
> -				   connected with a persistent link.  */
> -#define I_FLUSHBAND (__SID |28) /* Flush only band specified.  */
> -#define I_CKBAND    (__SID |29) /* Check if the message of a given priority
> -				   band exists on the STREAM head read
> -				   queue.  */
> -#define I_GETBAND   (__SID |30) /* Return the priority band of the first
> -				   message on the STREAM head read queue.  */
> -#define I_ATMARK    (__SID |31) /* See if the current message on the STREAM
> -				   head read queue is "marked" by some module
> -				   downstream.  */
> -#define I_SETCLTIME (__SID |32) /* Set the time the STREAM head will delay when
> -				   a STREAM is closing and there is data on
> -				   the write queues.  */
> -#define I_GETCLTIME (__SID |33) /* Get current value for closing timeout.  */
> -#define I_CANPUT    (__SID |34) /* Check if a certain band is writable.  */
> -
> -
> -/* Used in `I_LOOK' request.  */
> -#define FMNAMESZ	8	/* compatibility w/UnixWare/Solaris.  */
> -
> -/* Flush options.  */
> -#define FLUSHR		0x01	/* Flush read queues.  */
> -#define FLUSHW		0x02	/* Flush write queues.  */
> -#define FLUSHRW		0x03	/* Flush read and write queues.  */
> -#ifdef __USE_GNU
> -# define FLUSHBAND	0x04	/* Flush only specified band.  */
> -#endif
> -
> -/* Possible arguments for `I_SETSIG'.  */
> -#define S_INPUT		0x0001	/* A message, other than a high-priority
> -				   message, has arrived.  */
> -#define S_HIPRI		0x0002	/* A high-priority message is present.  */
> -#define S_OUTPUT	0x0004	/* The write queue for normal data is no longer
> -				   full.  */
> -#define S_MSG		0x0008	/* A STREAMS signal message that contains the
> -				   SIGPOLL signal reaches the front of the
> -				   STREAM head read queue.  */
> -#define S_ERROR		0x0010	/* Notification of an error condition.  */
> -#define S_HANGUP	0x0020	/* Notification of a hangup.  */
> -#define S_RDNORM	0x0040	/* A normal message has arrived.  */
> -#define S_WRNORM	S_OUTPUT
> -#define S_RDBAND	0x0080	/* A message with a non-zero priority has
> -				   arrived.  */
> -#define S_WRBAND	0x0100	/* The write queue for a non-zero priority
> -				   band is no longer full.  */
> -#define S_BANDURG	0x0200	/* When used in conjunction with S_RDBAND,
> -				   SIGURG is generated instead of SIGPOLL when
> -				   a priority message reaches the front of the
> -				   STREAM head read queue.  */
> -
> -/* Option for `I_PEEK'.  */
> -#define RS_HIPRI	0x01	/* Only look for high-priority messages.  */
> -
> -/* Options for `I_SRDOPT'.  */
> -#define RNORM		0x0000	/* Byte-STREAM mode, the default.  */
> -#define RMSGD		0x0001	/* Message-discard mode.   */
> -#define RMSGN		0x0002	/* Message-nondiscard mode.   */
> -#define RPROTDAT	0x0004	/* Deliver the control part of a message as
> -				   data.  */
> -#define RPROTDIS	0x0008	/* Discard the control part of a message,
> -				   delivering any data part.  */
> -#define RPROTNORM	0x0010	/* Fail `read' with EBADMSG if a message
> -				   containing a control part is at the front
> -				   of the STREAM head read queue.  */
> -#ifdef __USE_GNU
> -# define RPROTMASK	0x001C	/* The RPROT bits */
> -#endif
> -
> -/* Possible mode for `I_SWROPT'.  */
> -#define SNDZERO		0x001	/* Send a zero-length message downstream when a
> -				   `write' of 0 bytes occurs.  */
> -#ifdef __USE_GNU
> -# define SNDPIPE	0x002	/* Send SIGPIPE on write and putmsg if
> -				   sd_werror is set.  */
> -#endif
> -
> -/* Arguments for `I_ATMARK'.  */
> -#define ANYMARK		0x01	/* Check if the message is marked.  */
> -#define LASTMARK	0x02	/* Check if the message is the last one marked
> -				   on the queue.  */
> -
> -/* Argument for `I_UNLINK'.  */
> -#ifdef __USE_GNU
> -# define MUXID_ALL	(-1)	/* Unlink all STREAMs linked to the STREAM
> -				   associated with `fildes'.  */
> -#endif
> -
> -
> -/* Macros for `getmsg', `getpmsg', `putmsg' and `putpmsg'.  */
> -#define MSG_HIPRI	0x01	/* Send/receive high priority message.  */
> -#define MSG_ANY		0x02	/* Receive any message.  */
> -#define MSG_BAND	0x04	/* Receive message from specified band.  */
> -
> -/* Values returned by getmsg and getpmsg */
> -#define MORECTL		1	/* More control information is left in
> -				   message.  */
> -#define MOREDATA	2	/* More data is left in message.  */
> -
> -
> -/* Structure used for the I_FLUSHBAND ioctl on streams.  */
> -struct bandinfo
> -  {
> -    unsigned char bi_pri;
> -    int bi_flag;
> -  };
> -
> -struct strbuf
> -  {
> -    int maxlen;		/* Maximum buffer length.  */
> -    int len;		/* Length of data.  */
> -    char *buf;		/* Pointer to buffer.  */
> -  };
> -
> -struct strpeek
> -  {
> -    struct strbuf ctlbuf;
> -    struct strbuf databuf;
> -    t_uscalar_t flags;			/* UnixWare/Solaris compatibility.  */
> -  };
> -
> -struct strfdinsert
> -  {
> -    struct strbuf ctlbuf;
> -    struct strbuf databuf;
> -    t_uscalar_t flags;			/* UnixWare/Solaris compatibility.  */
> -    int fildes;
> -    int offset;
> -  };
> -
> -struct strioctl
> -  {
> -    int ic_cmd;
> -    int ic_timout;
> -    int ic_len;
> -    char *ic_dp;
> -  };
> -
> -struct strrecvfd
> -  {
> -    int fd;
> -    uid_t uid;
> -    gid_t gid;
> -    char __fill[8];			/* UnixWare/Solaris compatibility */
> -  };
> -
> -
> -struct str_mlist
> -  {
> -    char l_name[FMNAMESZ + 1];
> -  };
> -
> -struct str_list
> -  {
> -    int sl_nmods;
> -    struct str_mlist *sl_modlist;
> -  };
> -
> -#endif /* bits/stropts.h */

OK.

> diff --git a/bits/xtitypes.h b/bits/xtitypes.h
> deleted file mode 100644
> index 92c8bca888..0000000000
> --- a/bits/xtitypes.h
> +++ /dev/null
> @@ -1,33 +0,0 @@
> -/* bits/xtitypes.h -- Define some types used by <bits/stropts.h>.  Generic.
> -   Copyright (C) 2002-2019 Free Software Foundation, Inc.
> -   This file is part of the GNU C Library.
> -
> -   The GNU C Library is free software; you can redistribute it and/or
> -   modify it under the terms of the GNU Lesser General Public
> -   License as published by the Free Software Foundation; either
> -   version 2.1 of the License, or (at your option) any later version.
> -
> -   The GNU C Library is distributed in the hope that it will be useful,
> -   but WITHOUT ANY WARRANTY; without even the implied warranty of
> -   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> -   Lesser General Public License for more details.
> -
> -   You should have received a copy of the GNU Lesser General Public
> -   License along with the GNU C Library; if not, see
> -   <http://www.gnu.org/licenses/>.  */
> -
> -#ifndef _STROPTS_H
> -# error "Never include <bits/xtitypes.h> directly; use <stropts.h> instead."
> -#endif
> -
> -#ifndef _BITS_XTITYPES_H
> -#define _BITS_XTITYPES_H	1
> -
> -#include <bits/types.h>
> -
> -/* This type is used by some structs in <bits/stropts.h>.  */
> -typedef __SLONGWORD_TYPE __t_scalar_t;
> -typedef __ULONGWORD_TYPE __t_uscalar_t;
> -
> -
> -#endif /* bits/xtitypes.h */

OK.

> diff --git a/conform/Makefile b/conform/Makefile
> index 77709b86b9..59d569c4c5 100644
> --- a/conform/Makefile
> +++ b/conform/Makefile
> @@ -52,44 +52,44 @@ conformtest-headers-XPG4 := $(conformtest-headers-ISO) cpio.h dirent.h \
>  			    sys/wait.h tar.h termios.h ulimit.h unistd.h \
>  			    utime.h varargs.h wordexp.h
>  # Missing XPG42 expectations for: re_comp.h regexp.h wchar.h.
> -# XPG42 includes XTI, but xti.h is outside the scope of these tests.
> +# XPG42 includes XTI and STREAMS, but those are not implemented by glibc.

OK.

>  conformtest-headers-XPG42 := $(conformtest-headers-XPG4) arpa/inet.h fmtmsg.h \
>  			    libgen.h ndbm.h netdb.h netinet/in.h poll.h \
> -			    strings.h stropts.h sys/mman.h sys/resource.h \
> +			    strings.h sys/mman.h sys/resource.h \

OK. stropts.h removed.

>  			    sys/socket.h sys/statvfs.h sys/time.h sys/timeb.h \
>  			    sys/uio.h sys/un.h syslog.h ucontext.h utmpx.h
>  # Missing UNIX98 expectations for: inttypes.h re_comp.h regexp.h.
>  # The online UNIX98 includes XCURSES, but curses.h, term.h and
>  # unctrl.h are outside the scope of these tests.  It also includes
> -# XTI, but xti.h is outside the scope of these tests.
> +# XTI and STREAMS, but those are not implemented by glibc.

OK.

>  conformtest-headers-UNIX98 := $(conformtest-headers-POSIX) arpa/inet.h cpio.h \
>  			      dlfcn.h fmtmsg.h ftw.h iconv.h iso646.h \
>  			      langinfo.h libgen.h monetary.h ndbm.h netdb.h \
>  			      netinet/in.h nl_types.h poll.h search.h \
> -			      strings.h stropts.h sys/ipc.h sys/msg.h \
> +			      strings.h sys/ipc.h sys/msg.h \

OK. stropts.h removed.

>  			      sys/resource.h sys/sem.h sys/shm.h sys/socket.h \
>  			      sys/statvfs.h sys/time.h sys/timeb.h sys/uio.h \
>  			      sys/un.h syslog.h ucontext.h ulimit.h utmpx.h \
>  			      varargs.h wchar.h wctype.h
> -# Missing XOPEN2K expectations for: trace.h.
> +# Missing XOPEN2K expectations for: trace.h, stropts.h.
>  conformtest-headers-XOPEN2K := $(conformtest-headers-POSIX) arpa/inet.h \
>  			       complex.h cpio.h dlfcn.h fenv.h fmtmsg.h ftw.h \
>  			       iconv.h inttypes.h iso646.h langinfo.h \
>  			       libgen.h monetary.h ndbm.h net/if.h netdb.h \
>  			       netinet/in.h netinet/tcp.h nl_types.h poll.h \
>  			       search.h spawn.h stdbool.h stdint.h strings.h \
> -			       stropts.h sys/ipc.h sys/msg.h sys/resource.h \
> +			       sys/ipc.h sys/msg.h sys/resource.h \

OK. stropts.h removed.

>  			       sys/select.h sys/sem.h sys/shm.h sys/socket.h \
>  			       sys/statvfs.h sys/time.h sys/timeb.h sys/uio.h \
>  			       sys/un.h syslog.h tgmath.h ucontext.h ulimit.h \
>  			       utmpx.h wchar.h wctype.h
> -# Missing POSIX2008 expectations for: trace.h.
> +# Missing POSIX2008 expectations for: trace.h, stropts.h.
>  conformtest-headers-POSIX2008 := $(conformtest-headers-POSIX) arpa/inet.h \
>  				 complex.h cpio.h dlfcn.h fenv.h iconv.h \
>  				 inttypes.h iso646.h langinfo.h monetary.h \
>  				 net/if.h netdb.h netinet/in.h netinet/tcp.h \
>  				 nl_types.h poll.h spawn.h stdbool.h stdint.h \
> -				 strings.h stropts.h sys/select.h \
> +				 strings.h sys/select.h \

OK. stropts.h removed.

>  				 sys/socket.h sys/statvfs.h sys/un.h tgmath.h \
>  				 wchar.h wctype.h
>  # Missing XOPEN2K8 expectations for: trace.h.
> diff --git a/conform/data/stropts.h-data b/conform/data/stropts.h-data
> deleted file mode 100644
> index c4b1343411..0000000000
> --- a/conform/data/stropts.h-data
> +++ /dev/null
> @@ -1,140 +0,0 @@
> -#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined XPG4
> -type {struct bandinfo}
> -
> -element {struct bandinfo} {unsigned char} bi_pri
> -element {struct bandinfo} int bi_flag
> -
> -type {struct strpeek}
> -
> -element {struct strpeek} {struct strbuf} ctlbuf
> -element {struct strpeek} {struct strbuf} databuf
> -element {struct strpeek} t_uscalar_t flags
> -
> -type {struct strbuf}
> -
> -element {struct strbuf} int maxlen
> -element {struct strbuf} int len
> -element {struct strbuf} {char*} buf
> -
> -type {struct strfdinsert}
> -
> -element {struct strfdinsert} {struct strbuf} ctlbuf
> -element {struct strfdinsert} {struct strbuf} databuf
> -element {struct strfdinsert} t_uscalar_t flags
> -element {struct strfdinsert} int fildes
> -element {struct strfdinsert} int offset
> -
> -type {struct strioctl}
> -
> -element {struct strioctl} int ic_cmd
> -element {struct strioctl} int ic_timout
> -element {struct strioctl} int ic_len
> -element {struct strioctl} {char*} ic_dp
> -
> -type {struct strrecvfd}
> -
> -element {struct strrecvfd} int fd
> -element {struct strrecvfd} uid_t uid
> -element {struct strrecvfd} gid_t gid
> -
> -type uid_t
> -type gid_t
> -
> -type t_uscalar_t
> -
> -type {struct str_list}
> -
> -element {struct str_list} int sl_nmods
> -element {struct str_list} {struct str_mlist*} sl_modlist
> -
> -type {struct str_mlist}
> -
> -element {struct str_mlist} char l_name [FMNAMESZ+1]
> -
> -macro I_PUSH
> -macro I_POP
> -macro I_LOOK
> -macro FMNAMESZ
> -macro I_FLUSH
> -macro FLUSHR
> -macro FLUSHW
> -macro FLUSHRW
> -macro I_FLUSHBAND
> -macro I_SETSIG
> -macro S_RDNORM
> -macro S_RDBAND
> -macro S_INPUT
> -macro S_HIPRI
> -macro S_OUTPUT
> -macro S_WRNORM
> -macro S_WRBAND
> -macro S_MSG
> -macro S_ERROR
> -macro S_HANGUP
> -macro S_BANDURG
> -macro I_GETSIG
> -macro I_FIND
> -macro I_PEEK
> -macro RS_HIPRI
> -macro I_SRDOPT
> -macro RNORM
> -macro RMSGD
> -macro RMSGN
> -macro RPROTNORM
> -macro RPROTDAT
> -macro RPROTDIS
> -macro I_GRDOPT
> -macro I_NREAD
> -macro I_FDINSERT
> -macro I_STR
> -macro I_SWROPT
> -macro SNDZERO
> -macro I_GWROPT
> -macro I_SENDFD
> -macro I_RECVFD
> -macro I_LIST
> -macro I_ATMARK
> -macro ANYMARK
> -macro LASTMARK
> -macro I_CKBAND
> -macro I_GETBAND
> -macro I_CANPUT
> -macro I_SETCLTIME
> -macro I_GETCLTIME
> -macro I_LINK
> -macro I_UNLINK
> -macro I_PLINK
> -macro I_PUNLINK
> -
> -macro MSG_ANY
> -macro MSG_BAND
> -macro MSG_HIPRI
> -macro MORECTL
> -macro MOREDATA
> -
> -function int isastream (int)
> -function int getmsg (int, struct strbuf*, struct strbuf*, int*)
> -function int getpmsg (int, struct strbuf*, struct strbuf*, int*, int*)
> -// Bug 14362: wrong type for ioctl.
> -xfail-function int ioctl (int, int, ...)
> -function int putmsg (int, const struct strbuf*, const struct strbuf*, int)
> -function int putpmsg (int, const struct strbuf*, const struct strbuf*, int, int)
> -function int fattach (int, const char*)
> -function int fdetach (const char*)
> -
> -allow-header unistd.h
> -
> -allow bi_*
> -allow ic_*
> -allow l_*
> -allow sl_*
> -allow str_*
> -allow FLUSH*
> -allow I_*
> -allow M_*
> -allow MUXID_R*
> -allow S_*
> -allow SND*
> -allow STR*
> -allow *_t
> -#endif

OK, remove conformance data.

> diff --git a/include/stropts.h b/include/stropts.h
> deleted file mode 100644
> index 27ab60ac7f..0000000000
> --- a/include/stropts.h
> +++ /dev/null
> @@ -1 +0,0 @@
> -#include <streams/stropts.h>

OK, remove redirect header.

> diff --git a/include/sys/stropts.h b/include/sys/stropts.h
> deleted file mode 100644
> index 711f1502dd..0000000000
> --- a/include/sys/stropts.h
> +++ /dev/null
> @@ -1 +0,0 @@
> -#include <streams/sys/stropts.h>

OK, likewise.

> diff --git a/manual/terminal.texi b/manual/terminal.texi
> index d830baacd7..7293bfb393 100644
> --- a/manual/terminal.texi
> +++ b/manual/terminal.texi
> @@ -2117,12 +2117,6 @@ at @var{buf} with length @var{len}.
>  This function is a GNU extension.
>  @end deftypefun
>  
> -@strong{Portability Note:} On @w{System V} derived systems, the file
> -returned by the @code{ptsname} and @code{ptsname_r} functions may be
> -STREAMS-based, and therefore require additional processing after opening
> -before it actually behaves as a pseudo terminal.
> -@c FIXME: xref STREAMS

OK.

> -
>  Typical usage of these functions is illustrated by the following example:
>  @smallexample
>  int
> @@ -2145,13 +2139,6 @@ open_pty_pair (int *amaster, int *aslave)
>    if (slave == -1)
>      goto close_master;
>  
> -  if (isastream (slave))
> -    @{
> -      if (ioctl (slave, I_PUSH, "ptem") < 0
> -          || ioctl (slave, I_PUSH, "ldterm") < 0)
> -        goto close_slave;
> -    @}


OK.

> -
>    *amaster = master;
>    *aslave = slave;
>    return 1;
> diff --git a/posix/Makefile b/posix/Makefile
> index 93c3a290d7..8ac6743ad7 100644
> --- a/posix/Makefile
> +++ b/posix/Makefile
> @@ -64,7 +64,8 @@ routines :=								      \
>  	spawnattr_getsigmask spawnattr_getschedpolicy spawnattr_getschedparam \
>  	spawnattr_setsigmask spawnattr_setschedpolicy spawnattr_setschedparam \
>  	posix_madvise							      \
> -	get_child_max sched_cpucount sched_cpualloc sched_cpufree
> +	get_child_max sched_cpucount sched_cpualloc sched_cpufree \
> +	streams-compat

OK. Add streams-compat.

>  
>  aux		:= init-posix environ
>  tests		:= test-errno tstgetopt testfnm runtests runptests \
> diff --git a/posix/streams-compat.c b/posix/streams-compat.c
> new file mode 100644
> index 0000000000..30e9b5743a
> --- /dev/null
> +++ b/posix/streams-compat.c
> @@ -0,0 +1,101 @@
> +/* Compatibility symbols for the unimplemented XSI STREAMS extension.

OK. I like the use of compat symbols for this case, in the event an existing
program has code that linked with the stubs but didn't use them. At least it
would continue to run.

> +   Copyright (C) 1998-2019 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <http://www.gnu.org/licenses/>.  */
> +
> +#include <shlib-compat.h>
> +
> +#if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_30)

OK.

> +
> +# include <errno.h>
> +# include <fcntl.h>
> +
> +struct strbuf;
> +
> +int
> +attribute_compat_text_section
> +fattach (int fildes, const char *path)
> +{
> +  __set_errno (ENOSYS);
> +  return -1;
> +}
> +compat_symbol (libc, fattach, fattach, GLIBC_2_1);
> +
> +int
> +attribute_compat_text_section
> +fdetach (const char *path)
> +{
> +  __set_errno (ENOSYS);
> +  return -1;
> +}
> +compat_symbol (libc, fdetach, fdetach, GLIBC_2_1);
> +
> +
> +int
> +attribute_compat_text_section
> +getmsg (int fildes, struct strbuf *ctlptr, struct strbuf *dataptr, int *flagsp)
> +{
> +  __set_errno (ENOSYS);
> +  return -1;
> +}
> +compat_symbol (libc, getmsg, getmsg, GLIBC_2_1);
> +
> +int
> +attribute_compat_text_section
> +getpmsg (int fildes, struct strbuf *ctlptr, struct strbuf *dataptr, int *bandp,
> +	 int *flagsp)
> +{
> +  __set_errno (ENOSYS);
> +  return -1;
> +}
> +compat_symbol (libc, getpmsg, getpmsg, GLIBC_2_1);
> +
> +int
> +attribute_compat_text_section
> +isastream (int fildes)
> +{
> +  /* In general we do not have a STREAMS implementation and therefore
> +     return 0.  But for invalid file descriptors we have to return an
> +     error.  */
> +  if (__fcntl (fildes, F_GETFD) < 0)
> +    return -1;
> +
> +  /* No STREAM.  */
> +  return 0;
> +}
> +compat_symbol (libc, isastream, isastream, GLIBC_2_1);
> +
> +int
> +attribute_compat_text_section
> +putmsg (int fildes, const struct strbuf *ctlptr, const struct strbuf *dataptr,
> +	int flags)
> +{
> +  __set_errno (ENOSYS);
> +  return -1;
> +}
> +compat_symbol (libc, putmsg, putmsg, GLIBC_2_1);
> +
> +int
> +attribute_compat_text_section
> +putpmsg (int fildes, const struct strbuf *ctlptr, const struct strbuf *dataptr,
> +	 int band, int flags)
> +{
> +  __set_errno (ENOSYS);
> +  return -1;
> +}
> +compat_symbol (libc, putpmsg, putpmsg, GLIBC_2_1);
> +

OK.

> +#endif /* SHLIB_COMPAT */
> diff --git a/streams/Makefile b/streams/Makefile
> deleted file mode 100644
> index 916147f382..0000000000
> --- a/streams/Makefile
> +++ /dev/null
> @@ -1,28 +0,0 @@
> -# Copyright (C) 1998-2019 Free Software Foundation, Inc.
> -# This file is part of the GNU C Library.
> -
> -# The GNU C Library is free software; you can redistribute it and/or
> -# modify it under the terms of the GNU Lesser General Public
> -# License as published by the Free Software Foundation; either
> -# version 2.1 of the License, or (at your option) any later version.
> -
> -# The GNU C Library is distributed in the hope that it will be useful,
> -# but WITHOUT ANY WARRANTY; without even the implied warranty of
> -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> -# Lesser General Public License for more details.
> -
> -# You should have received a copy of the GNU Lesser General Public
> -# License along with the GNU C Library; if not, see
> -# <http://www.gnu.org/licenses/>.
> -
> -#
> -#	Makefile for streams.
> -#
> -subdir	:= streams
> -
> -include ../Makeconfig
> -
> -headers		= stropts.h sys/stropts.h bits/stropts.h bits/xtitypes.h
> -routines	= isastream getmsg getpmsg putmsg putpmsg fattach fdetach
> -
> -include ../Rules

OK.

> diff --git a/streams/Versions b/streams/Versions
> deleted file mode 100644
> index 9a6f4d756c..0000000000
> --- a/streams/Versions
> +++ /dev/null
> @@ -1,15 +0,0 @@
> -libc {
> -  GLIBC_2.1 {
> -    # f*
> -    fattach; fdetach;
> -
> -    # g*
> -    getmsg; getpmsg;
> -
> -    # i*
> -    isastream;
> -
> -    # p*
> -    putmsg; putpmsg;
> -  }
> -}

OK.

> diff --git a/streams/fattach.c b/streams/fattach.c
> deleted file mode 100644
> index 8ab904653a..0000000000
> --- a/streams/fattach.c
> +++ /dev/null
> @@ -1,29 +0,0 @@
> -/* Copyright (C) 1998-2019 Free Software Foundation, Inc.
> -   This file is part of the GNU C Library.
> -
> -   The GNU C Library is free software; you can redistribute it and/or
> -   modify it under the terms of the GNU Lesser General Public
> -   License as published by the Free Software Foundation; either
> -   version 2.1 of the License, or (at your option) any later version.
> -
> -   The GNU C Library is distributed in the hope that it will be useful,
> -   but WITHOUT ANY WARRANTY; without even the implied warranty of
> -   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> -   Lesser General Public License for more details.
> -
> -   You should have received a copy of the GNU Lesser General Public
> -   License along with the GNU C Library; if not, see
> -   <http://www.gnu.org/licenses/>.  */
> -
> -#include <errno.h>
> -#include <stropts.h>
> -
> -int
> -fattach (int fildes, const char *path)
> -{
> -  __set_errno (ENOSYS);
> -  return -1;
> -}
> -
> -
> -stub_warning (fattach)

OK.

> diff --git a/streams/fdetach.c b/streams/fdetach.c
> deleted file mode 100644
> index 2016b6699a..0000000000
> --- a/streams/fdetach.c
> +++ /dev/null
> @@ -1,29 +0,0 @@
> -/* Copyright (C) 1998-2019 Free Software Foundation, Inc.
> -   This file is part of the GNU C Library.
> -
> -   The GNU C Library is free software; you can redistribute it and/or
> -   modify it under the terms of the GNU Lesser General Public
> -   License as published by the Free Software Foundation; either
> -   version 2.1 of the License, or (at your option) any later version.
> -
> -   The GNU C Library is distributed in the hope that it will be useful,
> -   but WITHOUT ANY WARRANTY; without even the implied warranty of
> -   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> -   Lesser General Public License for more details.
> -
> -   You should have received a copy of the GNU Lesser General Public
> -   License along with the GNU C Library; if not, see
> -   <http://www.gnu.org/licenses/>.  */
> -
> -#include <errno.h>
> -#include <stropts.h>
> -
> -int
> -fdetach (const char *path)
> -{
> -  __set_errno (ENOSYS);
> -  return -1;
> -}
> -
> -
> -stub_warning (fdetach)

OK.

> diff --git a/streams/getmsg.c b/streams/getmsg.c
> deleted file mode 100644
> index 93bc0ddaf7..0000000000
> --- a/streams/getmsg.c
> +++ /dev/null
> @@ -1,29 +0,0 @@
> -/* Copyright (C) 1998-2019 Free Software Foundation, Inc.
> -   This file is part of the GNU C Library.
> -
> -   The GNU C Library is free software; you can redistribute it and/or
> -   modify it under the terms of the GNU Lesser General Public
> -   License as published by the Free Software Foundation; either
> -   version 2.1 of the License, or (at your option) any later version.
> -
> -   The GNU C Library is distributed in the hope that it will be useful,
> -   but WITHOUT ANY WARRANTY; without even the implied warranty of
> -   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> -   Lesser General Public License for more details.
> -
> -   You should have received a copy of the GNU Lesser General Public
> -   License along with the GNU C Library; if not, see
> -   <http://www.gnu.org/licenses/>.  */
> -
> -#include <errno.h>
> -#include <stropts.h>
> -
> -int
> -getmsg (int fildes, struct strbuf *ctlptr, struct strbuf *dataptr, int *flagsp)
> -{
> -  __set_errno (ENOSYS);
> -  return -1;
> -}
> -
> -
> -stub_warning (getmsg)

OK.

> diff --git a/streams/getpmsg.c b/streams/getpmsg.c
> deleted file mode 100644
> index b3912d38ab..0000000000
> --- a/streams/getpmsg.c
> +++ /dev/null
> @@ -1,30 +0,0 @@
> -/* Copyright (C) 1998-2019 Free Software Foundation, Inc.
> -   This file is part of the GNU C Library.
> -
> -   The GNU C Library is free software; you can redistribute it and/or
> -   modify it under the terms of the GNU Lesser General Public
> -   License as published by the Free Software Foundation; either
> -   version 2.1 of the License, or (at your option) any later version.
> -
> -   The GNU C Library is distributed in the hope that it will be useful,
> -   but WITHOUT ANY WARRANTY; without even the implied warranty of
> -   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> -   Lesser General Public License for more details.
> -
> -   You should have received a copy of the GNU Lesser General Public
> -   License along with the GNU C Library; if not, see
> -   <http://www.gnu.org/licenses/>.  */
> -
> -#include <errno.h>
> -#include <stropts.h>
> -
> -int
> -getpmsg (int fildes, struct strbuf *ctlptr, struct strbuf *dataptr, int *bandp,
> -	 int *flagsp)
> -{
> -  __set_errno (ENOSYS);
> -  return -1;
> -}
> -
> -
> -stub_warning (getpmsg)

OK.

> diff --git a/streams/isastream.c b/streams/isastream.c
> deleted file mode 100644
> index 328b355c47..0000000000
> --- a/streams/isastream.c
> +++ /dev/null
> @@ -1,33 +0,0 @@
> -/* Copyright (C) 1998-2019 Free Software Foundation, Inc.
> -   This file is part of the GNU C Library.
> -
> -   The GNU C Library is free software; you can redistribute it and/or
> -   modify it under the terms of the GNU Lesser General Public
> -   License as published by the Free Software Foundation; either
> -   version 2.1 of the License, or (at your option) any later version.
> -
> -   The GNU C Library is distributed in the hope that it will be useful,
> -   but WITHOUT ANY WARRANTY; without even the implied warranty of
> -   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> -   Lesser General Public License for more details.
> -
> -   You should have received a copy of the GNU Lesser General Public
> -   License along with the GNU C Library; if not, see
> -   <http://www.gnu.org/licenses/>.  */
> -
> -#include <errno.h>
> -#include <fcntl.h>
> -#include <stropts.h>
> -
> -int
> -isastream (int fildes)
> -{
> -  /* In general we do not have a STREAMS implementation and therefore
> -     return 0.  But for invalid file descriptors we have to return an
> -     error.  */
> -  if (__fcntl (fildes, F_GETFD) < 0)
> -    return -1;
> -
> -  /* No STREAM.  */
> -  return 0;
> -}

OK.

> diff --git a/streams/putmsg.c b/streams/putmsg.c
> deleted file mode 100644
> index f6383b153a..0000000000
> --- a/streams/putmsg.c
> +++ /dev/null
> @@ -1,30 +0,0 @@
> -/* Copyright (C) 1998-2019 Free Software Foundation, Inc.
> -   This file is part of the GNU C Library.
> -
> -   The GNU C Library is free software; you can redistribute it and/or
> -   modify it under the terms of the GNU Lesser General Public
> -   License as published by the Free Software Foundation; either
> -   version 2.1 of the License, or (at your option) any later version.
> -
> -   The GNU C Library is distributed in the hope that it will be useful,
> -   but WITHOUT ANY WARRANTY; without even the implied warranty of
> -   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> -   Lesser General Public License for more details.
> -
> -   You should have received a copy of the GNU Lesser General Public
> -   License along with the GNU C Library; if not, see
> -   <http://www.gnu.org/licenses/>.  */
> -
> -#include <errno.h>
> -#include <stropts.h>
> -
> -int
> -putmsg (int fildes, const struct strbuf *ctlptr, const struct strbuf *dataptr,
> -	int flags)
> -{
> -  __set_errno (ENOSYS);
> -  return -1;
> -}
> -
> -
> -stub_warning (putmsg)

OK.

> diff --git a/streams/putpmsg.c b/streams/putpmsg.c
> deleted file mode 100644
> index fac3d22c5d..0000000000
> --- a/streams/putpmsg.c
> +++ /dev/null
> @@ -1,30 +0,0 @@
> -/* Copyright (C) 1998-2019 Free Software Foundation, Inc.
> -   This file is part of the GNU C Library.
> -
> -   The GNU C Library is free software; you can redistribute it and/or
> -   modify it under the terms of the GNU Lesser General Public
> -   License as published by the Free Software Foundation; either
> -   version 2.1 of the License, or (at your option) any later version.
> -
> -   The GNU C Library is distributed in the hope that it will be useful,
> -   but WITHOUT ANY WARRANTY; without even the implied warranty of
> -   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> -   Lesser General Public License for more details.
> -
> -   You should have received a copy of the GNU Lesser General Public
> -   License along with the GNU C Library; if not, see
> -   <http://www.gnu.org/licenses/>.  */
> -
> -#include <errno.h>
> -#include <stropts.h>
> -
> -int
> -putpmsg (int fildes, const struct strbuf *ctlptr, const struct strbuf *dataptr,
> -	 int band, int flags)
> -{
> -  __set_errno (ENOSYS);
> -  return -1;
> -}
> -
> -
> -stub_warning (putpmsg)

OK.

> diff --git a/streams/stropts.h b/streams/stropts.h
> deleted file mode 100644
> index 97b9428ee8..0000000000
> --- a/streams/stropts.h
> +++ /dev/null
> @@ -1,92 +0,0 @@
> -/* Copyright (C) 1998-2019 Free Software Foundation, Inc.
> -   This file is part of the GNU C Library.
> -
> -   The GNU C Library is free software; you can redistribute it and/or
> -   modify it under the terms of the GNU Lesser General Public
> -   License as published by the Free Software Foundation; either
> -   version 2.1 of the License, or (at your option) any later version.
> -
> -   The GNU C Library is distributed in the hope that it will be useful,
> -   but WITHOUT ANY WARRANTY; without even the implied warranty of
> -   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> -   Lesser General Public License for more details.
> -
> -   You should have received a copy of the GNU Lesser General Public
> -   License along with the GNU C Library; if not, see
> -   <http://www.gnu.org/licenses/>.  */
> -
> -#ifndef _STROPTS_H
> -#define _STROPTS_H	1
> -
> -#include <features.h>
> -#include <bits/types.h>
> -#include <bits/xtitypes.h>
> -
> -#ifndef __gid_t_defined
> -typedef __gid_t gid_t;
> -# define __gid_t_defined
> -#endif
> -
> -#ifndef __uid_t_defined
> -typedef __uid_t uid_t;
> -# define __uid_t_defined
> -#endif
> -
> -typedef __t_scalar_t t_scalar_t;
> -typedef __t_uscalar_t t_uscalar_t;
> -
> -/* Get system specific constants.  */
> -#include <bits/stropts.h>
> -
> -
> -__BEGIN_DECLS
> -
> -/* Test whether FILDES is associated with a STREAM-based file.  */
> -extern int isastream (int __fildes) __THROW;
> -
> -/* Receive next message from a STREAMS file.
> -
> -   This function is a cancellation point and therefore not marked with
> -   __THROW.  */
> -extern int getmsg (int __fildes, struct strbuf *__restrict __ctlptr,
> -		   struct strbuf *__restrict __dataptr,
> -		   int *__restrict __flagsp);
> -
> -/* Receive next message from a STREAMS file, with *FLAGSP allowing to
> -   control which message.
> -
> -   This function is a cancellation point and therefore not marked with
> -   __THROW.  */
> -extern int getpmsg (int __fildes, struct strbuf *__restrict __ctlptr,
> -		    struct strbuf *__restrict __dataptr,
> -		    int *__restrict __bandp, int *__restrict __flagsp);
> -
> -/* Perform the I/O control operation specified by REQUEST on FD.
> -   One argument may follow; its presence and type depend on REQUEST.
> -   Return value depends on REQUEST.  Usually -1 indicates error.  */
> -extern int ioctl (int __fd, unsigned long int __request, ...) __THROW;
> -
> -/* Send a message on a STREAM.
> -
> -   This function is a cancellation point and therefore not marked with
> -   __THROW.  */
> -extern int putmsg (int __fildes, const struct strbuf *__ctlptr,
> -		   const struct strbuf *__dataptr, int __flags);
> -
> -/* Send a message on a STREAM to the BAND.
> -
> -   This function is a cancellation point and therefore not marked with
> -   __THROW.  */
> -extern int putpmsg (int __fildes, const struct strbuf *__ctlptr,
> -		    const struct strbuf *__dataptr, int __band, int __flags);
> -
> -/* Attach a STREAMS-based file descriptor FILDES to a file PATH in the
> -   file system name space.  */
> -extern int fattach (int __fildes, const char *__path) __THROW;
> -
> -/* Detach a name PATH from a STREAMS-based file descriptor.  */
> -extern int fdetach (const char *__path) __THROW;
> -
> -__END_DECLS
> -
> -#endif /* stropts.h */

OK.

> diff --git a/streams/sys/stropts.h b/streams/sys/stropts.h
> deleted file mode 100644
> index 5b5bc02f40..0000000000
> --- a/streams/sys/stropts.h
> +++ /dev/null
> @@ -1 +0,0 @@
> -#include <stropts.h>

OK.

> diff --git a/sysdeps/ia64/bits/xtitypes.h b/sysdeps/ia64/bits/xtitypes.h
> deleted file mode 100644
> index f5d5f49c52..0000000000
> --- a/sysdeps/ia64/bits/xtitypes.h
> +++ /dev/null
> @@ -1,33 +0,0 @@
> -/* bits/xtitypes.h -- Define some types used by <bits/stropts.h>.  IA64
> -   Copyright (C) 2002-2019 Free Software Foundation, Inc.
> -   This file is part of the GNU C Library.
> -
> -   The GNU C Library is free software; you can redistribute it and/or
> -   modify it under the terms of the GNU Lesser General Public
> -   License as published by the Free Software Foundation; either
> -   version 2.1 of the License, or (at your option) any later version.
> -
> -   The GNU C Library is distributed in the hope that it will be useful,
> -   but WITHOUT ANY WARRANTY; without even the implied warranty of
> -   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> -   Lesser General Public License for more details.
> -
> -   You should have received a copy of the GNU Lesser General Public
> -   License along with the GNU C Library; if not, see
> -   <http://www.gnu.org/licenses/>.  */
> -
> -#ifndef _STROPTS_H
> -# error "Never include <bits/xtitypes.h> directly; use <stropts.h> instead."
> -#endif
> -
> -#ifndef _BITS_XTITYPES_H
> -#define _BITS_XTITYPES_H	1
> -
> -#include <bits/types.h>
> -
> -/* This type is used by some structs in <bits/stropts.h>.  */
> -typedef __S32_TYPE __t_scalar_t;
> -typedef __U32_TYPE __t_uscalar_t;
> -
> -
> -#endif /* bits/xtitypes.h */

OK.

> diff --git a/sysdeps/posix/sysconf.c b/sysdeps/posix/sysconf.c
> index c1929b312f..0c4f9432e8 100644
> --- a/sysdeps/posix/sysconf.c
> +++ b/sysdeps/posix/sysconf.c
> @@ -1116,11 +1116,7 @@ __sysconf (int name)
>  #endif
>  
>      case _SC_STREAMS:
> -#ifdef _XOPEN_STREAMS
> -      return _XOPEN_STREAMS;
> -#else
>        return -1;
> -#endif

OK.

>  
>      case _SC_HOST_NAME_MAX:
>  #ifdef HOST_NAME_MAX
> diff --git a/sysdeps/s390/bits/xtitypes.h b/sysdeps/s390/bits/xtitypes.h
> deleted file mode 100644
> index 2f207845d9..0000000000
> --- a/sysdeps/s390/bits/xtitypes.h
> +++ /dev/null
> @@ -1,33 +0,0 @@
> -/* bits/xtitypes.h -- Define some types used by <bits/stropts.h>.  S390/S390x
> -   Copyright (C) 2002-2019 Free Software Foundation, Inc.
> -   This file is part of the GNU C Library.
> -
> -   The GNU C Library is free software; you can redistribute it and/or
> -   modify it under the terms of the GNU Lesser General Public
> -   License as published by the Free Software Foundation; either
> -   version 2.1 of the License, or (at your option) any later version.
> -
> -   The GNU C Library is distributed in the hope that it will be useful,
> -   but WITHOUT ANY WARRANTY; without even the implied warranty of
> -   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> -   Lesser General Public License for more details.
> -
> -   You should have received a copy of the GNU Lesser General Public
> -   License along with the GNU C Library; if not, see
> -   <http://www.gnu.org/licenses/>.  */
> -
> -#ifndef _STROPTS_H
> -# error "Never include <bits/xtitypes.h> directly; use <stropts.h> instead."
> -#endif
> -
> -#ifndef _BITS_XTITYPES_H
> -#define _BITS_XTITYPES_H	1
> -
> -#include <bits/types.h>
> -
> -/* This type is used by some structs in <bits/stropts.h>.  */
> -typedef __S32_TYPE __t_scalar_t;
> -typedef __U32_TYPE __t_uscalar_t;
> -
> -
> -#endif /* bits/xtitypes.h */

OK.

> diff --git a/sysdeps/unix/inet/Subdirs b/sysdeps/unix/inet/Subdirs
> index 0a02dd4447..90791e6e07 100644
> --- a/sysdeps/unix/inet/Subdirs
> +++ b/sysdeps/unix/inet/Subdirs
> @@ -5,4 +5,3 @@ sunrpc
>  nis
>  nscd
>  nss
> -streams

OK.

> diff --git a/sysdeps/unix/sysv/linux/i386/getmsg.c b/sysdeps/unix/sysv/linux/i386/getmsg.c
> deleted file mode 100644
> index 90a2788feb..0000000000
> --- a/sysdeps/unix/sysv/linux/i386/getmsg.c
> +++ /dev/null
> @@ -1,33 +0,0 @@
> -/* Copyright (C) 1998-2019 Free Software Foundation, Inc.
> -   This file is part of the GNU C Library.
> -
> -   The GNU C Library is free software; you can redistribute it and/or
> -   modify it under the terms of the GNU Lesser General Public
> -   License as published by the Free Software Foundation; either
> -   version 2.1 of the License, or (at your option) any later version.
> -
> -   The GNU C Library is distributed in the hope that it will be useful,
> -   but WITHOUT ANY WARRANTY; without even the implied warranty of
> -   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> -   Lesser General Public License for more details.
> -
> -   You should have received a copy of the GNU Lesser General Public
> -   License along with the GNU C Library; if not, see
> -   <http://www.gnu.org/licenses/>.  */
> -
> -#include <errno.h>
> -#include <stddef.h>
> -#include <stropts.h>
> -
> -#include <sysdep.h>
> -#include <sys/syscall.h>
> -
> -#ifdef __NR_getpmsg
> -int
> -getmsg (int fildes, struct strbuf *ctlptr, struct strbuf *dataptr, int *flagsp)
> -{
> -  return INLINE_SYSCALL (getpmsg, 5, fildes, ctlptr, dataptr, NULL, flagsp);
> -}
> -#else
> -# include <streams/getmsg.c>
> -#endif

OK.

> diff --git a/sysdeps/unix/sysv/linux/i386/putmsg.c b/sysdeps/unix/sysv/linux/i386/putmsg.c
> deleted file mode 100644
> index f1476cc89e..0000000000
> --- a/sysdeps/unix/sysv/linux/i386/putmsg.c
> +++ /dev/null
> @@ -1,34 +0,0 @@
> -/* Copyright (C) 1998-2019 Free Software Foundation, Inc.
> -   This file is part of the GNU C Library.
> -
> -   The GNU C Library is free software; you can redistribute it and/or
> -   modify it under the terms of the GNU Lesser General Public
> -   License as published by the Free Software Foundation; either
> -   version 2.1 of the License, or (at your option) any later version.
> -
> -   The GNU C Library is distributed in the hope that it will be useful,
> -   but WITHOUT ANY WARRANTY; without even the implied warranty of
> -   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> -   Lesser General Public License for more details.
> -
> -   You should have received a copy of the GNU Lesser General Public
> -   License along with the GNU C Library; if not, see
> -   <http://www.gnu.org/licenses/>.  */
> -
> -#include <errno.h>
> -#include <stddef.h>
> -#include <stropts.h>
> -
> -#include <sysdep.h>
> -#include <sys/syscall.h>
> -
> -#ifdef __NR_putpmsg
> -int
> -putmsg (int fildes, const struct strbuf *ctlptr, const struct strbuf *dataptr,
> -	int flags)
> -{
> -  return INLINE_SYSCALL (putpmsg, 5, fildes, ctlptr, dataptr, -1, flags);
> -}
> -#else
> -# include <streams/putmsg.c>
> -#endif

OK.

> diff --git a/sysdeps/unix/sysv/linux/m68k/getmsg.c b/sysdeps/unix/sysv/linux/m68k/getmsg.c
> deleted file mode 100644
> index 3a1fa08525..0000000000
> --- a/sysdeps/unix/sysv/linux/m68k/getmsg.c
> +++ /dev/null
> @@ -1 +0,0 @@
> -#include <sysdeps/unix/sysv/linux/i386/getmsg.c>
> diff --git a/sysdeps/unix/sysv/linux/m68k/putmsg.c b/sysdeps/unix/sysv/linux/m68k/putmsg.c
> deleted file mode 100644
> index ebc1680ca7..0000000000
> --- a/sysdeps/unix/sysv/linux/m68k/putmsg.c
> +++ /dev/null
> @@ -1 +0,0 @@
> -#include <sysdeps/unix/sysv/linux/i386/putmsg.c>
> diff --git a/sysdeps/unix/sysv/linux/mips/getmsg.c b/sysdeps/unix/sysv/linux/mips/getmsg.c
> deleted file mode 100644
> index 3a1fa08525..0000000000
> --- a/sysdeps/unix/sysv/linux/mips/getmsg.c
> +++ /dev/null
> @@ -1 +0,0 @@
> -#include <sysdeps/unix/sysv/linux/i386/getmsg.c>
> diff --git a/sysdeps/unix/sysv/linux/mips/putmsg.c b/sysdeps/unix/sysv/linux/mips/putmsg.c
> deleted file mode 100644
> index ebc1680ca7..0000000000
> --- a/sysdeps/unix/sysv/linux/mips/putmsg.c
> +++ /dev/null
> @@ -1 +0,0 @@
> -#include <sysdeps/unix/sysv/linux/i386/putmsg.c>
> diff --git a/sysdeps/unix/sysv/linux/powerpc/getmsg.c b/sysdeps/unix/sysv/linux/powerpc/getmsg.c
> deleted file mode 100644
> index 3a1fa08525..0000000000
> --- a/sysdeps/unix/sysv/linux/powerpc/getmsg.c
> +++ /dev/null
> @@ -1 +0,0 @@
> -#include <sysdeps/unix/sysv/linux/i386/getmsg.c>
> diff --git a/sysdeps/unix/sysv/linux/powerpc/putmsg.c b/sysdeps/unix/sysv/linux/powerpc/putmsg.c
> deleted file mode 100644
> index ebc1680ca7..0000000000
> --- a/sysdeps/unix/sysv/linux/powerpc/putmsg.c
> +++ /dev/null
> @@ -1 +0,0 @@
> -#include <sysdeps/unix/sysv/linux/i386/putmsg.c>

OK.

> diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list
> index 544ab5d54a..25424e1399 100644
> --- a/sysdeps/unix/sysv/linux/syscalls.list
> +++ b/sysdeps/unix/sysv/linux/syscalls.list
> @@ -20,7 +20,6 @@ getegid		-	getegid		Ei:	__getegid	getegid
>  geteuid		-	geteuid		Ei:	__geteuid	geteuid
>  getpgid		-	getpgid		i:i	__getpgid	getpgid
>  getpgrp		-	getpgrp		Ei:	getpgrp
> -getpmsg		-	getpmsg		i:ipppp	getpmsg

OK.

>  getppid		-	getppid		Ei:	__getppid	getppid
>  getresuid	-	getresuid	i:ppp	getresuid
>  getresgid	-	getresgid	i:ppp	getresgid
> @@ -46,7 +45,6 @@ pipe		-	pipe		i:f	__pipe		pipe
>  pipe2		-	pipe2		i:fi	__pipe2		pipe2
>  pivot_root	EXTRA	pivot_root	i:ss	pivot_root
>  prctl		EXTRA	prctl		i:iiiii	__prctl		prctl
> -putpmsg		-	putpmsg		i:ippii	putpmsg

OK.

>  query_module	EXTRA	query_module	i:sipip	__compat_query_module	query_module@GLIBC_2.0:GLIBC_2.23
>  quotactl	EXTRA	quotactl	i:isip	quotactl
>  remap_file_pages -	remap_file_pages i:piiii	__remap_file_pages remap_file_pages
> diff --git a/sysdeps/x86/bits/xtitypes.h b/sysdeps/x86/bits/xtitypes.h
> deleted file mode 100644
> index 4d045415a8..0000000000
> --- a/sysdeps/x86/bits/xtitypes.h
> +++ /dev/null
> @@ -1,33 +0,0 @@
> -/* bits/xtitypes.h -- Define some types used by <bits/stropts.h>.  x86-64.
> -   Copyright (C) 2002-2019 Free Software Foundation, Inc.
> -   This file is part of the GNU C Library.
> -
> -   The GNU C Library is free software; you can redistribute it and/or
> -   modify it under the terms of the GNU Lesser General Public
> -   License as published by the Free Software Foundation; either
> -   version 2.1 of the License, or (at your option) any later version.
> -
> -   The GNU C Library is distributed in the hope that it will be useful,
> -   but WITHOUT ANY WARRANTY; without even the implied warranty of
> -   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> -   Lesser General Public License for more details.
> -
> -   You should have received a copy of the GNU Lesser General Public
> -   License along with the GNU C Library; if not, see
> -   <http://www.gnu.org/licenses/>.  */
> -
> -#ifndef _STROPTS_H
> -# error "Never include <bits/xtitypes.h> directly; use <stropts.h> instead."
> -#endif
> -
> -#ifndef _BITS_XTITYPES_H
> -#define _BITS_XTITYPES_H	1
> -
> -#include <bits/types.h>
> -
> -/* This type is used by some structs in <bits/stropts.h>.  */
> -typedef __SLONG32_TYPE __t_scalar_t;
> -typedef __ULONG32_TYPE __t_uscalar_t;
> -
> -
> -#endif /* bits/xtitypes.h */

OK.

> 
>
Florian Weimer March 14, 2019, 10:50 a.m. UTC | #14
* Carlos O'Donell:

>> diff --git a/NEWS b/NEWS
>> index 0a3b6c7a5a..1e66be0d11 100644
>> --- a/NEWS
>> +++ b/NEWS
>> @@ -22,6 +22,9 @@ Deprecated and removed features, and other changes affecting compatibility:
>>    definitions in libc will be used automatically, which have been available
>>    since glibc 2.17.
>>  
>> +* The obsolete and never-implemented XSI STREAMS header files <stropts.h>
>> +  and <sys/stropts.h> have been removed.
>
> OK. This might break builds, should it get a packaging change entry here?
> https://sourceware.org/glibc/wiki/Release/2.30#Packaging_Changes

So far, I've considered the wiki as cumulative regarding to the NEWS
file.  So things covered in NEWS wouldn't have to be mentioned on the
wiki.

Thanks,
Florian
Florian Weimer March 14, 2019, 12:05 p.m. UTC | #15
* Carlos O'Donell:

> Reviewed-by: Carlos O'Donell <carlos@rehdat.com>

My pre-push testing revealed that my previous testing had been
insufficient, and I had to make the changes below.

(Hurd does not have any other GLIBC_2.30 reference, which is why had to
add the section to posix/Versions.)

Does your Reviewed-by: still stand?

Thanks,
Florian

diff --git a/ChangeLog b/ChangeLog
index cf62a1a1c8..1688c47781 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,4 @@
-2019-02-26  Florian Weimer  <fweimer@redhat.com>
+2019-03-14  Florian Weimer  <fweimer@redhat.com>
 
 	Remove obsolete, never-implemented XSI STREAMS declarations.
 	* manual/terminal.texi (Allocation): Remove portability note and
@@ -13,6 +13,9 @@
 	(conformtest-headers-POSIX2008): Likewise.
 	* posix/compat-streams.c: New file.
 	* posix/Makefile (routines): Add it.
+	* posix/Versions (GLIBC_2.1): Add fattach, fdetach, getmsg,
+	getpmsg, isastream, putmsg, putpmsg.
+	(GLIBC_2.30): New section.
 	* bits/stropts.h: Remove file.
 	* bits/xtitypes.h: Likewise.
 	* conform/data/stropts.h-data: Likewise.
diff --git a/posix/Versions b/posix/Versions
index ad693ae9a7..7d06a6d0c0 100644
--- a/posix/Versions
+++ b/posix/Versions
@@ -80,6 +80,10 @@ libc {
     # w*
     waitid; wordexp; wordfree;
   }
+  GLIBC_2.1 {
+    # Compat symbols for the obsolete, unimplemented XSI streams extension.
+    fattach; fdetach; getmsg; getpmsg; isastream; putmsg; putpmsg;
+  }
   GLIBC_2.1.2 {
     # functions used in other libraries
     __vfork;
@@ -141,6 +145,8 @@ libc {
     posix_spawn_file_actions_addchdir_np;
     posix_spawn_file_actions_addfchdir_np;
   }
+  GLIBC_2.30 {
+  }
   GLIBC_PRIVATE {
     __libc_fork; __libc_pread; __libc_pwrite;
     __nanosleep_nocancel; __pause_nocancel;
Carlos O'Donell March 14, 2019, 2:42 p.m. UTC | #16
On 3/14/19 8:05 AM, Florian Weimer wrote:
> * Carlos O'Donell:
> 
>> Reviewed-by: Carlos O'Donell <carlos@rehdat.com>
> 
> My pre-push testing revealed that my previous testing had been
> insufficient, and I had to make the changes below.
> 
> (Hurd does not have any other GLIBC_2.30 reference, which is why had to
> add the section to posix/Versions.)
> 
> Does your Reviewed-by: still stand?

Yes.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>

> Thanks,
> Florian
> 
> diff --git a/ChangeLog b/ChangeLog
> index cf62a1a1c8..1688c47781 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,4 +1,4 @@
> -2019-02-26  Florian Weimer  <fweimer@redhat.com>
> +2019-03-14  Florian Weimer  <fweimer@redhat.com>
>  
>  	Remove obsolete, never-implemented XSI STREAMS declarations.
>  	* manual/terminal.texi (Allocation): Remove portability note and
> @@ -13,6 +13,9 @@
>  	(conformtest-headers-POSIX2008): Likewise.
>  	* posix/compat-streams.c: New file.
>  	* posix/Makefile (routines): Add it.
> +	* posix/Versions (GLIBC_2.1): Add fattach, fdetach, getmsg,
> +	getpmsg, isastream, putmsg, putpmsg.
> +	(GLIBC_2.30): New section.

I'm *so* sorry, I thought about this and didn't mention it in my earlier
review.

* If GLIBC_2.30 isn't defined in any versions file then -Wundef will
  cause it to fail (because it's not in abi-versions.h for use with
  the compat reference. So I figured that you must have worked around this
  in some other way, but it seems like you found this failure in Hurd
  with a -Wundef failure, so that's working as expected. We've seen this
  kind of problem before and it was the impetus for the -Wundef changes.

* The other problem here is that you removed the version node for the
  existing compat symbols, and so they would probably not be exported.
  Sounds like you got the "not exported" case and got ABI testsuite
  failures.

I'm glad that the infrastructure caught all of this.

>  	* bits/stropts.h: Remove file.
>  	* bits/xtitypes.h: Likewise.
>  	* conform/data/stropts.h-data: Likewise.
> diff --git a/posix/Versions b/posix/Versions
> index ad693ae9a7..7d06a6d0c0 100644
> --- a/posix/Versions
> +++ b/posix/Versions
> @@ -80,6 +80,10 @@ libc {
>      # w*
>      waitid; wordexp; wordfree;
>    }
> +  GLIBC_2.1 {
> +    # Compat symbols for the obsolete, unimplemented XSI streams extension.
> +    fattach; fdetach; getmsg; getpmsg; isastream; putmsg; putpmsg;
> +  }

OK. Required for baseline for these symbols.

>    GLIBC_2.1.2 {
>      # functions used in other libraries
>      __vfork;
> @@ -141,6 +145,8 @@ libc {
>      posix_spawn_file_actions_addchdir_np;
>      posix_spawn_file_actions_addfchdir_np;
>    }
> +  GLIBC_2.30 {
> +  }

OK. Required for compat symbols.

>    GLIBC_PRIVATE {
>      __libc_fork; __libc_pread; __libc_pwrite;
>      __nanosleep_nocancel; __pause_nocancel;
>
Carlos O'Donell March 14, 2019, 3:24 p.m. UTC | #17
On 3/14/19 6:50 AM, Florian Weimer wrote:
> * Carlos O'Donell:
> 
>>> diff --git a/NEWS b/NEWS
>>> index 0a3b6c7a5a..1e66be0d11 100644
>>> --- a/NEWS
>>> +++ b/NEWS
>>> @@ -22,6 +22,9 @@ Deprecated and removed features, and other changes affecting compatibility:
>>>    definitions in libc will be used automatically, which have been available
>>>    since glibc 2.17.
>>>  
>>> +* The obsolete and never-implemented XSI STREAMS header files <stropts.h>
>>> +  and <sys/stropts.h> have been removed.
>>
>> OK. This might break builds, should it get a packaging change entry here?
>> https://sourceware.org/glibc/wiki/Release/2.30#Packaging_Changes
> 
> So far, I've considered the wiki as cumulative regarding to the NEWS
> file.  So things covered in NEWS wouldn't have to be mentioned on the
> wiki.

That is correct.

The packaging changes in the wiki are intended for verbose and expanded
discussions on the topic. If you had a desire to expand on the topic
then the NEWS is not the place for that.

For example in the Packaging Changes you might call out:
~~~
The recent removal of XSI STREAMS may break the build of older applications
that were relying on the stropts.h header but not actually using it for
anything (cargo culting the include). In this case the fix is relatively
easy, you drop the include. If the application had optional support for
streams, but always compiled them in, then you need to check that there
way to disable the streams support, otherwise you need to remove it entirely.
In the past there was a Linux kernel module that implemented streams, but
streams are no longer a supported interface, and have been obsoleted in
POSIX.
~~~
Florian Weimer March 14, 2019, 3:43 p.m. UTC | #18
* Carlos O'Donell:

> On 3/14/19 6:50 AM, Florian Weimer wrote:
>> * Carlos O'Donell:
>> 
>>>> diff --git a/NEWS b/NEWS
>>>> index 0a3b6c7a5a..1e66be0d11 100644
>>>> --- a/NEWS
>>>> +++ b/NEWS
>>>> @@ -22,6 +22,9 @@ Deprecated and removed features, and other changes affecting compatibility:
>>>>    definitions in libc will be used automatically, which have been available
>>>>    since glibc 2.17.
>>>>  
>>>> +* The obsolete and never-implemented XSI STREAMS header files <stropts.h>
>>>> +  and <sys/stropts.h> have been removed.
>>>
>>> OK. This might break builds, should it get a packaging change entry here?
>>> https://sourceware.org/glibc/wiki/Release/2.30#Packaging_Changes
>> 
>> So far, I've considered the wiki as cumulative regarding to the NEWS
>> file.  So things covered in NEWS wouldn't have to be mentioned on the
>> wiki.
>
> That is correct.
>
> The packaging changes in the wiki are intended for verbose and expanded
> discussions on the topic. If you had a desire to expand on the topic
> then the NEWS is not the place for that.
>
> For example in the Packaging Changes you might call out:
> ~~~
> The recent removal of XSI STREAMS may break the build of older applications
> that were relying on the stropts.h header but not actually using it for
> anything (cargo culting the include). In this case the fix is relatively
> easy, you drop the include. If the application had optional support for
> streams, but always compiled them in, then you need to check that there
> way to disable the streams support, otherwise you need to remove it entirely.
> In the past there was a Linux kernel module that implemented streams, but
> streams are no longer a supported interface, and have been obsoleted in
> POSIX.
> ~~~

I think it's not necessary; it will only take away attention from more
important issues.  We don't have <stropts.h> in Fedora, and I'm not
aware that we carry any patches which remove #include directives.

It's either not used at all on Linux, or disabled automatically if it's
not available.

Thanks,
Florian

Patch
diff mbox series

diff --git a/NEWS b/NEWS
index 0a3b6c7a5a..1e66be0d11 100644
--- a/NEWS
+++ b/NEWS
@@ -22,6 +22,9 @@  Deprecated and removed features, and other changes affecting compatibility:
   definitions in libc will be used automatically, which have been available
   since glibc 2.17.
 
+* The obsolete and never-implemented XSI STREAMS header files <stropts.h>
+  and <sys/stropts.h> have been removed.
+
 Changes to build and runtime requirements:
 
 * GCC 6.2 or later is required to build the GNU C Library.
diff --git a/bits/stropts.h b/bits/stropts.h
deleted file mode 100644
index 1e8742f3b6..0000000000
--- a/bits/stropts.h
+++ /dev/null
@@ -1,230 +0,0 @@ 
-/* Copyright (C) 1998-2019 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#ifndef _STROPTS_H
-# error "Never include <bits/stropts.h> directly; use <stropts.h> instead."
-#endif
-
-#ifndef _BITS_STROPTS_H
-#define _BITS_STROPTS_H	1
-
-#include <bits/types.h>
-
-/* Macros used as `request' argument to `ioctl'.  */
-#define __SID		('S' << 8)
-
-#define I_NREAD	    (__SID | 1)	/* Counts the number of data bytes in the data
-				   block in the first message.  */
-#define I_PUSH	    (__SID | 2)	/* Push STREAMS module onto top of the current
-				   STREAM, just below the STREAM head.  */
-#define I_POP	    (__SID | 3)	/* Remove STREAMS module from just below the
-				   STREAM head.  */
-#define I_LOOK	    (__SID | 4)	/* Retrieve the name of the module just below
-				   the STREAM head and place it in a character
-				   string.  */
-#define I_FLUSH	    (__SID | 5)	/* Flush all input and/or output.  */
-#define I_SRDOPT    (__SID | 6)	/* Sets the read mode.  */
-#define I_GRDOPT    (__SID | 7)	/* Returns the current read mode setting.  */
-#define I_STR	    (__SID | 8)	/* Construct an internal STREAMS `ioctl'
-				   message and send that message downstream. */
-#define I_SETSIG    (__SID | 9)	/* Inform the STREAM head that the process
-				   wants the SIGPOLL signal issued.  */
-#define I_GETSIG    (__SID |10) /* Return the events for which the calling
-				   process is currently registered to be sent
-				   a SIGPOLL signal.  */
-#define I_FIND	    (__SID |11) /* Compares the names of all modules currently
-				   present in the STREAM to the name pointed to
-				   by `arg'.  */
-#define I_LINK	    (__SID |12) /* Connect two STREAMs.  */
-#define I_UNLINK    (__SID |13) /* Disconnects the two STREAMs.  */
-#define I_PEEK	    (__SID |15) /* Allows a process to retrieve the information
-				   in the first message on the STREAM head read
-				   queue without taking the message off the
-				   queue.  */
-#define I_FDINSERT  (__SID |16) /* Create a message from the specified
-				   buffer(s), adds information about another
-				   STREAM, and send the message downstream.  */
-#define I_SENDFD    (__SID |17) /* Requests the STREAM associated with `fildes'
-				   to send a message, containing a file
-				   pointer, to the STREAM head at the other end
-				   of a STREAMS pipe.  */
-#define I_RECVFD    (__SID |14) /* Non-EFT definition.  */
-#define I_SWROPT    (__SID |19) /* Set the write mode.  */
-#define I_GWROPT    (__SID |20) /* Return the current write mode setting.  */
-#define I_LIST	    (__SID |21) /* List all the module names on the STREAM, up
-				   to and including the topmost driver name. */
-#define I_PLINK	    (__SID |22) /* Connect two STREAMs with a persistent
-				   link.  */
-#define I_PUNLINK   (__SID |23) /* Disconnect the two STREAMs that were
-				   connected with a persistent link.  */
-#define I_FLUSHBAND (__SID |28) /* Flush only band specified.  */
-#define I_CKBAND    (__SID |29) /* Check if the message of a given priority
-				   band exists on the STREAM head read
-				   queue.  */
-#define I_GETBAND   (__SID |30) /* Return the priority band of the first
-				   message on the STREAM head read queue.  */
-#define I_ATMARK    (__SID |31) /* See if the current message on the STREAM
-				   head read queue is "marked" by some module
-				   downstream.  */
-#define I_SETCLTIME (__SID |32) /* Set the time the STREAM head will delay when
-				   a STREAM is closing and there is data on
-				   the write queues.  */
-#define I_GETCLTIME (__SID |33) /* Get current value for closing timeout.  */
-#define I_CANPUT    (__SID |34) /* Check if a certain band is writable.  */
-
-
-/* Used in `I_LOOK' request.  */
-#define FMNAMESZ	8	/* compatibility w/UnixWare/Solaris.  */
-
-/* Flush options.  */
-#define FLUSHR		0x01	/* Flush read queues.  */
-#define FLUSHW		0x02	/* Flush write queues.  */
-#define FLUSHRW		0x03	/* Flush read and write queues.  */
-#ifdef __USE_GNU
-# define FLUSHBAND	0x04	/* Flush only specified band.  */
-#endif
-
-/* Possible arguments for `I_SETSIG'.  */
-#define S_INPUT		0x0001	/* A message, other than a high-priority
-				   message, has arrived.  */
-#define S_HIPRI		0x0002	/* A high-priority message is present.  */
-#define S_OUTPUT	0x0004	/* The write queue for normal data is no longer
-				   full.  */
-#define S_MSG		0x0008	/* A STREAMS signal message that contains the
-				   SIGPOLL signal reaches the front of the
-				   STREAM head read queue.  */
-#define S_ERROR		0x0010	/* Notification of an error condition.  */
-#define S_HANGUP	0x0020	/* Notification of a hangup.  */
-#define S_RDNORM	0x0040	/* A normal message has arrived.  */
-#define S_WRNORM	S_OUTPUT
-#define S_RDBAND	0x0080	/* A message with a non-zero priority has
-				   arrived.  */
-#define S_WRBAND	0x0100	/* The write queue for a non-zero priority
-				   band is no longer full.  */
-#define S_BANDURG	0x0200	/* When used in conjunction with S_RDBAND,
-				   SIGURG is generated instead of SIGPOLL when
-				   a priority message reaches the front of the
-				   STREAM head read queue.  */
-
-/* Option for `I_PEEK'.  */
-#define RS_HIPRI	0x01	/* Only look for high-priority messages.  */
-
-/* Options for `I_SRDOPT'.  */
-#define RNORM		0x0000	/* Byte-STREAM mode, the default.  */
-#define RMSGD		0x0001	/* Message-discard mode.   */
-#define RMSGN		0x0002	/* Message-nondiscard mode.   */
-#define RPROTDAT	0x0004	/* Deliver the control part of a message as
-				   data.  */
-#define RPROTDIS	0x0008	/* Discard the control part of a message,
-				   delivering any data part.  */
-#define RPROTNORM	0x0010	/* Fail `read' with EBADMSG if a message
-				   containing a control part is at the front
-				   of the STREAM head read queue.  */
-#ifdef __USE_GNU
-# define RPROTMASK	0x001C	/* The RPROT bits */
-#endif
-
-/* Possible mode for `I_SWROPT'.  */
-#define SNDZERO		0x001	/* Send a zero-length message downstream when a
-				   `write' of 0 bytes occurs.  */
-#ifdef __USE_GNU
-# define SNDPIPE	0x002	/* Send SIGPIPE on write and putmsg if
-				   sd_werror is set.  */
-#endif
-
-/* Arguments for `I_ATMARK'.  */
-#define ANYMARK		0x01	/* Check if the message is marked.  */
-#define LASTMARK	0x02	/* Check if the message is the last one marked
-				   on the queue.  */
-
-/* Argument for `I_UNLINK'.  */
-#ifdef __USE_GNU
-# define MUXID_ALL	(-1)	/* Unlink all STREAMs linked to the STREAM
-				   associated with `fildes'.  */
-#endif
-
-
-/* Macros for `getmsg', `getpmsg', `putmsg' and `putpmsg'.  */
-#define MSG_HIPRI	0x01	/* Send/receive high priority message.  */
-#define MSG_ANY		0x02	/* Receive any message.  */
-#define MSG_BAND	0x04	/* Receive message from specified band.  */
-
-/* Values returned by getmsg and getpmsg */
-#define MORECTL		1	/* More control information is left in
-				   message.  */
-#define MOREDATA	2	/* More data is left in message.  */
-
-
-/* Structure used for the I_FLUSHBAND ioctl on streams.  */
-struct bandinfo
-  {
-    unsigned char bi_pri;
-    int bi_flag;
-  };
-
-struct strbuf
-  {
-    int maxlen;		/* Maximum buffer length.  */
-    int len;		/* Length of data.  */
-    char *buf;		/* Pointer to buffer.  */
-  };
-
-struct strpeek
-  {
-    struct strbuf ctlbuf;
-    struct strbuf databuf;
-    t_uscalar_t flags;			/* UnixWare/Solaris compatibility.  */
-  };
-
-struct strfdinsert
-  {
-    struct strbuf ctlbuf;
-    struct strbuf databuf;
-    t_uscalar_t flags;			/* UnixWare/Solaris compatibility.  */
-    int fildes;
-    int offset;
-  };
-
-struct strioctl
-  {
-    int ic_cmd;
-    int ic_timout;
-    int ic_len;
-    char *ic_dp;
-  };
-
-struct strrecvfd
-  {
-    int fd;
-    uid_t uid;
-    gid_t gid;
-    char __fill[8];			/* UnixWare/Solaris compatibility */
-  };
-
-
-struct str_mlist
-  {
-    char l_name[FMNAMESZ + 1];
-  };
-
-struct str_list
-  {
-    int sl_nmods;
-    struct str_mlist *sl_modlist;
-  };
-
-#endif /* bits/stropts.h */
diff --git a/bits/xtitypes.h b/bits/xtitypes.h
deleted file mode 100644
index 92c8bca888..0000000000
--- a/bits/xtitypes.h
+++ /dev/null
@@ -1,33 +0,0 @@ 
-/* bits/xtitypes.h -- Define some types used by <bits/stropts.h>.  Generic.
-   Copyright (C) 2002-2019 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#ifndef _STROPTS_H
-# error "Never include <bits/xtitypes.h> directly; use <stropts.h> instead."
-#endif
-
-#ifndef _BITS_XTITYPES_H
-#define _BITS_XTITYPES_H	1
-
-#include <bits/types.h>
-
-/* This type is used by some structs in <bits/stropts.h>.  */
-typedef __SLONGWORD_TYPE __t_scalar_t;
-typedef __ULONGWORD_TYPE __t_uscalar_t;
-
-
-#endif /* bits/xtitypes.h */
diff --git a/conform/Makefile b/conform/Makefile
index 77709b86b9..f4314bc179 100644
--- a/conform/Makefile
+++ b/conform/Makefile
@@ -55,7 +55,7 @@  conformtest-headers-XPG4 := $(conformtest-headers-ISO) cpio.h dirent.h \
 # XPG42 includes XTI, but xti.h is outside the scope of these tests.
 conformtest-headers-XPG42 := $(conformtest-headers-XPG4) arpa/inet.h fmtmsg.h \
 			    libgen.h ndbm.h netdb.h netinet/in.h poll.h \
-			    strings.h stropts.h sys/mman.h sys/resource.h \
+			    strings.h sys/mman.h sys/resource.h \
 			    sys/socket.h sys/statvfs.h sys/time.h sys/timeb.h \
 			    sys/uio.h sys/un.h syslog.h ucontext.h utmpx.h
 # Missing UNIX98 expectations for: inttypes.h re_comp.h regexp.h.
@@ -66,7 +66,7 @@  conformtest-headers-UNIX98 := $(conformtest-headers-POSIX) arpa/inet.h cpio.h \
 			      dlfcn.h fmtmsg.h ftw.h iconv.h iso646.h \
 			      langinfo.h libgen.h monetary.h ndbm.h netdb.h \
 			      netinet/in.h nl_types.h poll.h search.h \
-			      strings.h stropts.h sys/ipc.h sys/msg.h \
+			      strings.h sys/ipc.h sys/msg.h \
 			      sys/resource.h sys/sem.h sys/shm.h sys/socket.h \
 			      sys/statvfs.h sys/time.h sys/timeb.h sys/uio.h \
 			      sys/un.h syslog.h ucontext.h ulimit.h utmpx.h \
@@ -78,7 +78,7 @@  conformtest-headers-XOPEN2K := $(conformtest-headers-POSIX) arpa/inet.h \
 			       libgen.h monetary.h ndbm.h net/if.h netdb.h \
 			       netinet/in.h netinet/tcp.h nl_types.h poll.h \
 			       search.h spawn.h stdbool.h stdint.h strings.h \
-			       stropts.h sys/ipc.h sys/msg.h sys/resource.h \
+			       sys/ipc.h sys/msg.h sys/resource.h \
 			       sys/select.h sys/sem.h sys/shm.h sys/socket.h \
 			       sys/statvfs.h sys/time.h sys/timeb.h sys/uio.h \
 			       sys/un.h syslog.h tgmath.h ucontext.h ulimit.h \
@@ -89,7 +89,7 @@  conformtest-headers-POSIX2008 := $(conformtest-headers-POSIX) arpa/inet.h \
 				 inttypes.h iso646.h langinfo.h monetary.h \
 				 net/if.h netdb.h netinet/in.h netinet/tcp.h \
 				 nl_types.h poll.h spawn.h stdbool.h stdint.h \
-				 strings.h stropts.h sys/select.h \
+				 strings.h sys/select.h \
 				 sys/socket.h sys/statvfs.h sys/un.h tgmath.h \
 				 wchar.h wctype.h
 # Missing XOPEN2K8 expectations for: trace.h.
diff --git a/conform/data/stropts.h-data b/conform/data/stropts.h-data
deleted file mode 100644
index c4b1343411..0000000000
--- a/conform/data/stropts.h-data
+++ /dev/null
@@ -1,140 +0,0 @@ 
-#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined XPG4
-type {struct bandinfo}
-
-element {struct bandinfo} {unsigned char} bi_pri
-element {struct bandinfo} int bi_flag
-
-type {struct strpeek}
-
-element {struct strpeek} {struct strbuf} ctlbuf
-element {struct strpeek} {struct strbuf} databuf
-element {struct strpeek} t_uscalar_t flags
-
-type {struct strbuf}
-
-element {struct strbuf} int maxlen
-element {struct strbuf} int len
-element {struct strbuf} {char*} buf
-
-type {struct strfdinsert}
-
-element {struct strfdinsert} {struct strbuf} ctlbuf
-element {struct strfdinsert} {struct strbuf} databuf
-element {struct strfdinsert} t_uscalar_t flags
-element {struct strfdinsert} int fildes
-element {struct strfdinsert} int offset
-
-type {struct strioctl}
-
-element {struct strioctl} int ic_cmd
-element {struct strioctl} int ic_timout
-element {struct strioctl} int ic_len
-element {struct strioctl} {char*} ic_dp
-
-type {struct strrecvfd}
-
-element {struct strrecvfd} int fd
-element {struct strrecvfd} uid_t uid
-element {struct strrecvfd} gid_t gid
-
-type uid_t
-type gid_t
-
-type t_uscalar_t
-
-type {struct str_list}
-
-element {struct str_list} int sl_nmods
-element {struct str_list} {struct str_mlist*} sl_modlist
-
-type {struct str_mlist}
-
-element {struct str_mlist} char l_name [FMNAMESZ+1]
-
-macro I_PUSH
-macro I_POP
-macro I_LOOK
-macro FMNAMESZ
-macro I_FLUSH
-macro FLUSHR
-macro FLUSHW
-macro FLUSHRW
-macro I_FLUSHBAND
-macro I_SETSIG
-macro S_RDNORM
-macro S_RDBAND
-macro S_INPUT
-macro S_HIPRI
-macro S_OUTPUT
-macro S_WRNORM
-macro S_WRBAND
-macro S_MSG
-macro S_ERROR
-macro S_HANGUP
-macro S_BANDURG
-macro I_GETSIG
-macro I_FIND
-macro I_PEEK
-macro RS_HIPRI
-macro I_SRDOPT
-macro RNORM
-macro RMSGD
-macro RMSGN
-macro RPROTNORM
-macro RPROTDAT
-macro RPROTDIS
-macro I_GRDOPT
-macro I_NREAD
-macro I_FDINSERT
-macro I_STR
-macro I_SWROPT
-macro SNDZERO
-macro I_GWROPT
-macro I_SENDFD
-macro I_RECVFD
-macro I_LIST
-macro I_ATMARK
-macro ANYMARK
-macro LASTMARK
-macro I_CKBAND
-macro I_GETBAND
-macro I_CANPUT
-macro I_SETCLTIME
-macro I_GETCLTIME
-macro I_LINK
-macro I_UNLINK
-macro I_PLINK
-macro I_PUNLINK
-
-macro MSG_ANY
-macro MSG_BAND
-macro MSG_HIPRI
-macro MORECTL
-macro MOREDATA
-
-function int isastream (int)
-function int getmsg (int, struct strbuf*, struct strbuf*, int*)
-function int getpmsg (int, struct strbuf*, struct strbuf*, int*, int*)
-// Bug 14362: wrong type for ioctl.
-xfail-function int ioctl (int, int, ...)
-function int putmsg (int, const struct strbuf*, const struct strbuf*, int)
-function int putpmsg (int, const struct strbuf*, const struct strbuf*, int, int)
-function int fattach (int, const char*)
-function int fdetach (const char*)
-
-allow-header unistd.h
-
-allow bi_*
-allow ic_*
-allow l_*
-allow sl_*
-allow str_*
-allow FLUSH*
-allow I_*
-allow M_*
-allow MUXID_R*
-allow S_*
-allow SND*
-allow STR*
-allow *_t
-#endif
diff --git a/include/stropts.h b/include/stropts.h
deleted file mode 100644
index 27ab60ac7f..0000000000
--- a/include/stropts.h
+++ /dev/null
@@ -1 +0,0 @@ 
-#include <streams/stropts.h>
diff --git a/include/sys/stropts.h b/include/sys/stropts.h
deleted file mode 100644
index 711f1502dd..0000000000
--- a/include/sys/stropts.h
+++ /dev/null
@@ -1 +0,0 @@ 
-#include <streams/sys/stropts.h>
diff --git a/posix/Makefile b/posix/Makefile
index 93c3a290d7..8ac6743ad7 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -64,7 +64,8 @@  routines :=								      \
 	spawnattr_getsigmask spawnattr_getschedpolicy spawnattr_getschedparam \
 	spawnattr_setsigmask spawnattr_setschedpolicy spawnattr_setschedparam \
 	posix_madvise							      \
-	get_child_max sched_cpucount sched_cpualloc sched_cpufree
+	get_child_max sched_cpucount sched_cpualloc sched_cpufree \
+	streams-compat
 
 aux		:= init-posix environ
 tests		:= test-errno tstgetopt testfnm runtests runptests \
diff --git a/posix/streams-compat.c b/posix/streams-compat.c
new file mode 100644
index 0000000000..30e9b5743a
--- /dev/null
+++ b/posix/streams-compat.c
@@ -0,0 +1,101 @@ 
+/* Compatibility symbols for the unimplemented XSI STREAMS extension.
+   Copyright (C) 1998-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <shlib-compat.h>
+
+#if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_30)
+
+# include <errno.h>
+# include <fcntl.h>
+
+struct strbuf;
+
+int
+attribute_compat_text_section
+fattach (int fildes, const char *path)
+{
+  __set_errno (ENOSYS);
+  return -1;
+}
+compat_symbol (libc, fattach, fattach, GLIBC_2_1);
+
+int
+attribute_compat_text_section
+fdetach (const char *path)
+{
+  __set_errno (ENOSYS);
+  return -1;
+}
+compat_symbol (libc, fdetach, fdetach, GLIBC_2_1);
+
+
+int
+attribute_compat_text_section
+getmsg (int fildes, struct strbuf *ctlptr, struct strbuf *dataptr, int *flagsp)
+{
+  __set_errno (ENOSYS);
+  return -1;
+}
+compat_symbol (libc, getmsg, getmsg, GLIBC_2_1);
+
+int
+attribute_compat_text_section
+getpmsg (int fildes, struct strbuf *ctlptr, struct strbuf *dataptr, int *bandp,
+	 int *flagsp)
+{
+  __set_errno (ENOSYS);
+  return -1;
+}
+compat_symbol (libc, getpmsg, getpmsg, GLIBC_2_1);
+
+int
+attribute_compat_text_section
+isastream (int fildes)
+{
+  /* In general we do not have a STREAMS implementation and therefore
+     return 0.  But for invalid file descriptors we have to return an
+     error.  */
+  if (__fcntl (fildes, F_GETFD) < 0)
+    return -1;
+
+  /* No STREAM.  */
+  return 0;
+}
+compat_symbol (libc, isastream, isastream, GLIBC_2_1);
+
+int
+attribute_compat_text_section
+putmsg (int fildes, const struct strbuf *ctlptr, const struct strbuf *dataptr,
+	int flags)
+{
+  __set_errno (ENOSYS);
+  return -1;
+}
+compat_symbol (libc, putmsg, putmsg, GLIBC_2_1);
+
+int
+attribute_compat_text_section
+putpmsg (int fildes, const struct strbuf *ctlptr, const struct strbuf *dataptr,
+	 int band, int flags)
+{
+  __set_errno (ENOSYS);
+  return -1;
+}
+compat_symbol (libc, putpmsg, putpmsg, GLIBC_2_1);
+
+#endif /* SHLIB_COMPAT */
diff --git a/streams/Makefile b/streams/Makefile
deleted file mode 100644
index 916147f382..0000000000
--- a/streams/Makefile
+++ /dev/null
@@ -1,28 +0,0 @@ 
-# Copyright (C) 1998-2019 Free Software Foundation, Inc.
-# This file is part of the GNU C Library.
-
-# The GNU C Library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-
-# The GNU C Library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-
-# You should have received a copy of the GNU Lesser General Public
-# License along with the GNU C Library; if not, see
-# <http://www.gnu.org/licenses/>.
-
-#
-#	Makefile for streams.
-#
-subdir	:= streams
-
-include ../Makeconfig
-
-headers		= stropts.h sys/stropts.h bits/stropts.h bits/xtitypes.h
-routines	= isastream getmsg getpmsg putmsg putpmsg fattach fdetach
-
-include ../Rules
diff --git a/streams/Versions b/streams/Versions
deleted file mode 100644
index 9a6f4d756c..0000000000
--- a/streams/Versions
+++ /dev/null
@@ -1,15 +0,0 @@ 
-libc {
-  GLIBC_2.1 {
-    # f*
-    fattach; fdetach;
-
-    # g*
-    getmsg; getpmsg;
-
-    # i*
-    isastream;
-
-    # p*
-    putmsg; putpmsg;
-  }
-}
diff --git a/streams/fattach.c b/streams/fattach.c
deleted file mode 100644
index 8ab904653a..0000000000
--- a/streams/fattach.c
+++ /dev/null
@@ -1,29 +0,0 @@ 
-/* Copyright (C) 1998-2019 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <errno.h>
-#include <stropts.h>
-
-int
-fattach (int fildes, const char *path)
-{
-  __set_errno (ENOSYS);
-  return -1;
-}
-
-
-stub_warning (fattach)
diff --git a/streams/fdetach.c b/streams/fdetach.c
deleted file mode 100644
index 2016b6699a..0000000000
--- a/streams/fdetach.c
+++ /dev/null
@@ -1,29 +0,0 @@ 
-/* Copyright (C) 1998-2019 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <errno.h>
-#include <stropts.h>
-
-int
-fdetach (const char *path)
-{
-  __set_errno (ENOSYS);
-  return -1;
-}
-
-
-stub_warning (fdetach)
diff --git a/streams/getmsg.c b/streams/getmsg.c
deleted file mode 100644
index 93bc0ddaf7..0000000000
--- a/streams/getmsg.c
+++ /dev/null
@@ -1,29 +0,0 @@ 
-/* Copyright (C) 1998-2019 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <errno.h>
-#include <stropts.h>
-
-int
-getmsg (int fildes, struct strbuf *ctlptr, struct strbuf *dataptr, int *flagsp)
-{
-  __set_errno (ENOSYS);
-  return -1;
-}
-
-
-stub_warning (getmsg)
diff --git a/streams/getpmsg.c b/streams/getpmsg.c
deleted file mode 100644
index b3912d38ab..0000000000
--- a/streams/getpmsg.c
+++ /dev/null
@@ -1,30 +0,0 @@ 
-/* Copyright (C) 1998-2019 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <errno.h>
-#include <stropts.h>
-
-int
-getpmsg (int fildes, struct strbuf *ctlptr, struct strbuf *dataptr, int *bandp,
-	 int *flagsp)
-{
-  __set_errno (ENOSYS);
-  return -1;
-}
-
-
-stub_warning (getpmsg)
diff --git a/streams/isastream.c b/streams/isastream.c
deleted file mode 100644
index 328b355c47..0000000000
--- a/streams/isastream.c
+++ /dev/null
@@ -1,33 +0,0 @@ 
-/* Copyright (C) 1998-2019 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <stropts.h>
-
-int
-isastream (int fildes)
-{
-  /* In general we do not have a STREAMS implementation and therefore
-     return 0.  But for invalid file descriptors we have to return an
-     error.  */
-  if (__fcntl (fildes, F_GETFD) < 0)
-    return -1;
-
-  /* No STREAM.  */
-  return 0;
-}
diff --git a/streams/putmsg.c b/streams/putmsg.c
deleted file mode 100644
index f6383b153a..0000000000
--- a/streams/putmsg.c
+++ /dev/null
@@ -1,30 +0,0 @@ 
-/* Copyright (C) 1998-2019 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <errno.h>
-#include <stropts.h>
-
-int
-putmsg (int fildes, const struct strbuf *ctlptr, const struct strbuf *dataptr,
-	int flags)
-{
-  __set_errno (ENOSYS);
-  return -1;
-}
-
-
-stub_warning (putmsg)
diff --git a/streams/putpmsg.c b/streams/putpmsg.c
deleted file mode 100644
index fac3d22c5d..0000000000
--- a/streams/putpmsg.c
+++ /dev/null
@@ -1,30 +0,0 @@ 
-/* Copyright (C) 1998-2019 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <errno.h>
-#include <stropts.h>
-
-int
-putpmsg (int fildes, const struct strbuf *ctlptr, const struct strbuf *dataptr,
-	 int band, int flags)
-{
-  __set_errno (ENOSYS);
-  return -1;
-}
-
-
-stub_warning (putpmsg)
diff --git a/streams/stropts.h b/streams/stropts.h
deleted file mode 100644
index 97b9428ee8..0000000000
--- a/streams/stropts.h
+++ /dev/null
@@ -1,92 +0,0 @@ 
-/* Copyright (C) 1998-2019 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#ifndef _STROPTS_H
-#define _STROPTS_H	1
-
-#include <features.h>
-#include <bits/types.h>
-#include <bits/xtitypes.h>
-
-#ifndef __gid_t_defined
-typedef __gid_t gid_t;
-# define __gid_t_defined
-#endif
-
-#ifndef __uid_t_defined
-typedef __uid_t uid_t;
-# define __uid_t_defined
-#endif
-
-typedef __t_scalar_t t_scalar_t;
-typedef __t_uscalar_t t_uscalar_t;
-
-/* Get system specific constants.  */
-#include <bits/stropts.h>
-
-
-__BEGIN_DECLS
-
-/* Test whether FILDES is associated with a STREAM-based file.  */
-extern int isastream (int __fildes) __THROW;
-
-/* Receive next message from a STREAMS file.
-
-   This function is a cancellation point and therefore not marked with
-   __THROW.  */
-extern int getmsg (int __fildes, struct strbuf *__restrict __ctlptr,
-		   struct strbuf *__restrict __dataptr,
-		   int *__restrict __flagsp);
-
-/* Receive next message from a STREAMS file, with *FLAGSP allowing to
-   control which message.
-
-   This function is a cancellation point and therefore not marked with
-   __THROW.  */
-extern int getpmsg (int __fildes, struct strbuf *__restrict __ctlptr,
-		    struct strbuf *__restrict __dataptr,
-		    int *__restrict __bandp, int *__restrict __flagsp);
-
-/* Perform the I/O control operation specified by REQUEST on FD.
-   One argument may follow; its presence and type depend on REQUEST.
-   Return value depends on REQUEST.  Usually -1 indicates error.  */
-extern int ioctl (int __fd, unsigned long int __request, ...) __THROW;
-
-/* Send a message on a STREAM.
-
-   This function is a cancellation point and therefore not marked with
-   __THROW.  */
-extern int putmsg (int __fildes, const struct strbuf *__ctlptr,
-		   const struct strbuf *__dataptr, int __flags);
-
-/* Send a message on a STREAM to the BAND.
-
-   This function is a cancellation point and therefore not marked with
-   __THROW.  */
-extern int putpmsg (int __fildes, const struct strbuf *__ctlptr,
-		    const struct strbuf *__dataptr, int __band, int __flags);
-
-/* Attach a STREAMS-based file descriptor FILDES to a file PATH in the
-   file system name space.  */
-extern int fattach (int __fildes, const char *__path) __THROW;
-
-/* Detach a name PATH from a STREAMS-based file descriptor.  */
-extern int fdetach (const char *__path) __THROW;
-
-__END_DECLS
-
-#endif /* stropts.h */
diff --git a/streams/sys/stropts.h b/streams/sys/stropts.h
deleted file mode 100644
index 5b5bc02f40..0000000000
--- a/streams/sys/stropts.h
+++ /dev/null
@@ -1 +0,0 @@ 
-#include <stropts.h>
diff --git a/sysdeps/ia64/bits/xtitypes.h b/sysdeps/ia64/bits/xtitypes.h
deleted file mode 100644
index f5d5f49c52..0000000000
--- a/sysdeps/ia64/bits/xtitypes.h
+++ /dev/null
@@ -1,33 +0,0 @@ 
-/* bits/xtitypes.h -- Define some types used by <bits/stropts.h>.  IA64
-   Copyright (C) 2002-2019 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#ifndef _STROPTS_H
-# error "Never include <bits/xtitypes.h> directly; use <stropts.h> instead."
-#endif
-
-#ifndef _BITS_XTITYPES_H
-#define _BITS_XTITYPES_H	1
-
-#include <bits/types.h>
-
-/* This type is used by some structs in <bits/stropts.h>.  */
-typedef __S32_TYPE __t_scalar_t;
-typedef __U32_TYPE __t_uscalar_t;
-
-
-#endif /* bits/xtitypes.h */
diff --git a/sysdeps/posix/sysconf.c b/sysdeps/posix/sysconf.c
index c1929b312f..0c4f9432e8 100644
--- a/sysdeps/posix/sysconf.c
+++ b/sysdeps/posix/sysconf.c
@@ -1116,11 +1116,7 @@  __sysconf (int name)
 #endif
 
     case _SC_STREAMS:
-#ifdef _XOPEN_STREAMS
-      return _XOPEN_STREAMS;
-#else
       return -1;
-#endif
 
     case _SC_HOST_NAME_MAX:
 #ifdef HOST_NAME_MAX
diff --git a/sysdeps/s390/bits/xtitypes.h b/sysdeps/s390/bits/xtitypes.h
deleted file mode 100644
index 2f207845d9..0000000000
--- a/sysdeps/s390/bits/xtitypes.h
+++ /dev/null
@@ -1,33 +0,0 @@ 
-/* bits/xtitypes.h -- Define some types used by <bits/stropts.h>.  S390/S390x
-   Copyright (C) 2002-2019 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#ifndef _STROPTS_H
-# error "Never include <bits/xtitypes.h> directly; use <stropts.h> instead."
-#endif
-
-#ifndef _BITS_XTITYPES_H
-#define _BITS_XTITYPES_H	1
-
-#include <bits/types.h>
-
-/* This type is used by some structs in <bits/stropts.h>.  */
-typedef __S32_TYPE __t_scalar_t;
-typedef __U32_TYPE __t_uscalar_t;
-
-
-#endif /* bits/xtitypes.h */
diff --git a/sysdeps/unix/inet/Subdirs b/sysdeps/unix/inet/Subdirs
index 0a02dd4447..90791e6e07 100644
--- a/sysdeps/unix/inet/Subdirs
+++ b/sysdeps/unix/inet/Subdirs
@@ -5,4 +5,3 @@  sunrpc
 nis
 nscd
 nss
-streams
diff --git a/sysdeps/unix/sysv/linux/i386/getmsg.c b/sysdeps/unix/sysv/linux/i386/getmsg.c
deleted file mode 100644
index 90a2788feb..0000000000
--- a/sysdeps/unix/sysv/linux/i386/getmsg.c
+++ /dev/null
@@ -1,33 +0,0 @@ 
-/* Copyright (C) 1998-2019 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <errno.h>
-#include <stddef.h>
-#include <stropts.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-
-#ifdef __NR_getpmsg
-int
-getmsg (int fildes, struct strbuf *ctlptr, struct strbuf *dataptr, int *flagsp)
-{
-  return INLINE_SYSCALL (getpmsg, 5, fildes, ctlptr, dataptr, NULL, flagsp);
-}
-#else
-# include <streams/getmsg.c>
-#endif
diff --git a/sysdeps/unix/sysv/linux/i386/putmsg.c b/sysdeps/unix/sysv/linux/i386/putmsg.c
deleted file mode 100644
index f1476cc89e..0000000000
--- a/sysdeps/unix/sysv/linux/i386/putmsg.c
+++ /dev/null
@@ -1,34 +0,0 @@ 
-/* Copyright (C) 1998-2019 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <errno.h>
-#include <stddef.h>
-#include <stropts.h>
-
-#include <sysdep.h>
-#include <sys/syscall.h>
-
-#ifdef __NR_putpmsg
-int
-putmsg (int fildes, const struct strbuf *ctlptr, const struct strbuf *dataptr,
-	int flags)
-{
-  return INLINE_SYSCALL (putpmsg, 5, fildes, ctlptr, dataptr, -1, flags);
-}
-#else
-# include <streams/putmsg.c>
-#endif
diff --git a/sysdeps/unix/sysv/linux/m68k/getmsg.c b/sysdeps/unix/sysv/linux/m68k/getmsg.c
deleted file mode 100644
index 3a1fa08525..0000000000
--- a/sysdeps/unix/sysv/linux/m68k/getmsg.c
+++ /dev/null
@@ -1 +0,0 @@ 
-#include <sysdeps/unix/sysv/linux/i386/getmsg.c>
diff --git a/sysdeps/unix/sysv/linux/m68k/putmsg.c b/sysdeps/unix/sysv/linux/m68k/putmsg.c
deleted file mode 100644
index ebc1680ca7..0000000000
--- a/sysdeps/unix/sysv/linux/m68k/putmsg.c
+++ /dev/null
@@ -1 +0,0 @@ 
-#include <sysdeps/unix/sysv/linux/i386/putmsg.c>
diff --git a/sysdeps/unix/sysv/linux/mips/getmsg.c b/sysdeps/unix/sysv/linux/mips/getmsg.c
deleted file mode 100644
index 3a1fa08525..0000000000
--- a/sysdeps/unix/sysv/linux/mips/getmsg.c
+++ /dev/null
@@ -1 +0,0 @@ 
-#include <sysdeps/unix/sysv/linux/i386/getmsg.c>
diff --git a/sysdeps/unix/sysv/linux/mips/putmsg.c b/sysdeps/unix/sysv/linux/mips/putmsg.c
deleted file mode 100644
index ebc1680ca7..0000000000
--- a/sysdeps/unix/sysv/linux/mips/putmsg.c
+++ /dev/null
@@ -1 +0,0 @@ 
-#include <sysdeps/unix/sysv/linux/i386/putmsg.c>
diff --git a/sysdeps/unix/sysv/linux/powerpc/getmsg.c b/sysdeps/unix/sysv/linux/powerpc/getmsg.c
deleted file mode 100644
index 3a1fa08525..0000000000
--- a/sysdeps/unix/sysv/linux/powerpc/getmsg.c
+++ /dev/null
@@ -1 +0,0 @@ 
-#include <sysdeps/unix/sysv/linux/i386/getmsg.c>
diff --git a/sysdeps/unix/sysv/linux/powerpc/putmsg.c b/sysdeps/unix/sysv/linux/powerpc/putmsg.c
deleted file mode 100644
index ebc1680ca7..0000000000
--- a/sysdeps/unix/sysv/linux/powerpc/putmsg.c
+++ /dev/null
@@ -1 +0,0 @@ 
-#include <sysdeps/unix/sysv/linux/i386/putmsg.c>
diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list
index 544ab5d54a..25424e1399 100644
--- a/sysdeps/unix/sysv/linux/syscalls.list
+++ b/sysdeps/unix/sysv/linux/syscalls.list
@@ -20,7 +20,6 @@  getegid		-	getegid		Ei:	__getegid	getegid
 geteuid		-	geteuid		Ei:	__geteuid	geteuid
 getpgid		-	getpgid		i:i	__getpgid	getpgid
 getpgrp		-	getpgrp		Ei:	getpgrp
-getpmsg		-	getpmsg		i:ipppp	getpmsg
 getppid		-	getppid		Ei:	__getppid	getppid
 getresuid	-	getresuid	i:ppp	getresuid
 getresgid	-	getresgid	i:ppp	getresgid
@@ -46,7 +45,6 @@  pipe		-	pipe		i:f	__pipe		pipe
 pipe2		-	pipe2		i:fi	__pipe2		pipe2
 pivot_root	EXTRA	pivot_root	i:ss	pivot_root
 prctl		EXTRA	prctl		i:iiiii	__prctl		prctl
-putpmsg		-	putpmsg		i:ippii	putpmsg
 query_module	EXTRA	query_module	i:sipip	__compat_query_module	query_module@GLIBC_2.0:GLIBC_2.23
 quotactl	EXTRA	quotactl	i:isip	quotactl
 remap_file_pages -	remap_file_pages i:piiii	__remap_file_pages remap_file_pages
diff --git a/sysdeps/x86/bits/xtitypes.h b/sysdeps/x86/bits/xtitypes.h
deleted file mode 100644
index 4d045415a8..0000000000
--- a/sysdeps/x86/bits/xtitypes.h
+++ /dev/null
@@ -1,33 +0,0 @@ 
-/* bits/xtitypes.h -- Define some types used by <bits/stropts.h>.  x86-64.
-   Copyright (C) 2002-2019 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#ifndef _STROPTS_H
-# error "Never include <bits/xtitypes.h> directly; use <stropts.h> instead."
-#endif
-
-#ifndef _BITS_XTITYPES_H
-#define _BITS_XTITYPES_H	1
-
-#include <bits/types.h>
-
-/* This type is used by some structs in <bits/stropts.h>.  */
-typedef __SLONG32_TYPE __t_scalar_t;
-typedef __ULONG32_TYPE __t_uscalar_t;
-
-
-#endif /* bits/xtitypes.h */