Back to index

glibc  2.9
errno.h
Go to the documentation of this file.
00001 /* Copyright (C) 1991,92,93,94,95,96,97,2002 Free Software Foundation, Inc.
00002    This file is part of the GNU C Library.
00003 
00004    The GNU C Library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Lesser General Public
00006    License as published by the Free Software Foundation; either
00007    version 2.1 of the License, or (at your option) any later version.
00008 
00009    The GNU C Library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Lesser General Public License for more details.
00013 
00014    You should have received a copy of the GNU Lesser General Public
00015    License along with the GNU C Library; if not, write to the Free
00016    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00017    02111-1307 USA.  */
00018 
00019 /*
00020  *     ISO C99 Standard: 7.5 Errors       <errno.h>
00021  */
00022 
00023 #ifndef       _ERRNO_H
00024 
00025 /* The includer defined __need_Emath if he wants only the definitions
00026    of EDOM and ERANGE, and not everything else.  */
00027 #ifndef       __need_Emath
00028 # define _ERRNO_H    1
00029 # include <features.h>
00030 #endif
00031 
00032 __BEGIN_DECLS
00033 
00034 /* Get the error number constants from the system-specific file.
00035    This file will test __need_Emath and _ERRNO_H.  */
00036 #include <bits/errno.h>
00037 #undef __need_Emath
00038 
00039 #ifdef _ERRNO_H
00040 
00041 /* Declare the `errno' variable, unless it's defined as a macro by
00042    bits/errno.h.  This is the case in GNU, where it is a per-thread
00043    variable.  This redeclaration using the macro still works, but it
00044    will be a function declaration without a prototype and may trigger
00045    a -Wstrict-prototypes warning.  */
00046 #ifndef       errno
00047 extern int errno;
00048 #endif
00049 
00050 #ifdef __USE_GNU
00051 
00052 /* The full and simple forms of the name with which the program was
00053    invoked.  These variables are set up automatically at startup based on
00054    the value of ARGV[0] (this works only if you use GNU ld).  */
00055 extern char *program_invocation_name, *program_invocation_short_name;
00056 #endif /* __USE_GNU */
00057 #endif /* _ERRNO_H */
00058 
00059 __END_DECLS
00060 
00061 #endif /* _ERRNO_H */
00062 
00063 /* The Hurd <bits/errno.h> defines `error_t' as an enumerated type so
00064    that printing `error_t' values in the debugger shows the names.  We
00065    might need this definition sometimes even if this file was included
00066    before.  */
00067 #if defined __USE_GNU || defined __need_error_t
00068 # ifndef __error_t_defined
00069 typedef int error_t;
00070 #  define __error_t_defined 1
00071 # endif
00072 # undef __need_error_t
00073 #endif