X-Recipient: archive-cygwin@delorie.com X-Spam-Check-By: sourceware.org Date: Sat, 7 Aug 2010 10:55:32 +0200 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: The dirent struct Message-ID: <20100807085532.GB12927@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <20100806134005.GD22459@ednor.casa.cgf.cx> <20100806141140.GC31783@calimero.vinschen.de> <20100806163925.GE31783@calimero.vinschen.de> <20100806173153.GB23627@ednor.casa.cgf.cx> <20100806182832.GH31783@calimero.vinschen.de> <4C5CA945.6070601@monai.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Delivered-To: mailing list cygwin@cygwin.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