diff options
author | Marcus Brinkmann <marcus@gnu.org> | 2001-01-30 00:50:25 +0000 |
---|---|---|
committer | Marcus Brinkmann <marcus@gnu.org> | 2001-01-30 00:50:25 +0000 |
commit | 0e64f4e5701389ae3df1f6c388173e3ec254fc89 (patch) | |
tree | 9addc41a01834232537fe2b63f5289e5d24611af /libnetfs/file-get-storage-info.c | |
parent | a9947c232ecddc42551b144f119ac3b46a608d2a (diff) | |
download | hurd-0e64f4e5701389ae3df1f6c388173e3ec254fc89.tar.gz hurd-0e64f4e5701389ae3df1f6c388173e3ec254fc89.tar.bz2 hurd-0e64f4e5701389ae3df1f6c388173e3ec254fc89.zip |
2001-01-15 Neal H Walfield <neal@cs.uml.edu>
* netfs.h: Added netfs_get_storage_info.
* file-get-storage-info.c (netfs_S_get_storage_info): Calls
netfs_get_storage_info instead of providing default response.
* file-get-storage-info-default.c: New file.
(netfs_get_storage_info): Provides default response.
Diffstat (limited to 'libnetfs/file-get-storage-info.c')
-rw-r--r-- | libnetfs/file-get-storage-info.c | 43 |
1 files changed, 18 insertions, 25 deletions
diff --git a/libnetfs/file-get-storage-info.c b/libnetfs/file-get-storage-info.c index e9eb32bb..ac977be3 100644 --- a/libnetfs/file-get-storage-info.c +++ b/libnetfs/file-get-storage-info.c @@ -1,6 +1,6 @@ /* - Copyright (C) 1995, 1996, 1999 Free Software Foundation, Inc. - Written by Michael I. Bushnell, p/BSG. + Copyright (C) 2001 Free Software Foundation, Inc. + Written by Neal H Walfield <neal@cs.uml.edu> This file is part of the GNU Hurd. @@ -20,35 +20,28 @@ #include "netfs.h" #include "fs_S.h" -#include <sys/mman.h> error_t netfs_S_file_get_storage_info (struct protid *user, - mach_port_t **ports, - mach_msg_type_name_t *ports_type, - mach_msg_type_number_t *num_ports, - int **ints, mach_msg_type_number_t *num_ints, - off_t **offsets, - mach_msg_type_number_t *num_offsets, - char **data, mach_msg_type_number_t *data_len) + mach_port_t **ports, + mach_msg_type_name_t *ports_type, + mach_msg_type_number_t *num_ports, + int **ints, mach_msg_type_number_t *num_ints, + off_t **offsets, + mach_msg_type_number_t *num_offsets, + char **data, mach_msg_type_number_t *data_len) { + error_t err; + if (!user) return EOPNOTSUPP; - *data_len = 0; - *num_offsets = 0; - *num_ports = 0; - - if (*num_ints == 0) - /* Argh */ - { - *ints = mmap (0, sizeof (int), PROT_READ|PROT_WRITE, MAP_ANON, 0, 0); - if (*ints == (int *) -1) - return errno; - } - - *num_ints = 1; - (*ints)[0] = STORAGE_NETWORK; + mutex_lock (&user->po->np->lock); + err = netfs_file_get_storage_info (user->user, user->po->np, ports, + ports_type, num_ports, ints, + num_ints, offsets, num_offsets, + data, data_len); + mutex_unlock (&user->po->np->lock); - return 0; + return err; } |