Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
X-Authentication-Warning: hp2.xraylith.wisc.edu: khan owned process doing -bs
Date: Thu, 22 Feb 2001 11:47:28 -0600 (CST)
From: Mumit Khan <khan@NanoTech.Wisc.EDU>
To: Reuben Thomas <rrt1001@cam.ac.uk>
cc: cygwin@cygwin.com
Subject: Re: mingwin: dirent structure d_name field is pointer not array
In-Reply-To: <Pine.LNX.4.33.0102221409230.855-100000@localhost.localdomain>
Message-ID: <Pine.HPP.3.96.1010222114134.23476B-100000@hp2.xraylith.wisc.edu>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII

On Thu, 22 Feb 2001, Reuben Thomas wrote:

> I'm not sure if this counts as a bug, but readdir as defined by POSIX has a
> field char d_name[], but in mingwin it's a char *, which caused me a fair
> amount of grief working out why I was getting rubbish for the contents of
> directories...

POSIX simply says that readdir() returns pointer to a structure that
contains a member named d_name, which is guaranteed to be null terminated
string; the length is unspecified, but no longer than NAME_MAX. Given 
this specification, how is the Mingw behaviour not correct?

If you can provide a testcase, we'll of course look at it. I'm assuming 
that you're not messing with d_name directly, but rather having problems
using readdir(). Any code that directly modifies `struct dirent' is non
conforming, and that's not something we can do anything about.

Regars,
Mumit



--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

