tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[PATCH] UFS: implement some path configuration constants



Implement following constants and add support their to the UFS family of file
systems:
        _PC_2_SYMLINKS
        _PC_SYMLINK_MAX
---
 lib/libc/sys/pathconf.2 |    7 +++++++
 sys/sys/unistd.h        |    2 ++
 sys/ufs/ufs/ufs_vnops.c |    6 ++++++
 3 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/lib/libc/sys/pathconf.2 b/lib/libc/sys/pathconf.2
index c1f0a57..eb47470 100644
--- a/lib/libc/sys/pathconf.2
+++ b/lib/libc/sys/pathconf.2
@@ -105,6 +105,13 @@ If the maximum size file that could ever exist on the 
mounted file system is
 .Dv maxsize ,
 then the returned value is 2 plus the floor of the base 2 logarithm of
 .Dv maxsize .
+.It Li _PC_SYMLINK_MAX
+The maximum number of bytes in a symbolic link.
+.It Li _PC_2_SYMLINKS
+When referring to a directory the system supports the creation of symbolic
+links within that directory; for nondirectory files, the meaning of
+.Dv {_PC_2_SYMLINKS}
+is undefined.
 .El
 .Sh RETURN VALUES
 If the call to
diff --git a/sys/sys/unistd.h b/sys/sys/unistd.h
index 96503e3..1ee3e26 100644
--- a/sys/sys/unistd.h
+++ b/sys/sys/unistd.h
@@ -156,6 +156,8 @@
 #define        _PC_VDISABLE             9
 #define        _PC_SYNC_IO             10
 #define        _PC_FILESIZEBITS        11
+#define        _PC_SYMLINK_MAX         12
+#define        _PC_2_SYMLINKS          13
 
 /* configurable system variables; use as argument to sysconf(3) */
 /*
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c
index 15843ae..25c728c 100644
--- a/sys/ufs/ufs/ufs_vnops.c
+++ b/sys/ufs/ufs/ufs_vnops.c
@@ -2153,6 +2153,12 @@ ufs_pathconf(void *v)
        case _PC_FILESIZEBITS:
                *ap->a_retval = 42;
                return (0);
+       case _PC_SYMLINK_MAX:
+               *ap->a_retval = MAXPATHLEN;
+               return (0);
+       case _PC_2_SYMLINKS:
+               *ap->a_retval = 1;
+               return (0);
        default:
                return (EINVAL);
        }
-- 
1.5.2.5



Home | Main Index | Thread Index | Old Index