1 /** 2 * @defgroup errno Errno 3 * @ingroup libc 4 */ 5 6 #ifndef _ERRNO_H 7 #define _ERRNO_H 8 9 #ifdef __cplusplus 10 extern "C" { 11 #endif 12 13 #include <features.h> 14 15 #include <bits/errno.h> 16 17 #ifdef __LITEOS__ 18 /** 19 * @ingroup errno 20 * 21 * @par Description: 22 * The set_errno() function sets the error code. 23 * 24 * @attention 25 * <ul> 26 * <li>The set_errno() function is not a standard C Library Function.</li> 27 * </ul> 28 * 29 * @retval #void None. 30 * 31 * @par Dependency: 32 * <ul><li>errno.h</li></ul> 33 * @see get_errno 34 */ 35 void set_errno(int errcode); 36 37 /** 38 * @ingroup errno 39 * 40 * @par Description: 41 * The get_errno() function gets the error code. 42 * 43 * @attention 44 * <ul> 45 * <li>The get_errno() function is not a standard C Library Function.</li> 46 * </ul> 47 * 48 * @retval #int The get_errno() returns the error code. 49 * 50 * @par Dependency: 51 * <ul><li>errno.h</li></ul> 52 * @see set_errno 53 */ 54 int get_errno(void); 55 #endif 56 57 #ifdef __GNUC__ 58 __attribute__((const)) 59 #endif 60 int *__errno_location(void); 61 #define errno (*__errno_location()) 62 63 #ifdef _GNU_SOURCE 64 extern char *program_invocation_short_name, *program_invocation_name; 65 #endif 66 67 #ifdef __cplusplus 68 } 69 #endif 70 71 #endif 72 73