From 4602afce4572c8e39e695386d298de70da2b3c80 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Wed, 13 Oct 1999 19:41:44 +0000 Subject: 1999-10-13 Roland McGrath * diskfs.h (diskfs_name_max): Declare new variable. * io-pathconf.c (diskfs_S_io_pathconf): Use it for _PC_NAME_MAX, capping it to 1024. --- libdiskfs/io-pathconf.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'libdiskfs/io-pathconf.c') diff --git a/libdiskfs/io-pathconf.c b/libdiskfs/io-pathconf.c index 666e039a..ec13fd14 100644 --- a/libdiskfs/io-pathconf.c +++ b/libdiskfs/io-pathconf.c @@ -22,7 +22,7 @@ /* Implement io_pathconf as described in . */ kern_return_t diskfs_S_io_pathconf (struct protid *cred, - int name, + int name, int *value) { if (!cred) @@ -41,9 +41,10 @@ diskfs_S_io_pathconf (struct protid *cred, case _PC_SOCK_MAXBUF: *value = -1; break; - + case _PC_NAME_MAX: - *value = 1024; /* see string_t */ + /* string_t constrains the upper bound. */ + *value = diskfs_name_max > 1024 ? 1024 : diskfs_name_max; break; case _PC_CHOWN_RESTRICTED: @@ -52,7 +53,7 @@ diskfs_S_io_pathconf (struct protid *cred, case _PC_ASYNC_IO: *value = 1; break; - + case _PC_PRIO_IO: *value = 0; break; @@ -64,6 +65,6 @@ diskfs_S_io_pathconf (struct protid *cred, default: return EINVAL; } - + return 0; } -- cgit v1.2.3