cvs commit: src/lib/libc/sys pathconf.2

Alfred Perlstein alfred at freebsd.org
Wed Jul 7 23:08:05 PDT 2004


* Bruce Evans <bde at zeta.org.au> [040707 23:04] wrote:
> On Wed, 7 Jul 2004, Garrett Wollman wrote:
> 
> > <<On Wed, 7 Jul 2004 16:34:55 -0700, Alfred Perlstein <alfred at freebsd.org> said:
> >
> > > if _PC_NO_TRUNC returns 1 then an application should assume that
> > > names longer than 14 characters (_POSIX_NAME_MAX) are truncated???
> >
> > No.  Under obsolete versions of POSIX, if {NO_TRUNC} is nonzero, an
> > application should assume that pathname components longer than
> > {NAME_MAX} are not truncated, but instead result in the [ENAMETOOLONG]
> > error.  Under the current version of POSIX, [ENAMETOOLONG] is
> > mandatory for all systems; this was an obsolete option to allow for
> > the behavior of the V7 filesystem, which has been phased out.
> 
> This doesn't apply to FreeBSD.  Truncation is still useful (and used) for
> old non-POSIX file systems like msdosfs:
> 
> % static int
> % msdosfs_pathconf(ap)
> % 	struct vop_pathconf_args /* {
> % 		struct vnode *a_vp;
> % 		int a_name;
> % 		int *a_retval;
> % 	} */ *ap;
> % {
> % 	struct msdosfsmount *pmp = VTODE(ap->a_vp)->de_pmp;
> %
> % 	switch (ap->a_name) {
> % ...
> % 	case _PC_NO_TRUNC:
> % 		*ap->a_retval = 0;
> % 		return (0);
> % ...
> % }
> 
> htpfs and ntpfs also return 0 for _PC_NO_TRUNC, possibly for less reason.
> AFAIK they don't have too-small file name lengths, but they may need to
> truncate names because that is what their native operating system does.

This is over my head, can someone please fix it? :)

-- 
- Alfred Perlstein
- Research Engineering Development Inc.
- email: bright at mu.org cell: 408-480-4684


More information about the cvs-all mailing list