From 07ac809a3395c5776fec2f2a50e2f8eaa6be459f Mon Sep 17 00:00:00 2001 From: Thomas Bushnell Date: Sun, 11 Jul 1999 05:31:41 +0000 Subject: 1999-07-09 Thomas Bushnell, BSG * io-ops.c (S_io_read): Use mmap instead of vm_allocate. * socket-ops.c (S_socket_whatis_address): Likewise. --- pfinet/ChangeLog | 5 +++++ pfinet/io-ops.c | 2 +- pfinet/socket-ops.c | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/pfinet/ChangeLog b/pfinet/ChangeLog index 71d704ca..fb8f2683 100644 --- a/pfinet/ChangeLog +++ b/pfinet/ChangeLog @@ -1,6 +1,11 @@ 1999-07-10 Roland McGrath * io-ops.c: Add #include for munmap decl. + +1999-07-09 Thomas Bushnell, BSG + + * io-ops.c (S_io_read): Use mmap instead of vm_allocate. + * socket-ops.c (S_socket_whatis_address): Likewise. 1999-07-03 Thomas Bushnell, BSG diff --git a/pfinet/io-ops.c b/pfinet/io-ops.c index 6da558c7..b6831c31 100644 --- a/pfinet/io-ops.c +++ b/pfinet/io-ops.c @@ -75,7 +75,7 @@ S_io_read (struct sock_user *user, allocate as much as necessary. */ if (amount > *datalen) { - vm_allocate (mach_task_self (), (vm_address_t *)data, amount, 1); + *data = mmap (0, amount, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0); alloced = 1; } diff --git a/pfinet/socket-ops.c b/pfinet/socket-ops.c index d9a20263..1bd8c225 100644 --- a/pfinet/socket-ops.c +++ b/pfinet/socket-ops.c @@ -1,5 +1,5 @@ /* Interface functions for the socket.defs interface. - Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 1999 Free Software Foundation, Inc. Written by Michael I. Bushnell, p/BSG. This file is part of the GNU Hurd. @@ -339,7 +339,7 @@ S_socket_whatis_address (struct sock_addr *addr, *type = AF_INET; if (*datalen < addr->len) - vm_allocate (mach_task_self (), (vm_address_t *) data, addr->len, 1); + *data = mmap (0, addr->len, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0); bcopy (addr->address, *data, addr->len); *datalen = addr->len; -- cgit v1.2.3