about summary refs log tree commit diff
path: root/sysdeps/mach
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2022-08-29 01:42:47 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2022-08-29 01:42:47 +0200
commit063f7462dac26487e38b126afcf80dad77da444c (patch)
tree8e515d0d1fef257d0a75120e0e0b607d5fb9fad3 /sysdeps/mach
parentcb033e6b0ca7b8873cd00687ffd1828038a595d3 (diff)
downloadglibc-063f7462dac26487e38b126afcf80dad77da444c.tar.gz
glibc-063f7462dac26487e38b126afcf80dad77da444c.tar.xz
glibc-063f7462dac26487e38b126afcf80dad77da444c.zip
hurd: Fix vm_size_t incoherencies
In gnumach, 3e1702a65fb3 ("add rpc_versions for vm types") changed the type
of vm_size_t, making it always a unsigned long. This made it incompatible on
x86 with size_t. Even if we may want to revert it to unsigned int, it's
better to fix the types of parameters according to the .defs files.
Diffstat (limited to 'sysdeps/mach')
-rw-r--r--sysdeps/mach/hurd/dl-sysdep.c4
-rw-r--r--sysdeps/mach/hurd/ptrace.c5
-rw-r--r--sysdeps/mach/hurd/send.c2
-rw-r--r--sysdeps/mach/hurd/sendfile64.c2
-rw-r--r--sysdeps/mach/hurd/sendmsg.c2
-rw-r--r--sysdeps/mach/hurd/sendto.c2
6 files changed, 10 insertions, 7 deletions
diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c
index f23fdee058..2f022ee90c 100644
--- a/sysdeps/mach/hurd/dl-sysdep.c
+++ b/sysdeps/mach/hurd/dl-sysdep.c
@@ -382,7 +382,7 @@ __ssize_t weak_function
 __write (int fd, const void *buf, size_t nbytes)
 {
   error_t err;
-  mach_msg_type_number_t nwrote;
+  vm_size_t nwrote;
 
   assert (fd < _hurd_init_dtablesize);
 
@@ -415,7 +415,7 @@ __writev (int fd, const struct iovec *iov, int niov)
     {
       char buf[total], *bufp = buf;
       error_t err;
-      mach_msg_type_number_t nwrote;
+      vm_size_t nwrote;
 
       for (i = 0; i < niov; ++i)
 	bufp = (memcpy (bufp, iov[i].iov_base, iov[i].iov_len)
diff --git a/sysdeps/mach/hurd/ptrace.c b/sysdeps/mach/hurd/ptrace.c
index 9a32cd9a60..a043f325c5 100644
--- a/sysdeps/mach/hurd/ptrace.c
+++ b/sysdeps/mach/hurd/ptrace.c
@@ -47,8 +47,11 @@ ptrace (enum __ptrace_request request, ... )
     {
       /* Read the pages containing the addressed range.  */
       error_t err;
+      mach_msg_type_number_t nread;
       *size = round_page (addr + data) - trunc_page (addr);
-      err = __vm_read (task, trunc_page (addr), *size, ourpage, size);
+      err = __vm_read (task, trunc_page (addr), *size, ourpage, &nread);
+      if (!err)
+	*size = nread;
       return err;
     }
 
diff --git a/sysdeps/mach/hurd/send.c b/sysdeps/mach/hurd/send.c
index c0826f1d18..4df38e2b5f 100644
--- a/sysdeps/mach/hurd/send.c
+++ b/sysdeps/mach/hurd/send.c
@@ -27,7 +27,7 @@ ssize_t
 __send (int fd, const void *buf, size_t n, int flags)
 {
   error_t err;
-  size_t wrote;
+  vm_size_t wrote;
   int cancel_oldtype;
 
   cancel_oldtype = LIBC_CANCEL_ASYNC();
diff --git a/sysdeps/mach/hurd/sendfile64.c b/sysdeps/mach/hurd/sendfile64.c
index 77c3a2fbf1..8b24f2169c 100644
--- a/sysdeps/mach/hurd/sendfile64.c
+++ b/sysdeps/mach/hurd/sendfile64.c
@@ -42,7 +42,7 @@ __sendfile64 (int out_fd, int in_fd, off64_t *offset, size_t count)
 					   count));
   if (err == 0)
     {
-      size_t nwrote;
+      vm_size_t nwrote;
       if (datalen == 0)
 	return 0;
       err = HURD_DPORT_USE (out_fd, __io_write (port, data, datalen,
diff --git a/sysdeps/mach/hurd/sendmsg.c b/sysdeps/mach/hurd/sendmsg.c
index 56bcee733f..5ca01fc1ad 100644
--- a/sysdeps/mach/hurd/sendmsg.c
+++ b/sysdeps/mach/hurd/sendmsg.c
@@ -47,7 +47,7 @@ __libc_sendmsg (int fd, const struct msghdr *message, int flags)
   } data = { .ptr = NULL };
   char data_buf[2048];
   mach_msg_type_number_t len;
-  mach_msg_type_number_t amount;
+  vm_size_t amount;
   int dealloc = 0;
   int socketrpc = 0;
   int i;
diff --git a/sysdeps/mach/hurd/sendto.c b/sysdeps/mach/hurd/sendto.c
index e55469fea0..36a76bc043 100644
--- a/sysdeps/mach/hurd/sendto.c
+++ b/sysdeps/mach/hurd/sendto.c
@@ -37,7 +37,7 @@ __sendto (int fd,
 {
   addr_port_t aport = MACH_PORT_NULL;
   error_t err;
-  size_t wrote;
+  vm_size_t wrote;
 
   /* Get an address port for the desired destination address.  */
   error_t create_address_port (io_t port,