diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2002-09-24 14:17:50 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2002-09-24 14:17:50 +0000 |
commit | f4b098d95efc7d20fc02bf54987c8de8cc1cccef (patch) | |
tree | 56b7dae17fdb84e268a66cf062226365a56cbb6d | |
parent | 06f1353ae8c39c038218738e47a82c35f4abfc80 (diff) | |
download | newlib-f4b098d95efc7d20fc02bf54987c8de8cc1cccef.zip newlib-f4b098d95efc7d20fc02bf54987c8de8cc1cccef.tar.gz newlib-f4b098d95efc7d20fc02bf54987c8de8cc1cccef.tar.bz2 |
* errno.cc (errmap): Map ERROR_INVALID_ADDRESS to new errno code
EOVERFLOW.
(_sys_errlist): Add entries for EILSEQ and EOVERFLOW.
(strerror): Ditto.
* mmap.cc (map_map): Set errno in case of error.
(mmap64): Remove setting errno explicitely to ENOMEM.
-rw-r--r-- | winsup/cygwin/ChangeLog | 9 | ||||
-rw-r--r-- | winsup/cygwin/errno.cc | 9 | ||||
-rw-r--r-- | winsup/cygwin/mmap.cc | 10 |
3 files changed, 22 insertions, 6 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 863fb0c..099eb00 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,14 @@ 2002-09-24 Corinna Vinschen <corinna@vinschen.de> + * errno.cc (errmap): Map ERROR_INVALID_ADDRESS to new errno code + EOVERFLOW. + (_sys_errlist): Add entries for EILSEQ and EOVERFLOW. + (strerror): Ditto. + * mmap.cc (map_map): Set errno in case of error. + (mmap64): Remove setting errno explicitely to ENOMEM. + +2002-09-24 Corinna Vinschen <corinna@vinschen.de> + * mmap.cc (map_map): Add debug output. (mmap64): Evaluate gran_len correctly even if offset isn't 0. diff --git a/winsup/cygwin/errno.cc b/winsup/cygwin/errno.cc index 7cc3684..d37f7c3 100644 --- a/winsup/cygwin/errno.cc +++ b/winsup/cygwin/errno.cc @@ -112,6 +112,7 @@ errmap[] = X (DISK_FULL, ENOSPC), X (NOACCESS, EFAULT), X (FILE_INVALID, ENXIO), + X (INVALID_ADDRESS, EOVERFLOW), { 0, NULL, 0} }; @@ -290,6 +291,8 @@ const NO_COPY char __declspec(dllexport) * const _sys_errlist[]= /* ENOMEDIUM 135 */ "no medium", /* ENOSHARE 136 */ "No such host or network path", /* ECASECLASH 137 */ "Filename exists with different case" +/* EILSEQ 138 */ "Illegal byte sequence" +/* EOVERFLOW 139 */ "Value too large for defined data type" }; extern int const NO_COPY __declspec(dllexport) _sys_nerr = sizeof (_sys_errlist) / sizeof (_sys_errlist[0]); @@ -671,6 +674,12 @@ strerror (int errnum) case ECASECLASH: error = "Filename exists with different case"; break; + case EILSEQ: + error = "Illegal byte sequence"; + break; + case EOVERFLOW: + error = "Value too large for defined data type"; + break; default: #ifdef _MT_SAFE char *buf= _reent_winsup ()->_strerror_buf; diff --git a/winsup/cygwin/mmap.cc b/winsup/cygwin/mmap.cc index 68d993c..cb0d476 100644 --- a/winsup/cygwin/mmap.cc +++ b/winsup/cygwin/mmap.cc @@ -151,7 +151,7 @@ mmap_record::map_map (__off64_t off, DWORD len) && !VirtualProtect (base_address_ + off * getpagesize (), len * getpagesize (), prot, &old_prot)) { - debug_printf ("-1 = map_map (): %E"); + __seterrno (); return (__off64_t)-1; } @@ -167,7 +167,7 @@ mmap_record::map_map (__off64_t off, DWORD len) && !VirtualProtect (base_address_ + start * getpagesize (), len * getpagesize (), prot, &old_prot)) { - debug_printf ("-1 = map_map (): %E"); + __seterrno (); return (__off64_t)-1; } @@ -517,8 +517,7 @@ mmap64 (caddr_t addr, size_t len, int prot, int flags, int fd, __off64_t off) { if ((off = rec->map_map (off, len)) == (__off64_t)-1) { - set_errno (ENOMEM); - syscall_printf ("-1 = mmap(): ENOMEM"); + syscall_printf ("-1 = mmap()"); ReleaseResourceLock (LOCK_MMAP_LIST, READ_LOCK|WRITE_LOCK, "mmap"); return MAP_FAILED; } @@ -583,8 +582,7 @@ mmap64 (caddr_t addr, size_t len, int prot, int flags, int fd, __off64_t off) { fh->munmap (h, base, gran_len); l->erase (); - set_errno (ENOMEM); - syscall_printf ("-1 = mmap(): ENOMEM"); + syscall_printf ("-1 = mmap()"); ReleaseResourceLock (LOCK_MMAP_LIST, READ_LOCK | WRITE_LOCK, "mmap"); return MAP_FAILED; } |