Commit Graph

20 Commits

Author SHA1 Message Date
Samuel Thibault 7ae60af75b hurd: Factorize at/non-at functions
Non-at functions can be implemented by just calling the corresponding at
function with AT_FDCWD and zero at_flags.

In the linkat case, the at behavior is different (O_NOLINK), so this introduces
__linkat_common to pass O_NOLINK as appropriate.

lstat functions can also be implemented with fstatat by adding
__fstatat64_common which takes a flags parameter in addition to the at_flags
parameter,

In the end this factorizes chmod, chown, link, lstat64, mkdir, readlink,
rename, stat64, symlink, unlink, utimes.

This also makes __lstat, __lxstat64, __stat and __xstat64 directly use
__fstatat64_common instead of __lstat64 or __stat64.
2022-09-17 19:58:30 +00:00
Paul Eggert 581c785bf3 Update copyright dates with scripts/update-copyrights
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
2022-01-01 11:40:24 -08:00
Adhemerval Zanella 46c1c765d1 Revert "linux: Move {f}xstat{at} to compat symbols" for static build
This reverts commit 20b39d5946 for static
library.  This avoids the need to rebuild the world for the case where
libstdc++ (and potentially other libraries) are linked to a old glibc.

To avoid requering to provide xstat symbols for newer ABIs (such as
riscv32) a new LIB_COMPAT macro is added.  It is similar to SHLIB_COMPAT
but also works for static case (thus evaluating similar to SHLIB_COMPAT
for both shared and static case).

Checked with a check-abi on all affected ABIs. I also check if the
static library does contains the xstat symbols.
2021-01-21 14:11:53 -03:00
Paul Eggert 2b778ceb40 Update copyright dates with scripts/update-copyrights
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
2021-01-02 12:17:34 -08:00
Samuel Thibault 85741f7eba hurd: Move {,f,l}xstat{,at} and xmknod{at} to compat symbols
We do not actually need them, so we can move their implementations
into the standard {,f,l}stat{,at} variants and only keep compatibility
wrappers.
2020-11-11 23:56:56 +00:00
Joseph Myers d614a75396 Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
Paul Eggert 5a82c74822 Prefer https to http for gnu.org and fsf.org URLs
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
2019-09-07 02:43:31 -07:00
Joseph Myers 04277e02d7 Update copyright dates with scripts/update-copyrights.
* 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.
2019-01-01 00:11:28 +00:00
Joseph Myers 688903eb3e Update copyright dates with scripts/update-copyrights.
* 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.
2018-01-01 00:32:25 +00:00
Joseph Myers bfff8b1bec Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
Joseph Myers f7a9f785e5 Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
Joseph Myers b168057aaa Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
Allan McRae d4697bc93d Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
Joseph Myers 568035b787 Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
Paul Eggert 59ba27a63a Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
Roland McGrath df9629171c * include/unistd.h (seteuid, setegid): Add libc_hidden_proto.
* sysdeps/generic/seteuid.c (seteuid): Add libc_hidden_def.
	* sysdeps/generic/setegid.c (setegid): Likewise.
	* sysdeps/mach/hurd/seteuid.c (seteuid): Likewise.
	* sysdeps/mach/hurd/setegid.c (setegid): Likewise.
	* sysdeps/unix/bsd/seteuid.c (seteuid): Likewise.
	* sysdeps/unix/bsd/setegid.c (setegid): Likewise.
	* sysdeps/unix/sysv/aix/seteuid.c (seteuid): Likewise.
	* sysdeps/unix/sysv/aix/setegid.c (setegid): Likewise.
	* sysdeps/unix/sysv/linux/i386/setegid.c (setegid): Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/seteuid.c (seteuid): Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/setegid.c (setegid): Likewise.
	* sysdeps/unix/sysv/linux/seteuid.c (seteuid): Likewise.
	* sysdeps/unix/sysv/linux/setegid.c (setegid): Likewise.
	* sysdeps/unix/sysv/linux/i386/seteuid.c (seteuid): Likewise.
	Remove fallback if __ASSUME_SETRESUID_SYSCALL.

	* include/sys/stat.h (__fxstat_internal, __fxstat64_internal,
	__lxstat_internal, __lxstat64_internal): Remove.
	(__fxstat, __fxstat64, __lxstat, __lxstat64, __xstat, __xstat64):
	Add hidden_proto.
	* sysdeps/generic/fxstat.c (__fxstat): Add hidden_def.
	Remove INTDEF where present, remove #undef at the beginning.
	* sysdeps/generic/fxstat64.c (__fxstat64): Likewise.
	* sysdeps/generic/lxstat.c (__lxstat): Likewise.
	* sysdeps/generic/lxstat64.c (__lxstat64): Likewise.
	* sysdeps/generic/xstat.c (__xstat): Likewise.
	* sysdeps/generic/xstat64.c (__xstat64): Likewise.
	* sysdeps/mach/hurd/dl-sysdep.c (__xstat64, __fxstat64): Likewise.
	* sysdeps/mach/hurd/fxstat.c (__fxstat): Likewise.
	* sysdeps/mach/hurd/fxstat64.c (__fxstat64): Likewise.
	* sysdeps/mach/hurd/lxstat.c (__lxstat): Likewise.
	* sysdeps/mach/hurd/lxstat64.c (__lxstat64): Likewise.
	* sysdeps/mach/hurd/xstat.c (__xstat): Likewise.
	* sysdeps/mach/hurd/xstat64.c (__xstat64): Likewise.
	* sysdeps/unix/fxstat.c (__fxstat): Likewise.
	* sysdeps/unix/common/lxstat.c (__lxstat): Likewise.
	* sysdeps/unix/sysv/aix/fxstat.c (__fxstat): Likewise.
	* sysdeps/unix/sysv/aix/fxstat64.c (__fxstat64): Likewise.
	* sysdeps/unix/sysv/aix/lxstat.c (__lxstat): Likewise.
	* sysdeps/unix/sysv/aix/lxstat64.c (__lxstat64): Likewise.
	* sysdeps/unix/sysv/aix/xstat.c (__xstat): Likewise.
	* sysdeps/unix/sysv/aix/xstat64.c (__xstat64): Likewise.
	* sysdeps/unix/sysv/linux/ia64/fxstat.c (__fxstat): Likewise.
	* sysdeps/unix/sysv/linux/ia64/lxstat.c (__lxstat): Likewise.
	* sysdeps/unix/sysv/linux/ia64/xstat.c (__xstat): Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/fxstat.c (__fxstat): Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/lxstat.c (__lxstat): Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/xstat.c (__xstat): Likewise.
	* sysdeps/unix/sysv/linux/i386/fxstat.c (__fxstat): Likewise.
	* sysdeps/unix/sysv/linux/i386/lxstat.c (__lxstat): Likewise.
	* sysdeps/unix/sysv/linux/i386/xstat.c (__xstat): Likewise.
	* sysdeps/unix/sysv/linux/xstat.c (__xstat): Likewise.
	* sysdeps/unix/sysv/linux/xstat64.c (__xstat64): Likewise.
	* sysdeps/unix/sysv/linux/fxstat.c (__fxstat): Likewise.
	* sysdeps/unix/sysv/linux/fxstat64.c (__fxstat64): Likewise.
	* sysdeps/unix/sysv/linux/lxstat.c (__lxstat): Likewise.
	* sysdeps/unix/sysv/linux/lxstat64.c (__lxstat64): Likewise.
	* sysdeps/unix/xstat.c (__xstat): Likewise.

	* include/sys/statvfs.h (statvfs, fstatvfs): Add libc_hidden_proto.
	* sysdeps/generic/statvfs.c (statvfs): Add libc_hidden_def.
	* sysdeps/generic/fstatvfs.c (fstatvfs): Likewise.
	* sysdeps/mach/hurd/statvfs.c (statvfs): Likewise.
	* sysdeps/mach/hurd/fstatvfs.c (fstatvfs): Likewise.
	* sysdeps/unix/sysv/linux/statvfs.c (statvfs): Likewise.
	* sysdeps/unix/sysv/linux/fstatvfs.c (fstatvfs): Likewise.

	* include/unistd.h (tcgetpgrp): Add libc_hidden_proto.
	* include/termios.h (tcsetattr, cfsetispeed, cfsetospeed): Likewise.
	* sysdeps/generic/tcgetpgrp.c (tcgetpgrp): Add libc_hidden_def.
	* sysdeps/generic/tcsetattr.c (tcsetattr): Likewise.
	* sysdeps/generic/speed.c (cfsetispeed, cfsetospeed): Likewise.
	* sysdeps/unix/bsd/bsd4.4/tcsetattr.c (tcgetpgrp): Likewise.
	* sysdeps/unix/bsd/sun/sunos4/tcsetattr.c (tcsetattr): Likewise.
	* sysdeps/unix/bsd/sun/sunos4/speed.c (cfsetispeed, cfsetospeed):
	Likewise.
	* sysdeps/unix/bsd/tcgetpgrp.c (tcgetpgrp): Likewise.
	* sysdeps/unix/bsd/tcsetattr.c (tcsetattr): Likewise.
	* sysdeps/unix/sysv/aix/tcsetattr.c (tcsetattr): Likewise.
	* sysdeps/unix/sysv/aix/speed.c (cfsetispeed, cfsetospeed): Likewise.
	* sysdeps/unix/sysv/linux/tcsetattr.c (tcsetattr): Likewise.
	* sysdeps/unix/sysv/linux/speed.c (cfsetispeed, cfsetospeed): Likewise.
	* sysdeps/unix/sysv/tcgetpgrp.c (tcgetpgrp): Likewise.
	* sysdeps/unix/sysv/tcsetattr.c (tcsetattr): Likewise.

	* include/string.h (strcoll): Add libc_hidden_proto.
	* string/strcoll.c (strcoll): Add libc_hidden_def.

	* misc/err.c (vwarn): Fix pasto in libc_hidden_def.
2002-08-13 00:24:58 +00:00
Roland McGrath 337738b771 * sysdeps/mach/hurd/xstat64.c: Conditionalize entire contents of the
file on [!RTLD_STAT64].
	* sysdeps/mach/hurd/fxstat64.c: Likewise.

	* sysdeps/mach/hurd/tmpfile.c (tmpfile64): Define as alias of tmpfile.
	(__fdopen): Use INTUSE.
	* sysdeps/mach/hurd/tmpfile64.c: New file, empty placeholder.

	* stdio-common/tmpfile64.c: File removed.
	* sysdeps/generic/tmpfile64.c: New file.
	* sysdeps/generic/tmpfile.c (GEN_THIS): New macro, define to __GT_FILE
	if not already defined.
	(tmpfile): Use it in place of __GT_FILE.

	* include/unistd.h: Declare __chown_internal.

	* sysdeps/mach/hurd/sendfile64.c (sendfile64): Do real work here.
	* sysdeps/mach/hurd/sendfile.c (sendfile): Call that.

2002-06-09  Roland McGrath  <roland@frob.com>

	Update to new Hurd RPC interfaces supporting 64-bit file sizes.
	* sysdeps/mach/hurd/configure.in: Check for <hurd/version.h> with
	value of HURD_INTERFACE_VERSION >= 20020609.
	* sysdeps/mach/hurd/configure: Regenerated.
	* shlib-versions (.*-.*-gnu-gnu.*): Set libhurduser=0.3.
	* sysdeps/mach/hurd/xstatconv.c (xstat64_conv): Rewritten to
	convert a struct stat64 into a struct stat and return 0 or -1
	with errno set to EOVERFLOW.
	* sysdeps/mach/hurd/statfsconv.c (statfs64_conv): Likewise
	for struct statfs64 to struct statfs.
	* sysdeps/mach/hurd/xstat.c (__xstat): Use converter and call ...
	* sysdeps/mach/hurd/xstat64.c (__xstat64): ... this, real work here.
	* sysdeps/mach/hurd/fxstat.c (__fxstat): Likewise.
	* sysdeps/mach/hurd/fxstat64.c (__fxstat64): Likewise.
	* sysdeps/mach/hurd/lxstat.c (__lxstat): Likewise.
	* sysdeps/mach/hurd/lxstat64.c (__lxstat64): Likewise.
	* sysdeps/mach/hurd/statfs.c (__statfs): Likewise.
	* sysdeps/mach/hurd/statfs64.c (__statfs64): Likewise.
	* sysdeps/mach/hurd/fstatfs.c (__fstatfs): Likewise.
	* sysdeps/mach/hurd/fstatfs64.c (__fstatfs64): Likewise.
	* sysdeps/mach/hurd/pwrite64.c (__libc_pwrite64): Do real work here.
	* sysdeps/mach/hurd/pwrite.c (__libc_pwrite): Call that.
	* sysdeps/mach/hurd/pread64.c (__libc_pread64): Do real work here.
	* sysdeps/mach/hurd/pread.c (__libc_pread): Call that.
	* sysdeps/mach/hurd/lseek64.c (__libc_lseek64): Do real work here.
	* sysdeps/mach/hurd/lseek.c (__libc_lseek): Call that.
	* sysdeps/mach/hurd/readdir64.c (__readdir64): Do real work here.
	* sysdeps/mach/hurd/readdir.c (__readdir): Call that.
	* sysdeps/mach/hurd/readdir64_r.c (__readdir64_r): Do real work here.
	* sysdeps/mach/hurd/readdir_r.c (__readdir64_r): Call that.
	* hurd/lookup-retry.c (__hurd_file_name_lookup_retry):
	Use struct stat64 for io_stat argument.
	* sysdeps/mach/hurd/readlink.c (__readlink): Likewise.
	* hurd/fopenport.c (seekio): Remove EOVERFLOW check, pass POS directly
	to io_seek.
	* hurd/fd-read.c (_hurd_fd_read): Use loff_t for OFFSET argument.
	* hurd/fd-write.c (_hurd_fd_write): Likewise.
	* hurd/hurd/fd.h: Update decls.
	* sysdeps/mach/hurd/getcwd.c
	(_hurd_canonicalize_directory_name_internal): Use ino64_t
	and struct dirent64.
	* sysdeps/mach/hurd/dl-sysdep.c (open_file): Use struct stat64.
	(__xstat): Renamed to __xstat64, use struct stat64 for argument.
	(__fxstat): Renamed to __fxstat64, use struct stat64 for argument.
	(__lseek): Renamed to __libc_lseek64, use off64_t for argument.

2002-06-08  Roland McGrath  <roland@frob.com>

	* sysdeps/mach/hurd/dirstream.h (struct __dirstream): Use size_t
	instead of unsigned long int for __allocation and __size members.

2002-05-19  Ulrich Drepper  <drepper@redhat.com>
2002-06-11 23:04:51 +00:00
Ulrich Drepper fab656f5a7 Update.
* include/sys/stat.h: Add prototypes for __lxstat_internal and
	__lxstat64_internal.  Add macros __lxstat and __lxstat64 if not
	NOT_IN_libc.
	* sysdeps/generic/lxstat.c: Use INTDEF for __lxstat.
	* sysdeps/mach/hurd/lxstat.c: Likewise.
	* sysdeps/unix/common/lxstat.c: Likewise.
	* sysdeps/unix/sysv/aix/lxstat.c: Likewise.
	* sysdeps/unix/sysv/linux/lxstat.c: Likewise.
	* sysdeps/unix/sysv/linux/i386/lxstat.c: Likewise.
	* sysdeps/unix/sysv/linux/ia64/lxstat.c: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/lxstat.c: Likewise.
	* sysdeps/generic/lxstat64.c: Use INTDEF for __lxstat64.
	* sysdeps/mach/hurd/lxstat64.c: Likewise.
	* sysdeps/unix/sysv/aix/lxstat64.c: Likewise.
	* sysdeps/unix/sysv/linuxx/lxstat64.c: Likewise.

	* include/wchar.h: Declare __mbrtowc_internal and __mbrlen_internal
	prototypes.  Add __mbrlen and __mbrtowc macros.
	* wcsmbs/mbrlen.c: Use INTDEF for __mbrlen.
	* wcsmbs/mbrtowc.c: Use INTDEF for __mbrtowc.

	* include/unistd.h: Add prototype for __write_internal and add
	__libc_write macro is SHARED.
	* sysdeps/generic/write.c: Use INTDEF for __write.
	* sysdeps/mach/hurd/write.c: Likewise.
	* sysdeps/unix/sysv/aix/write.c: Likewise.
	* sysdeps/unix/syscalls.list: Add __libc_write alias.

	* assert/assert.c: Replace STR_N_SIZE with something usable in
	macro arguments.
	* assert/assert-perr.c: Likewise.
2002-04-15 05:35:10 +00:00
Andreas Jaeger 41bdb6e20c Update to LGPL v2.1.
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.
2001-07-06 04:58:11 +00:00
Mark Kettenis fd811dc69a * sysdeps/mach/hurd/xstatconv.c: New file. * sysdeps/mach/hurd/fxstat64.c: New file. * sysdeps/mach/hurd/lxstat64.c: New file. * sysdeps/mach/hurd/xstat64.c: New file. * sysdeps/mach/hurd/Dist: Add xstatconv.c.
* sysdeps/mach/hurd/xstatconv.c: New file.
	* sysdeps/mach/hurd/fxstat64.c: New file.
	* sysdeps/mach/hurd/lxstat64.c: New file.
	* sysdeps/mach/hurd/xstat64.c: New file.
	* sysdeps/mach/hurd/Dist: Add xstatconv.c.

2000-08-15  Mark Kettenis  <kettenis@gnu.org>
2000-08-15 18:47:06 +00:00