diff options
author | Ken Brown <kbrown@cornell.edu> | 2020-10-22 14:55:52 -0400 |
---|---|---|
committer | Ken Brown <kbrown@cornell.edu> | 2021-06-04 11:19:28 -0400 |
commit | 94f6c2767c6edaf4598e3388c6362138e6332c1d (patch) | |
tree | b2d14eb3c0eb19dfe4df5dcfe831d60ba980bfd2 | |
parent | 0eaa7b8144baa310dbac7e8d85735295602972eb (diff) | |
download | newlib-94f6c2767c6edaf4598e3388c6362138e6332c1d.zip newlib-94f6c2767c6edaf4598e3388c6362138e6332c1d.tar.gz newlib-94f6c2767c6edaf4598e3388c6362138e6332c1d.tar.bz2 |
Cygwin: AF_UNIX: reopen_shmem: fix view size
Use sizeof (af_unix_shmem_t) as the view size, as when the shared
memory was created. Previously PAGESIZE was used, causing
NtMapViewOfSection to fail with STATUS_INVALID_VIEW_SIZE.
-rw-r--r-- | winsup/cygwin/fhandler_socket_unix.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/winsup/cygwin/fhandler_socket_unix.cc b/winsup/cygwin/fhandler_socket_unix.cc index 4eed7e2..8f18c88 100644 --- a/winsup/cygwin/fhandler_socket_unix.cc +++ b/winsup/cygwin/fhandler_socket_unix.cc @@ -257,11 +257,11 @@ int fhandler_socket_unix::reopen_shmem () { NTSTATUS status; - SIZE_T viewsize = PAGESIZE; + SIZE_T viewsize = sizeof (af_unix_shmem_t); PVOID addr = NULL; status = NtMapViewOfSection (shmem_handle, NtCurrentProcess (), &addr, 0, - PAGESIZE, NULL, &viewsize, ViewShare, 0, + viewsize, NULL, &viewsize, ViewShare, 0, PAGE_READWRITE); if (!NT_SUCCESS (status)) { |