about summary refs log tree commit diff
path: root/hurd
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 /hurd
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 'hurd')
-rw-r--r--hurd/fd-write.c2
-rw-r--r--hurd/fopenport.c2
-rw-r--r--hurd/get-host.c3
-rw-r--r--hurd/hurdioctl.c2
-rw-r--r--hurd/set-host.c2
-rw-r--r--hurd/vpprintf.c4
6 files changed, 8 insertions, 7 deletions
diff --git a/hurd/fd-write.c b/hurd/fd-write.c
index a18e76b4d2..28be1ba758 100644
--- a/hurd/fd-write.c
+++ b/hurd/fd-write.c
@@ -26,7 +26,7 @@ _hurd_fd_write (struct hurd_fd *fd,
 		const void *buf, size_t *nbytes, loff_t offset)
 {
   error_t err;
-  mach_msg_type_number_t wrote;
+  vm_size_t wrote;
 
   error_t writefd (io_t port)
     {
diff --git a/hurd/fopenport.c b/hurd/fopenport.c
index 293c902ae3..5bc01fcd7e 100644
--- a/hurd/fopenport.c
+++ b/hurd/fopenport.c
@@ -48,7 +48,7 @@ readio (void *cookie, char *buf, size_t n)
 static ssize_t
 writeio (void *cookie, const char *buf, size_t n)
 {
-  mach_msg_type_number_t wrote;
+  vm_size_t wrote;
   error_t err;
 
   if (err = __io_write ((io_t) cookie, buf, n, -1, &wrote))
diff --git a/hurd/get-host.c b/hurd/get-host.c
index bdaf86bbf4..a21aa15008 100644
--- a/hurd/get-host.c
+++ b/hurd/get-host.c
@@ -27,7 +27,8 @@ _hurd_get_host_config (const char *item, char *buf, size_t buflen)
 {
   error_t err;
   char *data;
-  mach_msg_type_number_t nread, more;
+  mach_msg_type_number_t nread;
+  vm_size_t more;
   file_t config;
 
   err = __hurd_file_name_lookup (&_hurd_ports_use, &__getdport, 0,
diff --git a/hurd/hurdioctl.c b/hurd/hurdioctl.c
index fce487c12c..526a74aa4d 100644
--- a/hurd/hurdioctl.c
+++ b/hurd/hurdioctl.c
@@ -70,7 +70,7 @@ fioctl (int fd,
 
     case FIONREAD:
       {
-	mach_msg_type_number_t navail;
+	vm_size_t navail;
 	err = HURD_DPORT_USE (fd, __io_readable (port, &navail));
 	if (!err)
 	  *arg = (int) navail;
diff --git a/hurd/set-host.c b/hurd/set-host.c
index 16d1d8deed..afa8f62b5d 100644
--- a/hurd/set-host.c
+++ b/hurd/set-host.c
@@ -24,7 +24,7 @@ ssize_t
 _hurd_set_host_config (const char *item, const char *value, size_t valuelen)
 {
   error_t err;
-  mach_msg_type_number_t nwrote;
+  vm_size_t nwrote;
   file_t new, dir;
   char *name;
 
diff --git a/hurd/vpprintf.c b/hurd/vpprintf.c
index 67450399f5..9ba39957d2 100644
--- a/hurd/vpprintf.c
+++ b/hurd/vpprintf.c
@@ -25,8 +25,8 @@
 static ssize_t
 do_write (void *cookie,	const char *buf, size_t n)
 {
-  error_t error = __io_write ((io_t) cookie, buf, n, -1,
-			      (mach_msg_type_number_t *) &n);
+  vm_size_t amount = n;
+  error_t error = __io_write ((io_t) cookie, buf, n, -1, &amount);
   if (error)
     return __hurd_fail (error);
   return n;