diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1997-08-27 20:33:49 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1997-08-27 20:33:49 +0000 |
commit | 3473f6054867ebc9ead9bc80336558639e8972e6 (patch) | |
tree | 49f75f01dd0b808d1e5e1ec04c63b0c5c9b794c7 /cpukit | |
parent | Modified to support the BSP family concept. (diff) | |
download | rtems-3473f6054867ebc9ead9bc80336558639e8972e6.tar.bz2 |
Added error numbers and changed default error code from 0 to -1 for
error number mapping.
Diffstat (limited to '')
-rw-r--r-- | cpukit/libcsupport/src/libio.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/cpukit/libcsupport/src/libio.c b/cpukit/libcsupport/src/libio.c index d0ba197c61..8ba65ee6b2 100644 --- a/cpukit/libcsupport/src/libio.c +++ b/cpukit/libcsupport/src/libio.c @@ -154,10 +154,12 @@ rtems_libio_init(void) */ rtems_assoc_t errno_assoc[] = { - { "OK", RTEMS_SUCCESSFUL, 0 }, - { "TIMEOUT", RTEMS_TIMEOUT, ETIME }, - { "NO MEMORY", RTEMS_NO_MEMORY, ENOMEM }, - { "NO DEVICE", RTEMS_UNSATISFIED, ENOSYS }, + { "OK", RTEMS_SUCCESSFUL, 0 }, + { "TIMEOUT", RTEMS_TIMEOUT, ETIME }, + { "NO MEMORY", RTEMS_NO_MEMORY, ENOMEM }, + { "NO DEVICE", RTEMS_UNSATISFIED, ENOSYS }, + { "INVALID NUMBER", RTEMS_INVALID_NUMBER, EBADF}, + { "NOT RESOURCE OWNER", RTEMS_NOT_OWNER_OF_RESOURCE, EPERM}, { 0, 0, 0 }, }; @@ -171,7 +173,7 @@ rtems_libio_errno(rtems_status_code code) errno = rc; return -1; } - return 0; + return -1; } /* @@ -179,8 +181,8 @@ rtems_libio_errno(rtems_status_code code) */ rtems_assoc_t access_modes_assoc[] = { - { "READ", LIBIO_FLAGS_READ, O_RDONLY }, - { "WRITE", LIBIO_FLAGS_WRITE, O_WRONLY }, + { "READ", LIBIO_FLAGS_READ, O_RDONLY }, + { "WRITE", LIBIO_FLAGS_WRITE, O_WRONLY }, { "READ/WRITE", LIBIO_FLAGS_READ_WRITE, O_RDWR }, { 0, 0, 0 }, }; |