🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.unix
Article #114

Re: Query about <dirent.h>

#114
From: Doug Gwyn
Date: Wed, 22 Nov 1989 21:28
21 lines
1361 bytes
From: gwyn@BRL.MIL (Doug Gwyn)

In article <437@longway.TIC.COM> Andy Tanenbaum <uunet!cs.vu.nl!ast> writes:
>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.

You, the implementer, could manually replace that NAME_MAX with the
appropriate value (perhaps found by inspecting <limits.h>).  This is
the same issue as occurs when declaring v*printf() in <stdio.h>; the
related header need not (nay, MUST not) be included, but a compatible
type (or value in the NAME_MAX case) must be used.

>What's an implementer to do?

What I did in my implementation was to cheat:
	char	d_name[1];
We were careful to word the IEEE Std 1003.1 specification so that
this is explicitly allowed.

Volume-Number: Volume 17, Number 66
Technical Details
Message-ID: <438@longway.TIC.COM>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!cica!tut.cis.ohio-state.edu!cs.utexas.edu!longway!std-unix
References: <437@longway.TIC.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!cica!tut.cis.ohio-state.edu!cs.utexas.edu!longway!std-unix
From: gwyn@BRL.MIL (Doug Gwyn)
Newsgroups: comp.std.unix
Subject: Re: Query about <dirent.h>
Message-ID: <438@longway.TIC.COM>
Date: 22 Nov 89 21:28:00 GMT
References: <437@longway.TIC.COM>
Sender: std-unix@longway.TIC.COM
Reply-To: gwyn@brl.arpa (Doug Gwyn)
Organization: Ballistic Research Lab (BRL), APG, MD.
Lines: 21
Approved: jsq@longway.tic.com (Moderator, John S. Quarterman)