diff options
author | Florian Weimer <fweimer@redhat.com> | 2019-03-14 15:44:14 +0100 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2019-03-14 15:44:15 +0100 |
commit | a0a0dc83173ce11ff45105fd32e5d14356cdfb9c (patch) | |
tree | 8487bfd04a8a2975c062be571379e02b994f2aa2 /posix | |
parent | 081bdf942126b7d4a368d09438a06fd831c14dad (diff) | |
download | glibc-a0a0dc83173ce11ff45105fd32e5d14356cdfb9c.tar glibc-a0a0dc83173ce11ff45105fd32e5d14356cdfb9c.tar.gz glibc-a0a0dc83173ce11ff45105fd32e5d14356cdfb9c.tar.bz2 glibc-a0a0dc83173ce11ff45105fd32e5d14356cdfb9c.zip |
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.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'posix')
-rw-r--r-- | posix/Makefile | 3 | ||||
-rw-r--r-- | posix/Versions | 6 | ||||
-rw-r--r-- | posix/streams-compat.c | 101 |
3 files changed, 109 insertions, 1 deletions
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/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; 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 */ |