1/* Compatibility symbols for the unimplemented XSI STREAMS extension.
2 Copyright (C) 1998-2022 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */
18
19#include <shlib-compat.h>
20
21#if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_30)
22
23# include <errno.h>
24# include <fcntl.h>
25
26struct strbuf;
27
28int
29attribute_compat_text_section
30fattach (int fildes, const char *path)
31{
32 __set_errno (ENOSYS);
33 return -1;
34}
35compat_symbol (libc, fattach, fattach, GLIBC_2_1);
36
37int
38attribute_compat_text_section
39fdetach (const char *path)
40{
41 __set_errno (ENOSYS);
42 return -1;
43}
44compat_symbol (libc, fdetach, fdetach, GLIBC_2_1);
45
46
47int
48attribute_compat_text_section
49getmsg (int fildes, struct strbuf *ctlptr, struct strbuf *dataptr, int *flagsp)
50{
51 __set_errno (ENOSYS);
52 return -1;
53}
54compat_symbol (libc, getmsg, getmsg, GLIBC_2_1);
55
56int
57attribute_compat_text_section
58getpmsg (int fildes, struct strbuf *ctlptr, struct strbuf *dataptr, int *bandp,
59 int *flagsp)
60{
61 __set_errno (ENOSYS);
62 return -1;
63}
64compat_symbol (libc, getpmsg, getpmsg, GLIBC_2_1);
65
66int
67attribute_compat_text_section
68isastream (int fildes)
69{
70 /* In general we do not have a STREAMS implementation and therefore
71 return 0. But for invalid file descriptors we have to return an
72 error. */
73 if (__fcntl (fildes, F_GETFD) < 0)
74 return -1;
75
76 /* No STREAM. */
77 return 0;
78}
79compat_symbol (libc, isastream, isastream, GLIBC_2_1);
80
81int
82attribute_compat_text_section
83putmsg (int fildes, const struct strbuf *ctlptr, const struct strbuf *dataptr,
84 int flags)
85{
86 __set_errno (ENOSYS);
87 return -1;
88}
89compat_symbol (libc, putmsg, putmsg, GLIBC_2_1);
90
91int
92attribute_compat_text_section
93putpmsg (int fildes, const struct strbuf *ctlptr, const struct strbuf *dataptr,
94 int band, int flags)
95{
96 __set_errno (ENOSYS);
97 return -1;
98}
99compat_symbol (libc, putpmsg, putpmsg, GLIBC_2_1);
100
101#endif /* SHLIB_COMPAT */
102

source code of glibc/posix/streams-compat.c