Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Oct 1998 20:30:01 -0700 (PDT)
From:      Bruce Evans <bde@zeta.org.au>
To:        freebsd-bugs@FreeBSD.ORG
Subject:   Re: kern/8165: minor inconsistency in dirent.h
Message-ID:  <199810080330.UAA25074@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/8165; it has been noted by GNATS.

From: Bruce Evans <bde@zeta.org.au>
To: aledm@routers.co.uk, bde@zeta.org.au
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: kern/8165: minor inconsistency in dirent.h
Date: Thu, 8 Oct 1998 13:23:04 +1000

 >I understand what you're saying, but do you agree that having the same
 >constant (i.e. constants with the same meaning) being defined in two
 >places is bad?
 
 It's no worse than the same types being defined in several headers, as
 they must be to limit namespace pollution.  size_t is a good example.
 The right technique for this is to define them in terms of a commin
 definition in an implementation-only header like <machine/ansi.h>.
 
 A closer look shows that MAXNAMLEN is not the same as NAME_MAX.
 They just happen to have the same value.  NAME_MAX (if it is defined)
 is supposed to give the maximum length of a file name - file names
 of this length (but no longer) may exist on all (POSIX) file systems.
 MAXNAMLEN in <sys/dirent.h> is just the maximum length of a file name
 that may be returned by readdir().  It should be defined as the maximum
 of all the per-file-system maximum name lengths, but that is too hard
 to put in a single #define.
 
 Bruce

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199810080330.UAA25074>