Article View: comp.std.unix
Article #113Query about <dirent.h>
From: Moderator, John S. Quarterman
Date: Wed, 22 Nov 1989 11:38
Date: Wed, 22 Nov 1989 11:38
34 lines
1279 bytes
1279 bytes
From: Andy Tanenbaum <uunet!cs.vu.nl!ast>
The <dirent.h> header is required by P1003.1 to have a field
d_name []
Now the question arises about what size to use there. One possibility is
d_name[NAME_MAX+1]
However, doing this means that <limits.h> must be included. As far as I
can see, the following is a conforming application:
#include <dirent.h>
main()
{
(void) opendir("/usr");
}
If one uses NAME_MAX in <dirent.h>, we have a conforming application that
won't even compile.
Another solution is to put
#define _NAME_MAX 14
in <dirent.h> and use that (assuming the result of the discussion on
name space pollution permits this). It might work, but it is hardly
elegant.
What's an implementer to do?
Andy Tanenbaum (ast@cs.vu.nl)
Volume-Number: Volume 17, Number 65
Technical Details
Message-ID:
<437@longway.TIC.COM>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!longway!std-unixShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!longway!std-unix From: std-unix@longway.TIC.COM (Moderator, John S. Quarterman) Newsgroups: comp.std.unix Subject: Query about <dirent.h> Message-ID: <437@longway.TIC.COM> Date: 22 Nov 89 11:38:36 GMT Reply-To: Andy Tanenbaum <uunet!cs.vu.nl!ast> Organization: VU Informatica, Amsterdam Lines: 34 Approved: jsq@longway.tic.com (Moderator, John S. Quarterman)