From f4b098d95efc7d20fc02bf54987c8de8cc1cccef Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 24 Sep 2002 14:17:50 +0000 Subject: * 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. --- winsup/cygwin/mmap.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'winsup/cygwin/mmap.cc') diff --git a/winsup/cygwin/mmap.cc b/winsup/cygwin/mmap.cc index 68d993cdd..cb0d47647 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; } -- cgit v1.2.3