diff options
-rw-r--r-- | ChangeLog | 19 | ||||
-rw-r--r-- | hurd/hurd/lookup.h | 39 | ||||
-rw-r--r-- | hurd/path-lookup.c | 15 | ||||
-rw-r--r-- | sysdeps/mach/hurd/access.c | 2 |
4 files changed, 67 insertions, 8 deletions
@@ -1,3 +1,22 @@ +Wed Jun 19 10:21:24 1996 Miles Bader <miles@gnu.ai.mit.edu> + + * hurd/hurdlookup.c (__hurd_file_name_lookup_retry, + __hurd_file_name_lookup, __hurd_file_name_split): Add & use LOOKUP argument. + Rename nested function lookup to lookup_op. + (__file_name_lookup, __file_name_lookup_under): + Pass 0 for lookup arg to __hurd_file_name_lookup. + (__file_name_split): Likewise for __hurd_file_name_split. + * hurd/path-lookup.c (hurd_file_name_path_lookup): Add LOOKUP argument. + Rename nested function lookup to scan_lookup. + (file_name_path_lookup): Pass 0 for lookup arg to + hurd_file_name_path_lookup. + * hurd/hurd/lookup.h (__hurd_file_name_lookup, hurd_file_name_lookup, + __hurd_file_name_lookup_retry, hurd_file_name_lookup_retry: + __hurd_file_name_split, hurd_file_name_split, hurd_file_name_lookup): + Add LOOKUP argument. + * sysdeps/mach/hurd/access.c (__access): Pass 0 lookup arg to + __hurd_file_name_lookup. + Mon Jun 17 19:09:49 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * Make-dist (+sysdeps): Move wildcard inside loop to avoid consing diff --git a/hurd/hurd/lookup.h b/hurd/hurd/lookup.h index 565ab31..df5f38b 100644 --- a/hurd/hurd/lookup.h +++ b/hurd/hurd/lookup.h @@ -31,6 +31,10 @@ Cambridge, MA 02139, USA. */ is consumed; the right will only be used after *OPERATE returns if *OPERATE has added its own user reference. + LOOKUP is a function to do the actual filesystem lookup. It is passed the + same arguments that the dir_lookup rpc accepts, and if 0, __dir_lookup is + used. + The second callback function GET_DTABLE_PORT should behave like `getdport'. All these functions return zero on success or an error code on failure. */ @@ -44,6 +48,10 @@ error_t __hurd_file_name_lookup (error_t (*use_init_port) (int which, error_t (*operate) (mach_port_t)), file_t (*get_dtable_port) (int fd), + error_t (*lookup) + (file_t dir, char *name, int flags, mode_t mode, + retry_type *do_retry, string_t retry_name, + mach_port_t *result), const char *file_name, int flags, mode_t mode, file_t *result); @@ -51,6 +59,10 @@ error_t hurd_file_name_lookup (error_t (*use_init_port) (int which, error_t (*operate) (mach_port_t)), file_t (*get_dtable_port) (int fd), + error_t (*lookup) + (file_t dir, char *name, int flags, mode_t mode, + retry_type *do_retry, string_t retry_name, + mach_port_t *result), const char *file_name, int flags, mode_t mode, file_t *result); @@ -64,12 +76,20 @@ error_t __hurd_file_name_split (error_t (*use_init_port) (int which, error_t (*operate) (mach_port_t)), file_t (*get_dtable_port) (int fd), + error_t (*lookup) + (file_t dir, char *name, int flags, mode_t mode, + retry_type *do_retry, string_t retry_name, + mach_port_t *result), const char *file_name, file_t *dir, char **name); error_t hurd_file_name_split (error_t (*use_init_port) (int which, error_t (*operate) (mach_port_t)), file_t (*get_dtable_port) (int fd), + error_t (*lookup) + (file_t dir, char *name, int flags, mode_t mode, + retry_type *do_retry, string_t retry_name, + mach_port_t *result), const char *file_name, file_t *dir, char **name); @@ -84,6 +104,12 @@ error_t __hurd_file_name_lookup_retry (error_t (*use_init_port) (int which, error_t (*operate) (mach_port_t)), file_t (*get_dtable_port) (int fd), + error_t (*lookup) + (file_t dir, char *name, + int flags, mode_t mode, + retry_type *do_retry, + string_t retry_name, + mach_port_t *result), enum retry_type doretry, char retryname[1024], int flags, mode_t mode, @@ -92,6 +118,12 @@ error_t hurd_file_name_lookup_retry (error_t (*use_init_port) (int which, error_t (*operate) (mach_port_t)), file_t (*get_dtable_port) (int fd), + error_t (*lookup) + (file_t dir, char *name, + int flags, mode_t mode, + retry_type *do_retry, + string_t retry_name, + mach_port_t *result), enum retry_type doretry, char retryname[1024], int flags, mode_t mode, @@ -122,9 +154,14 @@ error_t hurd_file_name_path_lookup (error_t (*use_init_port) (int which, error_t (*operate) (mach_port_t)), file_t (*get_dtable_port) (int fd), + error_t (*lookup) + (file_t dir, char *name, + int flags, mode_t mode, + retry_type *do_retry, + string_t retry_name, + mach_port_t *result), const char *file_name, const char *path, int flags, mode_t mode, file_t *result, char **prefixed_name); - #endif /* hurd/lookup.h */ diff --git a/hurd/path-lookup.c b/hurd/path-lookup.c index 9e0fff4..cc12454 100644 --- a/hurd/path-lookup.c +++ b/hurd/path-lookup.c @@ -89,20 +89,23 @@ file_name_path_scan (const char *file_name, const char *path, malloced storage containing the prefixed name. */ error_t hurd_file_name_path_lookup (error_t (*use_init_port) - (int which, - error_t (*operate) (mach_port_t)), + (int which, error_t (*operate) (mach_port_t)), file_t (*get_dtable_port) (int fd), + error_t (*lookup) + (file_t dir, char *name, int flags, mode_t mode, + retry_type *do_retry, string_t retry_name, + mach_port_t *result), const char *file_name, const char *path, int flags, mode_t mode, file_t *result, char **prefixed_name) { - error_t lookup (const char *name) + error_t scan_lookup (const char *name) { return - __hurd_file_name_lookup (use_init_port, get_dtable_port, + __hurd_file_name_lookup (use_init_port, get_dtable_port, lookup, name, flags, mode, result); } - return file_name_path_scan (file_name, path, lookup, prefixed_name); + return file_name_path_scan (file_name, path, scan_lookup, prefixed_name); } file_t @@ -112,7 +115,7 @@ file_name_path_lookup (const char *file_name, const char *path, error_t err; file_t result; - err = hurd_file_name_path_lookup (&_hurd_ports_use, &__getdport, + err = hurd_file_name_path_lookup (&_hurd_ports_use, &__getdport, 0, file_name, path, flags, mode, &result, prefixed_name); diff --git a/sysdeps/mach/hurd/access.c b/sysdeps/mach/hurd/access.c index eb57d92..009a72c 100644 --- a/sysdeps/mach/hurd/access.c +++ b/sysdeps/mach/hurd/access.c @@ -108,7 +108,7 @@ DEFUN(__access, (file, type), CONST char *file AND int type) if (!err) /* Look up the file name using the modified init ports. */ - err = __hurd_file_name_lookup (&init_port, &__getdport, + err = __hurd_file_name_lookup (&init_port, &__getdport, 0, file, 0, 0, &io); /* We are done with _hurd_id.rid_auth now. */ |