RZ/A1H CMSIS-RTOS RTX BSP for GR-PEACH.

Dependents:   R_BSP_SSIF_HelloWorld GR-PEACH_Azure_Speech ImageZoomInout_Sample ImageRotaion_Sample ... more

Fork of R_BSP by Daiki Kato

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers r_errno.h Source File

r_errno.h

00001 /****** ************************************************************************
00002  *
00003  * $Rev: 891 $
00004  * $Date: 2012-12-07 20:36:39 +0900#$
00005  *
00006  * Description : errno for POSIX IEEE Std 1003.1-2001
00007  *
00008  * (C) Copyright RENESAS ELECTRONICS Ltd 2012 All Rights Reserved
00009  *****************************************************************************/
00010 
00011 /* Detect if SHC include errno.h has been included first, this is not supported */
00012 #ifdef _ERRNO
00013     #error Renesas/Sh/9_x_x/include/errno.h has been included before SDK errno.h. Please specify SDK include path first.
00014 #endif
00015 
00016 #ifndef SDK_ERRNO
00017 #define SDK_ERRNO
00018 
00019 /* Include std headers to override _errno with SDK version */
00020 #include <stdio.h>
00021 #include <string.h>
00022 #include <stdlib.h>
00023 #include <stddef.h>
00024 #include <math.h>
00025 
00026 #ifdef __cplusplus
00027 extern "C" {
00028 #endif
00029 
00030 #define _REENTRANT 1
00031 
00032 /***********************************************************************************
00033  System Includes
00034 ***********************************************************************************/
00035 #ifdef EBADF
00036     #undef EBADF
00037 #endif
00038 #ifdef EDOM
00039     #undef EDOM
00040 #endif
00041 
00042 /* SDK errno extension, SDK returns 0 as success, and -1 when errno set */
00043 #define ESUCCESS    (0)
00044 #define EERROR      (-1)
00045 
00046 #define EBADF       (-17) /* Bad file descriptor */
00047 #define EINVAL      (-28) /* Invalid argument */
00048 #define ENOMEM      (-33) /* No memory available */
00049 #define ENOLCK      (-34) /* No lock available */
00050 #define ENOENT      (-42) /* No such file or directory */
00051 #define ETIMEDOUT   (-50) /* Timed out */
00052 #define EACCES      (-64) /* Access denied */
00053 #define EAGAIN      (-65) /* Resource unavailable. Try again */
00054 #define EBUSY       (-67) /* Device or resource busy */
00055 #define ECANCELED   (-68) /* Operation was cancelled */
00056 #define EDOM        (-69) /* Maths argument out of domain */
00057 #define EEXIST      (-70) /* File, directory or mount exists */
00058 #define EFBIG       (-71) /* File too big */
00059 #define EINPROGRESS (-72) /* Operation in progress */
00060 #define EIO         (-74) /* Input or Output error (possibly recoverable)*/
00061 #define EISDIR      (-75) /* Is a directory */
00062 #define EMFILE      (-76) /* Too many open files */
00063 #define ENAMETOOLONG (-77) /* File name too long */
00064 #define ENFILE      (-78) /* Too many files are open in the system */
00065 #define ENOBUFS     (-79) /* No buffers available */
00066 #define ENODEV      (-80) /* Not a valid device */
00067 #define ENOSPC      (-84) /* No space available on device */
00068 #define ENOTDIR     (-85) /* Not a directory */
00069 #define ENOTEMPTY   (-86) /* Directory not empty */
00070 #define ENOTSUP     (-87) /* Not supported */
00071 #define ENOTTY      (-88) /* No TTY available */
00072 #define ENXIO       (-89) /* Not valid IO address or device (unrecoverable)*/
00073 #define EPERM       (-90) /* Operation not permitted */
00074 #define EROFS       (-91) /* Read only file system */
00075 #define ESPIPE      (-92) /* Invalid seek on pipe */
00076 #define EXDEV       (-93) /* Device cross linked */
00077 #define ENOTSOCK    (-94) /* Not a socket */
00078 #define EMSGSIZE    (-95) /* Message too large */
00079 #define EINTR       (-96) /* Function interrupted */
00080 #define EFAULT      (-97) /* Section fault, bad address */
00081 #define EPIPE       (-98) /* Broken pipe */
00082 #define EALREADY    (-99) /* Connection already started */
00083 #define EDESTADDRREQ (-100) /* Destination address requred */
00084 #define EPROTOTYPE  (-101) /* Wrong protocol or codec type */
00085 #define ENOPROTOOPT (-102) /* Protocol or codec not available */
00086 #define EPROTONOSUPPORT (-103) /* Protocol or codec not supported */
00087 #define EOPNOTSUPP  (-104) /* Operation not supported */
00088 #define EAFNOSUPPORT (-105) /* Address family not supported */
00089 #define EADDRINUSE  (-106) /* Address already in use */
00090 #define EADDRNOTAVAIL (-107) /* Address not available */
00091 #define ECONNRESET  (-108) /* Connection reset */
00092 #define EISCONN     (-109) /* Connected */
00093 #define ENOTCONN    (-110) /* Not connected */
00094 #define ECONNREFUSED (-112) /* Connection refused */
00095 #define EPROCLIM    (-113) /* Too many processes */
00096 #define EUSERS      (-114) /* Too many users */
00097 #define EDEADLK     (-115) /* Resource deadlock would occur */
00098 #define EPROTO      (-116) /* Protocol or codec error */
00099 #define EOVERFLOW   (-117) /* Value too large to store in data type */
00100 #define ESRCH       (-118) /* No such task */
00101 #define EILSEQ      (-119) /* Illegal byte sequence format */
00102 #define EBADMSG     (-120) /* Bad message */
00103 #define ENOSYS      (-121) /* Function not supported */
00104 #define ECRC        (-122) /* CRC failure */
00105 #define EEOF        (-123) /* Position is End Of File */
00106 #define ESEEKPASTEND (-124) /* Seek past EOF */
00107 #define EMEDIUMTYPE (-127) /* Wrong medium type */
00108 #define ENOMEDIUM   (-128) /* No medium present */
00109 #define ESEEKRANGE  (-129) /* seek setting error */  /* Source Merge 11-1 */
00110 
00111 /***********************************************************************************
00112  Defines
00113 ***********************************************************************************/
00114 /* errno is a macro so it is re-entrant (per thread/task value) - this
00115  * definition works with SH C libs.  The errno returns an l-value so
00116  * it can be used on the left of an assignment as it is legal for an
00117  * application to assign to errno.
00118  *
00119  * Note: Application code should not call ioif_get_errno directly. All
00120  * access to errno should be made using the POSIX "errno" macro.
00121 */
00122 extern int *ioif_get_errno(void);
00123 
00124 /* Remove SHC definitions so SDK can be used instead */
00125 #ifdef _errno
00126     #undef _errno
00127 #endif
00128 
00129 #define _errno (*ioif_get_errno())
00130 
00131 #ifndef  errno
00132     #define  errno _errno
00133 #endif
00134 
00135 #define iserrno(e)((unsigned int)(e) >= 0xffffff80UL)
00136 
00137 #ifdef __cplusplus
00138 }
00139 #endif
00140 
00141 #endif