summaryrefslogtreecommitdiff
path: root/stdlib/errno.h
AgeCommit message (Collapse)Author
2018-03-04Separate out error_t definitionSamuel Thibault
so interfaces needing it can get it. * stdlib/errno.h (error_t): Move definition to... * bits/types/error_t.h: ... new header. * stdlib/Makefile (headers): Add bits/types/error_t.h. * sysdeps/mach/hurd/bits/errno.h (error_t): Move definition to... * sysdeps/mach/hurd/bits/types/error_t.h: ... new header. * sysdeps/mach/hurd/errnos.awk (error_t): Likewise. * hurd/hurd.h: Include <bits/types/error_t.h> * hurd/hurd/fd.h: Include <bits/types/error_t.h> * hurd/hurd/id.h: Include <errno.h> and <bits/types/error_t.h> * hurd/hurd/lookup.h: Include <errno.h> and <bits/types/error_t.h> * hurd/hurd/resource.h: Include <bits/types/error_t.h> * hurd/hurd/signal.h: Include <bits/types/error_t.h> * hurd/hurd/sigpreempt.h: Include <bits/types/error_t.h>
2018-01-01Update copyright dates with scripts/update-copyrights.Joseph Myers
* 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.
2017-06-14Remove __need macros from errno.h (__need_Emath, __need_error_t).Zack Weinberg
This is fairly complicated, not because the users of __need_Emath and __need_error_t have complicated requirements, but because the core changes had a lot of fallout. __need_error_t exists for gnulib compatibility in argz.h and argp.h. error_t itself is a Hurdism, an enum containing all the E-constants, so you can do 'p (error_t) errno' in gdb and get a symbolic value. argz.h and argp.h use it for function return values, and they want to fall back to 'int' when that's not available. There is no reason why these nonstandard headers cannot just go ahead and include all of errno.h; so we do that. __need_Emath is defined only by .S files; what they _really_ need is for errno.h to avoid declaring anything other than the E-constants (e.g. 'extern int __errno_location(void);' is a syntax error in assembly language). This is replaced with a check for __ASSEMBLER__ in errno.h, plus a carefully documented requirement for bits/errno.h not to define anything other than macros. That in turn has the consequence that bits/errno.h must not define errno - fortunately, all live ports use the same definition of errno, so I've moved it to errno.h. The Hurd bits/errno.h must also take care not to define error_t when __ASSEMBLER__ is defined, which involves repeating all of the definitions twice, but it's a generated file so that's okay. * stdlib/errno.h: Remove __need_Emath and __need_error_t logic. Reorganize file. Declare errno here. When __ASSEMBLER__ is defined, don't declare anything other than the E-constants. * include/errno.h: Change conditional for exposing internal declarations to (not _ISOMAC and not __ASSEMBLER__). * bits/errno.h: Remove logic for __need_Emath. Document requirements for a port-specific bits/errno.h. * sysdeps/unix/sysv/linux/bits/errno.h * sysdeps/unix/sysv/linux/alpha/bits/errno.h * sysdeps/unix/sysv/linux/hppa/bits/errno.h * sysdeps/unix/sysv/linux/mips/bits/errno.h * sysdeps/unix/sysv/linux/sparc/bits/errno.h: Add multiple-include guard and check against improper inclusion. Remove __need_Emath logic. Don't declare errno here. Ensure all constants are defined as simple integer literals. Consistent formatting. * sysdeps/mach/hurd/errnos.awk: Likewise. Only define error_t and enum __error_t_codes if __ASSEMBLER__ is not defined. * sysdeps/mach/hurd/bits/errno.h: Regenerate. * argp/argp.h, string/argz.h: Don't define __need_error_t before including errno.h. * sysdeps/i386/i686/fpu/multiarch/s_cosf-sse2.S * sysdeps/i386/i686/fpu/multiarch/s_sincosf-sse2.S * sysdeps/i386/i686/fpu/multiarch/s_sinf-sse2.S * sysdeps/x86_64/fpu/s_cosf.S * sysdeps/x86_64/fpu/s_sincosf.S * sysdeps/x86_64/fpu/s_sinf.S: Just include errno.h; don't define __need_Emath or include bits/errno.h directly.
2017-06-10Correct an outdated comment in stdlib/errno.h.Zack Weinberg
2017-01-01Update copyright dates with scripts/update-copyrights.Joseph Myers
2016-01-04Update copyright dates with scripts/update-copyrights.Joseph Myers
2015-01-02Update copyright dates with scripts/update-copyrights.Joseph Myers
2014-01-01Update copyright notices with scripts/update-copyrightsAllan McRae
2013-01-02Update copyright notices with scripts/update-copyrights.Joseph Myers
2012-02-09Replace FSF snail mail address with URLs.Paul Eggert
2002-07-20Update.Ulrich Drepper
2002-07-19 Ulrich Drepper <drepper@redhat.com> * configure.in: Add test for __thread support in compiler. * config.h.in: Add HAVE___THREAD. * Makefile (headers): Remove errno.h, sys/errno.h, and bits/errno.h. * include/sys/errno.h: Moved to... * stdlib/sys/errno.h: ...here. New file. * stdlib/errno.h: New file. Moved from... * include/errno.h: ...here. Changed into an internal header defining libc-local things like __set_errno. * stdlib/Makefile (headers): Add errno.h, sys/errno.h, and bits/errno.h. * elf/dl-minimal.c: Include <tls.h>. Define errno as thread-local variable if USE_TLS && HAVE___THREAD. Don't define __errno_location either. * elf/rtld.c (_dl_start): Add code to initialize TLS for ld.so from... (_dl_start_final): ...here. Add code to initialize tls elements from bootstrap_map. * sysdeps/generic/errno-loc.c: Define errno as thread-local variable if USE_TLS && HAVE___THREAD. * sysdeps/generic/bits/errno.h: Remove __set_errno definition. * sysdeps/mach/hurd/bits/errno.h: Likewise. * sysdeps/standalone/arm/bits/errno.h: Likewise. * sysdeps/standalone/bits/errno.h: Likewise. * sysdeps/unix/bsd/bsd4.4/bits/errno.h: Likewise. * sysdeps/unix/sysv/aix/bits/errno.h: Likewise. * sysdeps/unix/sysv/hpux/bits/errno.h: Likewise. * sysdeps/unix/sysv/linux/bits/errno.h: Likewise. * sysdeps/unix/sysv/linux/hppa/bits/errno.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/errno.h: Likewise. * sysdeps/unix/sysv/sysv4/solaris2/bits/errno.h: Likewise. * sysdeps/i386/dl-machine.c (elf_machine_rel) [RTLD_BOOTSTRAP]: Don't use GL(dl_rtld_map), use map parameter. * sysdeps/sh/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/unix/sysv/linux/i386/sysdep.S: Define errno in .tbss if USE_TLS && HAVE___THREAD. * sysdeps/unix/sysv/linux/i386/sysdep.h: Unify SETUP_PIC_REG definitions. If USE_TLS && HAVE___THREAD store errooor value using TLS code sequence. * sysdeps/unix/sysv/linux/i386/i686/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/getcwd.c: No real need to restore errno. * sysdeps/unix/sysv/linux/grantpt.c: Likewise. * sysdeps/unix/sysv/linux/internal_statvfs.c: Likewise. * sysdeps/unix/sysv/linux/msgctl.c: Likewise. * sysdeps/unix/sysv/linux/readv.c: Likewise. * sysdeps/unix/sysv/linux/writev.c: Likewise.