about summary refs log tree commit diff
path: root/sysdeps/mach/hurd/if_index.c
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright dates with scripts/update-copyrightsPaul Eggert2024-01-011-1/+1
|
* hurd: Use __hurd_fail () instead of assigning errnoSergey Bugaev2023-05-201-7/+4
| | | | | | | | | | | | | | The __hurd_fail () inline function is the dedicated, idiomatic way of reporting errors in the Hurd part of glibc. Not only is it more concise than '{ errno = err; return -1; }', it is since commit 6639cc10029e24e06b34e169712b21c31b8cf213 "hurd: Mark error functions as __COLD" marked with the cold attribute, telling the compiler that this codepath is unlikely to be executed. In one case, use __hurd_dfail () over the plain __hurd_fail (). Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230520115531.3911877-1-bugaevc@gmail.com>
* hurd: Use proper integer typesSergey Bugaev2023-02-201-1/+1
| | | | | | | | Fix a few more cases of build errors caused by mismatched types. This is a continuation of f4315054b46d5e58b44a709a51943fb73f846afb. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230218203717.373211-3-bugaevc@gmail.com>
* Update copyright dates with scripts/update-copyrightsJoseph Myers2023-01-061-1/+1
|
* Update copyright dates with scripts/update-copyrightsPaul Eggert2022-01-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | I used these shell commands: ../glibc/scripts/update-copyrights $PWD/../gnulib/build-aux/update-copyright (cd ../glibc && git commit -am"[this commit message]") and then ignored the output, which consisted lines saying "FOO: warning: copyright statement not found" for each of 7061 files FOO. I then removed trailing white space from math/tgmath.h, support/tst-support-open-dev-null-range.c, and sysdeps/x86_64/multiarch/strlen-vec.S, to work around the following obscure pre-commit check failure diagnostics from Savannah. I don't know why I run into these diagnostics whereas others evidently do not. remote: *** 912-#endif remote: *** 913: remote: *** 914- remote: *** error: lines with trailing whitespace found ... remote: *** error: sysdeps/unix/sysv/linux/statx_cp.c: trailing lines
* hurd if_index: Explicitly use AF_INET for if index discoverySamuel Thibault2021-10-181-3/+3
| | | | | | | 5bf07e1b3a74 ("Linux: Simplify __opensock and fix race condition [BZ #28353]") made __opensock try NETLINK then UNIX then INET. On the Hurd, only INET knows about network interfaces, so better actually specify that in if_index.
* Annotate additional APIs with GCC attribute access.Martin Sebor2021-05-061-1/+1
| | | | | | | | | | | | | | | | This change continues the improvements to compile-time out of bounds checking by decorating more APIs with either attribute access, or by explicitly providing the array bound in APIs such as tmpnam() that expect arrays of some minimum size as arguments. (The latter feature is new in GCC 11.) The only effects of the attribute and/or the array bound is to check and diagnose calls to the functions that fail to provide a sufficient number of elements, and the definitions of the functions that access elements outside the specified bounds. (There is no interplay with _FORTIFY_SOURCE here yet.) Tested with GCC 7 through 11 on x86_64-linux.
* Update copyright dates with scripts/update-copyrightsPaul Eggert2021-01-021-1/+1
| | | | | | | | | | | | | | | | I used these shell commands: ../glibc/scripts/update-copyrights $PWD/../gnulib/build-aux/update-copyright (cd ../glibc && git commit -am"[this commit message]") and then ignored the output, which consisted lines saying "FOO: warning: copyright statement not found" for each of 6694 files FOO. I then removed trailing white space from benchtests/bench-pthread-locks.c and iconvdata/tst-iconv-big5-hkscs-to-2ucs4.c, to work around this diagnostic from Savannah: remote: *** pre-commit check failed ... remote: *** error: lines with trailing whitespace found remote: error: hook declined to update refs/heads/master
* Update copyright dates with scripts/update-copyrights.Joseph Myers2020-01-011-1/+1
|
* Prefer https to http for gnu.org and fsf.org URLsPaul Eggert2019-09-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also, change sources.redhat.com to sourceware.org. This patch was automatically generated by running the following shell script, which uses GNU sed, and which avoids modifying files imported from upstream: sed -ri ' s,(http|ftp)(://(.*\.)?(gnu|fsf|sourceware)\.org($|[^.]|\.[^a-z])),https\2,g s,(http|ftp)(://(.*\.)?)sources\.redhat\.com($|[^.]|\.[^a-z]),https\2sourceware.org\4,g ' \ $(find $(git ls-files) -prune -type f \ ! -name '*.po' \ ! -name 'ChangeLog*' \ ! -path COPYING ! -path COPYING.LIB \ ! -path manual/fdl-1.3.texi ! -path manual/lgpl-2.1.texi \ ! -path manual/texinfo.tex ! -path scripts/config.guess \ ! -path scripts/config.sub ! -path scripts/install-sh \ ! -path scripts/mkinstalldirs ! -path scripts/move-if-change \ ! -path INSTALL ! -path locale/programs/charmap-kw.h \ ! -path po/libc.pot ! -path sysdeps/gnu/errlist.c \ ! '(' -name configure \ -execdir test -f configure.ac -o -f configure.in ';' ')' \ ! '(' -name preconfigure \ -execdir test -f preconfigure.ac ';' ')' \ -print) and then by running 'make dist-prepare' to regenerate files built from the altered files, and then executing the following to cleanup: chmod a+x sysdeps/unix/sysv/linux/riscv/configure # Omit irrelevant whitespace and comment-only changes, # perhaps from a slightly-different Autoconf version. git checkout -f \ sysdeps/csky/configure \ sysdeps/hppa/configure \ sysdeps/riscv/configure \ sysdeps/unix/sysv/linux/csky/configure # Omit changes that caused a pre-commit check to fail like this: # remote: *** error: sysdeps/powerpc/powerpc64/ppc-mcount.S: trailing lines git checkout -f \ sysdeps/powerpc/powerpc64/ppc-mcount.S \ sysdeps/unix/sysv/linux/s390/s390-64/syscall.S # Omit change that caused a pre-commit check to fail like this: # remote: *** error: sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S: last line does not end in newline git checkout -f sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S
* Update copyright dates with scripts/update-copyrights.Joseph Myers2019-01-011-1/+1
| | | | | | | * All files with FSF copyright notices: Update copyright dates using scripts/update-copyrights. * locale/programs/charmap-kw.h: Regenerated. * locale/programs/locfile-kw.h: Likewise.
* hurd: Fix typoSamuel Thibault2018-04-041-1/+1
| | | | * sysdeps/mach/hurd/if_index.c (__if_nametoindex): Fix typo in IFNAMSIZ.
* hurd: Fix missing trailing NUL in __if_nametoindexSamuel Thibault2018-04-041-1/+1
| | | | | * sysdeps/mach/hurd/if_index.c (__if_nametoindex): Pass the whole buffer size to strncpy.
* hurd: Make __if_nametoindex return ENODEV if ifname is too longSamuel Thibault2018-04-031-2/+6
| | | | | | | rather than truncating it. * sysdeps/mach/hurd/if_index.c (__if_nametoindex): Return ENODEV if ifname is too long.
* hurd: Fix buffer overrun in __if_nametoindexSamuel Thibault2018-04-031-1/+3
| | | | | | | and building with mainline GCC which reports it. * sysdeps/mach/hurd/if_index.c (__if_nametoindex): Always end ifr.fr_name with a NUL caracter.
* Update copyright dates with scripts/update-copyrights.Joseph Myers2018-01-011-1/+1
| | | | | | | * All files with FSF copyright notices: Update copyright dates using scripts/update-copyrights. * locale/programs/charmap-kw.h: Regenerated. * locale/programs/locfile-kw.h: Likewise.
* inet: Remove internal_function attributeFlorian Weimer2017-08-311-1/+0
|
* Update copyright dates with scripts/update-copyrights.Joseph Myers2017-01-011-1/+1
|
* Update copyright dates with scripts/update-copyrights.Joseph Myers2016-01-041-1/+1
|
* Fix hurd build with hidden supportSamuel Thibault2015-11-251-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | * hurd/sigunwind.c (_hurdsig_longjmp_from_handler): Destroy reply port of interrupted RPC instead of restoring it. * sysdeps/i386/setjmp.S (__sigsetjmp): Add hidden_def. * sysdeps/mach/hurd/accept4.c (__libc_accept4): Remove libc_hidden_def. * sysdeps/mach/hurd/dl-sysdep.c (__libc_stack_end): Add relro attribute, define rtld_hidden_data_def. * sysdeps/mach/hurd/fxstatat64.c (__fxstatat64): Add libc_hidden_def. * sysdeps/mach/hurd/if_index.c (__if_freenameindex): Add libc_hidden_def. (if_freenameindex): Add libc_hidden_weak. (if_nameindex): Add libc_hidden_weak. * sysdeps/mach/hurd/open.c (_open64): Rename libc_hidden_weak into __open64. * sysdeps/mach/hurd/sigwait.c (__sigwait): Add libc_hidden_def. * sysdeps/mach/hurd/xmknodat.c (__xmknodat): Add libc_hidden_def. * sysdeps/mach/nanosleep.c: Include <time.h> (__nanosleep): Rename to __libc_nanosleep. (__nanosleep): Add weak_alias. (nanosleep): Update alias. * sysdeps/mach/hurd/configure.ac (NO_HIDDEN): Do not define. * sysdeps/mach/hurd/configure: Regenerate.
* Update copyright dates with scripts/update-copyrights.Joseph Myers2015-01-021-1/+1
|
* Fix resolver if_* namespace (bug 17717).Joseph Myers2014-12-161-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resolver code, brought in by pthreads (at least), uses if_* interfaces that weren't in POSIX before 2001, resulting in linknamespace failures. This patch changes those interfaces to be weak aliases of __if_* and makes the resolver use __if_* directly. Tested for x86_64 (testsuite, and that disassembly of installed shared libraries is unchanged by this patch). [BZ #17717] * inet/if_index.c (if_nametoindex): Rename to __if_nametoindex and define as weak alias of __if_nametoindex. Use libc_hidden_weak. (if_indextoname): Rename to __if_indextoname and define as weak alias of __if_indextoname. Use libc_hidden_weak. (if_freenameindex): Rename to __if_freenameindex and define as weak alias of __if_freenameindex. (if_nameindex): Rename to __if_nameindex and define as weak alias of __if_nameindex. * sysdeps/mach/hurd/if_index.c (if_nametoindex): Rename to __if_nametoindex and define as weak alias of __if_nametoindex. Use libc_hidden_weak. (if_freenameindex): Rename to __if_freenameindex and define as weak alias of __if_freenameindex. (if_nameindex): Rename to __if_nameindex and define as weak alias of __if_nameindex. (if_indextoname): Rename to __if_indextoname and define as weak alias of __if_indextoname. Use libc_hidden_weak. * sysdeps/unix/sysv/linux/if_index.c (if_nametoindex): Rename to __if_nametoindex and define as weak alias of __if_nametoindex. Use libc_hidden_weak. (if_freenameindex): Rename to __if_freenameindex and define as weak alias of __if_freenameindex. Use libc_hidden_weak. (if_nameindex_netlink): Use __if_freenameindex instead of if_freenameindex. (if_nameindex): Rename to __if_nameindex and define as weak alias of __if_nameindex. Use libc_hidden_weak. (if_indextoname): Rename to __if_indextoname and define as weak alias of __if_indextoname. Use libc_hidden_weak. * include/net/if.h [!_ISOMAC] (__if_nametoindex): Declare and use libc_hidden_proto. [!_ISOMAC] (__if_freenameindex): Likewise. * resolv/res_init.c (__res_vinit): Use __if_nametoindex instead of if_nametoindex. * conform/Makefile (test-xfail-XPG4/grp.h/linknamespace): Remove variable. (test-xfail-XPG4/pwd.h/linknamespace): Likewise. (test-xfail-UNIX98/aio.h/linknamespace): Likewise. (test-xfail-UNIX98/grp.h/linknamespace): Likewise. (test-xfail-UNIX98/pthread.h/linknamespace): Likewise. (test-xfail-UNIX98/pwd.h/linknamespace): Likewise. (test-xfail-UNIX98/sched.h/linknamespace): Likewise. (test-xfail-UNIX98/time.h/linknamespace): Likewise.
* Update copyright notices with scripts/update-copyrightsAllan McRae2014-01-011-1/+1
|
* Update copyright notices with scripts/update-copyrights.Joseph Myers2013-01-021-1/+1
|
* Replace FSF snail mail address with URLs.Paul Eggert2012-02-091-3/+2
|
* Remove useless "if" before "free".Ulrich Drepper2008-03-191-2/+1
|
* * include/sys/wait.h (__waitpid): Add libc_hidden_proto.Roland McGrath2002-08-131-0/+2
| | | | | | | | | | | | | | | | | | | | | * sysdeps/unix/sysv/sco3.2.4/waitpid.S: Add libc_hidden_def. * sysdeps/unix/sysv/sysv4/waitpid.c: Add libc_hidden_weak. * sysdeps/unix/sysv/linux/waitpid.c: Likewise. * sysdeps/unix/sysv/aix/waitpid.c: Likewise. * sysdeps/unix/bsd/bsd4.4/waitpid.c: Likewise. * sysdeps/generic/waitpid.c: Likewise. * include/net/if.h: New file. Use libc_hidden_proto for if_nametoindex and if_indextoname. * sysdeps/generic/if_index.c: Add libc_hidden_def. * sysdeps/mach/hurd/if_index.c: Likewise. * sysdeps/unix/sysv/linux/if_index.c: Likewise. * include/grp.h (setgroups): Add libc_hidden_proto. * sysdeps/generic/setgroups.c: Add libc_hidden_def. * sysdeps/mach/hurd/setgroups.c: Likewise. * sysdeps/unix/sysv/irix4/setgroups.c: Likewise. * sysdeps/unix/sysv/linux/i386/setgroups.c: Likewise.
* * sysdeps/mach/hurd/dl-sysdep.c (_dl_sysdep_start: go): Fix arg type.Roland McGrath2002-06-131-7/+6
| | | | | * sysdeps/mach/hurd/if_index.c (if_nameindex): Use size_t for AMOUNT argument to pfinet_siocgifconf RPC.
* Update to LGPL v2.1.Andreas Jaeger2001-07-061-8/+8
| | | | | | | | | | | | | | 2001-07-06 Paul Eggert <eggert@twinsun.com> * manual/argp.texi: Remove ignored LGPL copyright notice; it's not appropriate for documentation anyway. * manual/libc-texinfo.sh: "Library General Public License" -> "Lesser General Public License". 2001-07-06 Andreas Jaeger <aj@suse.de> * All files under GPL/LGPL version 2: Place under LGPL version 2.1.
* * sysdeps/mach/hurd/if_index.c: Redone to use new interfaces in the Hurd ↵Mark Kettenis2001-07-011-109/+131
| | | | | | | | | | | | | | | | | | | | pfinet server, using equivalent code from the Linux version in sysdeps/unix/sysv/linux/if_index.c. In detail: Include <unistd.h>, <error.h>, <sys/ioctl.h>, <hurd/ioctl.h> and <hurd/pfinet.h>. Don't include <sys/mman.h> and <hurd/fsys.h> anymore. (if_nametoindex): New implementation using SIOCGIFINDEX. (if_freenameindex): Straight copy of the Linux version. (if_nameindex): New implementation based on pfinet_siocgifconf and SIOCGIFINDEX. (if_indextoname): New implementation using SIOCGIFNAME. (map_interfaces): Function removed. From Marcus Brinkmann <marcus@gnu.org>. 2001-07-01 Mark Kettenis <kettenis@gnu.org> * sysdeps/mach/hurd/if_index.c: Redone to use new interfaces in the Hurd pfinet server, using equivalent code from the Linux version in sysdeps/unix/sysv/linux/if_index.c. In detail: Include <unistd.h>, <error.h>, <sys/ioctl.h>, <hurd/ioctl.h> and <hurd/pfinet.h>. Don't include <sys/mman.h> and <hurd/fsys.h> anymore. (if_nametoindex): New implementation using SIOCGIFINDEX. (if_freenameindex): Straight copy of the Linux version. (if_nameindex): New implementation based on pfinet_siocgifconf and SIOCGIFINDEX. (if_indextoname): New implementation using SIOCGIFNAME. (map_interfaces): Function removed. From Marcus Brinkmann <marcus@gnu.org>.
* (__protocol_available): Uncomment, it's not needed at the moment.Andreas Jaeger2000-12-271-1/+2
|
* * sysdeps/mach/hurd/if_index.c: New file.Roland McGrath2000-03-241-0/+166
* sysdeps/unix/sysv/linux/net/if.h: Moved to ... * sysdeps/gnu/net/if.h: here. (_IOT_ifconf, _IOT_ifreq): Hurd ioctl type macros moved from ... * sysdeps/mach/hurd/net/if.h: ... here; this file now removed. * sysdeps/generic/net/if.h: New file. Declares just the standard functions and `struct if_nameindex' type. * socket/Makefile (headers): Add net/if.h here. * sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Not here. * sysdeps/mach/hurd/Dist: Remove it here. * sysdeps/unix/sysv/linux/Dist: And here. * sysdeps/generic/if_index.c: Include <net/if.h>.