summaryrefslogtreecommitdiff
path: root/libdiskfs/file-get-trans.c
diff options
context:
space:
mode:
authorThomas Bushnell <thomas@gnu.org>1999-07-11 05:28:45 +0000
committerThomas Bushnell <thomas@gnu.org>1999-07-11 05:28:45 +0000
commita439e9fc84397a7a802b2e9966df6d2bf7a63e73 (patch)
treecba25dc6e9e3c364866eb450b3d78ba2e7bc1f6b /libdiskfs/file-get-trans.c
parent6ae05c477f2d8931fc365f6f009817e6c26087fd (diff)
1999-07-09 Thomas Bushnell, BSG <tb@mit.edu>
* boot-start.c (diskfs_S_exec_startup_get_info): Use mmap instead of vm_allocate. (diskfs_S_fsys_init): Likewise. * file-get-trans.c (diskfs_S_file_get_translator): Likewise. * file-getfh.c (diskfs_S_file_getfh): Likewise. * io-read.c (diskfs_S_io_read): Likewise.
Diffstat (limited to 'libdiskfs/file-get-trans.c')
-rw-r--r--libdiskfs/file-get-trans.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/libdiskfs/file-get-trans.c b/libdiskfs/file-get-trans.c
index 77be4e1a..118222be 100644
--- a/libdiskfs/file-get-trans.c
+++ b/libdiskfs/file-get-trans.c
@@ -44,7 +44,7 @@ diskfs_S_file_get_translator (struct protid *cred,
int amt;
assert (diskfs_shortcut_symlink);
if (len > *translen)
- vm_allocate (mach_task_self (), (vm_address_t *)trans, len, 1);
+ *trans = mmap (0, len, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0);
bcopy (_HURD_SYMLINK, *trans, sizeof _HURD_SYMLINK);
if (diskfs_read_symlink_hook)
@@ -84,7 +84,7 @@ diskfs_S_file_get_translator (struct protid *cred,
buflen++; /* terminating nul */
if (buflen > *translen)
- vm_allocate (mach_task_self (), (vm_address_t *) trans, buflen, 1);
+ *trans = mmap (0, buflen, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0);
bcopy (buf, *trans, buflen);
free (buf);
*translen = buflen;
@@ -96,7 +96,7 @@ diskfs_S_file_get_translator (struct protid *cred,
len = sizeof _HURD_FIFO;
if (len > *translen)
- vm_allocate (mach_task_self (), (vm_address_t *) trans, len, 1);
+ *trans = mmap (0, len, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0);
bcopy (_HURD_FIFO, *trans, sizeof _HURD_FIFO);
*translen = len;
error = 0;
@@ -107,7 +107,7 @@ diskfs_S_file_get_translator (struct protid *cred,
len = sizeof _HURD_IFSOCK;
if (len > *translen)
- vm_allocate (mach_task_self (), (vm_address_t *) trans, len, 1);
+ *trans = mmap (0, len, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0);
bcopy (_HURD_IFSOCK, *trans, sizeof _HURD_IFSOCK);
*translen = len;
error = 0;
@@ -124,8 +124,7 @@ diskfs_S_file_get_translator (struct protid *cred,
if (!error)
{
if (len > *translen)
- vm_allocate (mach_task_self (), (vm_address_t *) trans,
- len, 1);
+ *trans = mmap (0, len, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0);
bcopy (string, *trans, len);
*translen = len;
free (string);