Back to index

glibc  2.9
errno.h
Go to the documentation of this file.
00001 /* Error constants.  Linux specific version.
00002    Copyright (C) 1996, 1997, 1998, 1999, 2005 Free Software Foundation, Inc.
00003    This file is part of the GNU C Library.
00004 
00005    The GNU C Library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Lesser General Public
00007    License as published by the Free Software Foundation; either
00008    version 2.1 of the License, or (at your option) any later version.
00009 
00010    The GNU C Library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Lesser General Public License for more details.
00014 
00015    You should have received a copy of the GNU Lesser General Public
00016    License along with the GNU C Library; if not, write to the Free
00017    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00018    02111-1307 USA.  */
00019 
00020 #ifdef _ERRNO_H
00021 
00022 # undef EDOM
00023 # undef EILSEQ
00024 # undef ERANGE
00025 # include <linux/errno.h>
00026 
00027 /* Linux has no ENOTSUP error code.  */
00028 # define ENOTSUP EOPNOTSUPP
00029 
00030 /* Older Linux versions also had no ECANCELED error code.  */
00031 # ifndef ECANCELED
00032 #  define ECANCELED  125
00033 # endif
00034 
00035 /* Support for error codes to support robust mutexes was added later, too.  */
00036 # ifndef EOWNERDEAD
00037 #  define EOWNERDEAD        130
00038 #  define ENOTRECOVERABLE   131
00039 # endif
00040 
00041 # ifndef __ASSEMBLER__
00042 /* Function to get address of global `errno' variable.  */
00043 extern int *__errno_location (void) __THROW __attribute__ ((__const__));
00044 
00045 #  if !defined _LIBC || defined _LIBC_REENTRANT
00046 /* When using threads, errno is a per-thread value.  */
00047 #   define errno (*__errno_location ())
00048 #  endif
00049 # endif /* !__ASSEMBLER__ */
00050 #endif /* _ERRNO_H */
00051 
00052 #if !defined _ERRNO_H && defined __need_Emath
00053 /* This is ugly but the kernel header is not clean enough.  We must
00054    define only the values EDOM, EILSEQ and ERANGE in case __need_Emath is
00055    defined.  */
00056 # define EDOM 33     /* Math argument out of domain of function.  */
00057 # define EILSEQ      84     /* Illegal byte sequence.  */
00058 # define ERANGE      34     /* Math result not representable.  */
00059 #endif /* !_ERRNO_H && __need_Emath */