delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/08/07/04:55:45

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Sat, 7 Aug 2010 10:55:32 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: The dirent struct
Message-ID: <20100807085532.GB12927@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <AANLkTimghbyew2f+Q1fSTfpzv0cw7CrypX60vcW0Qgyb AT mail DOT gmail DOT com> <20100806134005 DOT GD22459 AT ednor DOT casa DOT cgf DOT cx> <20100806141140 DOT GC31783 AT calimero DOT vinschen DOT de> <AANLkTimnMASSuyv4mXtt3x8d=NZMg4y1DuCfT4Jr44Qt AT mail DOT gmail DOT com> <20100806163925 DOT GE31783 AT calimero DOT vinschen DOT de> <20100806173153 DOT GB23627 AT ednor DOT casa DOT cgf DOT cx> <20100806182832 DOT GH31783 AT calimero DOT vinschen DOT de> <AANLkTimEG2YeQfNBGNSp7DAS69wf9x+6W_WUQEwu0mE- AT mail DOT gmail DOT com> <4C5CA945 DOT 6070601 AT monai DOT ca> <AANLkTimoe7ZOMkymQK3BPmg2yvWXGkF2qf2C9JjUdxqn AT mail DOT gmail DOT com>
MIME-Version: 1.0
In-Reply-To: <AANLkTimoe7ZOMkymQK3BPmg2yvWXGkF2qf2C9JjUdxqn@mail.gmail.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Aug  6 23:21, Chris Sutcliffe wrote:
> On 6 August 2010 20:31, Steven Monai wrote:
> > On 2010/08/06 11:48 AM, Chris Sutcliffe wrote:
> >> I've decided to take a different approach and decided to implement it
> >> as follows:
> >>
> >> #ifdef __CYGWIN__
> >>     itr->d_fileno = entry->d_ino;
> >>     itr->d_reclen = strlen(entry->d_name);
> >> #else
> >>     itr->d_fileno = entry->d_fileno;
> >>     itr->d_reclen = entry->d_reclen;
> >> #endif
> >>
> >> I assume this is appropriate?
> > [...]
> > "Defining d_*rec*len as strlen(d_name) would not be correct since that
> > is supposed to be the length of the record not the name."
> [...]
> I'll leave it as is for now (I figure having something there is better
> than nothing at all).

  itr->d_reclen = __builtin_offsetof (struct dirent, d_name)
                  + strlen (entry->d_name) + 1;


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019