Implement following constants and add support their to the UFS family of file

systems:
	_PC_2_SYMLINKS
	_PC_SYMLINK_MAX

From andy dot shevchenko at gmail dot com.
This commit is contained in:
matt 2008-08-14 16:19:25 +00:00
parent 10b4d05961
commit 8165c33c80
3 changed files with 19 additions and 4 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: pathconf.2,v 1.19 2005/08/14 07:28:29 jmmv Exp $
.\" $NetBSD: pathconf.2,v 1.20 2008/08/14 16:19:25 matt Exp $
.\"
.\" Copyright (c) 1993
.\" The Regents of the University of California. All rights reserved.
@ -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

View File

@ -1,4 +1,4 @@
/* $NetBSD: unistd.h,v 1.44 2008/08/06 17:17:03 matt Exp $ */
/* $NetBSD: unistd.h,v 1.45 2008/08/14 16:19:25 matt Exp $ */
/*
* Copyright (c) 1989, 1993
@ -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) */
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: ufs_vnops.c,v 1.168 2008/08/12 10:14:38 hannken Exp $ */
/* $NetBSD: ufs_vnops.c,v 1.169 2008/08/14 16:19:25 matt Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ufs_vnops.c,v 1.168 2008/08/12 10:14:38 hannken Exp $");
__KERNEL_RCSID(0, "$NetBSD: ufs_vnops.c,v 1.169 2008/08/14 16:19:25 matt Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ffs.h"
@ -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);
}