about summary refs log tree commit diff
path: root/io/bits/fcntl2.h
Commit message (Collapse)AuthorAgeFilesLines
* debug: Improve fcntl.h fortify warnings with clangAdhemerval Zanella2024-02-271-0/+92
| | | | | | | | | It improves open, open64, openat, and openat64. The compile and runtime checks have similar coverage as with GCC. Checked on aarch64, armhf, x86_64, and i686. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* Update copyright dates with scripts/update-copyrightsPaul Eggert2024-01-011-1/+1
|
* 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
* 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.
* 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.
* 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
|
* linux: open and openat ignore 'mode' with O_TMPFILE in flagsEric Rannaud2015-02-241-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both open and openat load their last argument 'mode' lazily, using va_arg() only if O_CREAT is found in oflag. This is wrong, mode is also necessary if O_TMPFILE is in oflag. By chance on x86_64, the problem wasn't evident when using O_TMPFILE with open, as the 3rd argument of open, even when not loaded with va_arg, is left untouched in RDX, where the syscall expects it. However, openat was not so lucky, and O_TMPFILE couldn't be used: mode is the 4th argument, in RCX, but the syscall expects its 4th argument in a different register than the glibc wrapper, in R10. Introduce a macro __OPEN_NEEDS_MODE (oflag) to test if either O_CREAT or O_TMPFILE is set in oflag. Tested on Linux x86_64. [BZ #17523] * io/fcntl.h (__OPEN_NEEDS_MODE): New macro. * io/bits/fcntl2.h (open): Use it. (openat): Likewise. * io/open.c (__libc_open): Likewise. * io/open64.c (__libc_open64): Likewise. * io/open64_2.c (__open64_2): Likewise. * io/open_2.c (__open_2): Likewise. * io/openat.c (__openat): Likewise. * io/openat64.c (__openat64): Likewise. * io/openat64_2.c (__openat64_2): Likewise. * io/openat_2.c (__openat_2): Likewise. * sysdeps/mach/hurd/open.c (__libc_open): Likewise. * sysdeps/mach/hurd/openat.c (__openat): Likewise. * sysdeps/posix/open64.c (__libc_open64): Likewise. * sysdeps/unix/sysv/linux/dl-openat64.c (openat64): Likewise. * sysdeps/unix/sysv/linux/generic/open.c (__libc_open): Likewise. (__open_nocancel): Likewise. * sysdeps/unix/sysv/linux/generic/open64.c (__libc_open64): Likewise. * sysdeps/unix/sysv/linux/open64.c (__libc_open64): Likewise. * sysdeps/unix/sysv/linux/openat.c (__OPENAT): Likewise.
* Update copyright dates with scripts/update-copyrights.Joseph Myers2015-01-021-1/+1
|
* 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
|
* Fix attributes for fortify functions.Marek Polacek2012-04-291-4/+4
|
* Replace FSF snail mail address with URLs.Paul Eggert2012-02-091-3/+2
|
* Remove pre-ISO C supportUlrich Drepper2012-01-071-17/+17
| | | | No more __const.
* * rt/Versions (librt): Export __mq_open_2@@GLIBC_2.7.Ulrich Drepper2007-09-151-130/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * rt/Makefile (headers): Add bits/mqueue2.h. * rt/mqueue.h: Include bits/mqueue2.h if -D_FORTIFY_SOURCE=2, optimizing with GCC and __va_arg_pack_len is defined. * rt/bits/mqueue2.h: New file. * rt/mq_open.c (__mq_open): Renamed from mq_open. (mq_open): New strong_alias. (__mq_open_2): New function. * sysdeps/unix/sysv/linux/mq_open.c (__mq_open): Renamed from mq_open. (mq_open): New strong_alias. (__mq_open_2): New function. * debug/Versions (libc): Export __fortify_fail@@GLIBC_PRIVATE. * Versions.def (librt): Add GLIBC_2.7 version. * debug/fortify_fail.c (__fortify_fail): Add libc_hidden_def. * include/stdio.h (__fortify_fail): Add libc_hidden_proto. * misc/sys/cdefs.h (__errordecl, __va_arg_pack_len): Define. * io/fcntl.h: Include bits/fcntl2.h when __va_arg_pack_len is defined rather than when not C++. * io/bits/fcntl2.h (__open_alias, __open64_alias, __openat_alias, __openat64_alias): New redirects. (__open_too_many_args, __open_missing_mode, __open64_too_many_args, __open64_missing_mode, __openat_too_many_args, __openat_missing_mode, __openat64_too_many_args, __openat64_missing_mode): New __errordecls. (open, open64, openat, openat64): Rewrite as __extern_always_inline functions instead of function-like macros.
* * io/bits/fcntl2.h (open, open64, openat, openat64): Add Jakub Jelinek2007-08-041-116/+124
| | | | | | | | __extension__ around the whole statement expression. 2007-08-04 Jakub Jelinek <jakub@redhat.com> * io/bits/fcntl2.h (open, open64, openat, openat64): Add __extension__ around the whole statement expression.
* * io/bits/fcntl2.h (__open_2): Add nonnull attribute.Ulrich Drepper2007-05-251-26/+48
| | | | | | | | | | | | | | | | (open): Fix comment typos. Don't call __open_2 if flags is a compile time constant without O_CREAT. (__open64_2): Add nonnull attribute. (open64): Fix comment typos. Don't call __open64_2 if flags is a compile time constant without O_CREAT. (__openat_2): Add nonnull attribute, fix nonnull attribute on redirect. (openat): Fix comment typos. Don't call __openat_2 if flags is a compile time constant without O_CREAT. (__openat64_2): Add nonnull attribute, fix nonnull attribute on redirect. (openat64): Fix comment typos. Don't call __openat64_2 if flags is a compile time constant without O_CREAT.
* * sysdeps/powerpc/tls.h (tcbhead_t): Add gscope_flag.Ulrich Drepper2007-05-251-9/+9
| | | | | | | | | | | | | (THREAD_GSCOPE_FLAG_UNUSED, THREAD_GSCOPE_FLAG_USED, THREAD_GSCOPE_FLAG_WAIT): Define. (THREAD_GSCOPE_GET_FLAG, THREAD_GSCOPE_SET_FLAG, THREAD_GSCOPE_RESET_FLAG, THREAD_GSCOPE_WAIT): Define. * sysdeps/i386/tls.h (THREAD_GSCOPE_WAIT): Don't use PTR_DEMANGLE. (THREAD_GSCOPE_GET_FLAG): Define. * sysdeps/x86_64/tls.h (THREAD_GSCOPE_GET_FLAG): Define. * allocatestack.c (__wait_lookup_done): Use THREAD_GSCOPE_GET_FLAG instead of ->header.gscope_flag directly.
* * Makerules (sysd-rules): Define PTW for ptw-* files.Ulrich Drepper2007-05-241-0/+155
* Versions: Define GLIBC_2.7 for libc. * include/stdio.h: Declare __fortify_fail. * debug/fortify_fail.c: New file. * debug/Makefile (routines): Add fortify_fail. * debug/chk_fail.c: Use __fortify_fail. * debug/stack_chk_fail.c: Likewise. * io/Versions: Export __open_2, __open64_2, __openat_2, and __openat64_2 for GLIBC_2.7. * io/fcntl.h: When compiling with fortification, include bits/fcntl2.h. * io/open.c: Define *_2 variant of function which checks for O_CREAT and fails if necessary. * io/open64.c: Likewise. * io/openat.c: Likewise. * io/openat64.c: Likewise. * sysdeps/unix/sysv/linux/open64.c: Likewise. * sysdeps/unix/sysv/linux/openat.c: Likewise. * sysdeps/unix/sysv/linux/openat64.c: Likewise. * io/bits/fcntl2.h: New file. * include/fcntl.h: Declare __open_2, __open64_2, __openat_2, and __openat64_2. * include/bits/fcntl2.h: New file. * sysdeps/unix/sysv/linux/Makefile [subdir=io] (sysdep_routines): Add open_2. * sysdeps/unix/sysv/linux/open_2.c: New file.