delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/08/06/10:11:55

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Fri, 6 Aug 2010 16:11:40 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: The dirent struct
Message-ID: <20100806141140.GC31783@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>
MIME-Version: 1.0
In-Reply-To: <20100806134005.GD22459@ednor.casa.cgf.cx>
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 09:40, Christopher Faylor wrote:
> On Fri, Aug 06, 2010 at 09:33:41AM -0400, Chris Sutcliffe wrote:
> >I'm well in to the process of porting rtorrent to Cygwin but I've hit
> >a bit of a snag with the dirent struct.  Namely:
> >
> >/usr/src/rtorrent/rtorrent-0.8.6-1/src/rtorrent-0.8.6/src/utils/directory.cc:79:
> >error: ?struct dirent? has no member named ?d_fileno?
> >/usr/src/rtorrent/rtorrent-0.8.6-1/src/rtorrent-0.8.6/src/utils/directory.cc:80:
> >error: ?struct dirent? has no member named ?d_reclen?
> >
> >which sure enough, the Cygwin dirent struct does not:
> >
> >struct dirent
> >{
> >  long __d_version;			/* Used internally */
> >  __ino64_t d_ino;
> >  unsigned char d_type;
> >  unsigned char __d_unused1[3];
> >  __uint32_t __d_internal1;
> >  char d_name[NAME_MAX + 1];
> >};
> >
> >I assume d_fileno and d_reclen may be part of __d_unused1 or
> >__d_internal1?  I'd appreciate some help here, since I'm not sure what
> >to do at this point.
> 
> No, they are not part of either of those fields.  If they were
> they would be exposed.
> 
> They simply are not implemented.

And they don't have to.  Per POSIX, only d_ino and d_name can be
expected by a portable application(*).


Corinna

(*) http://www.opengroup.org/onlinepubs/9699919799/basedefs/dirent.h.html

-- 
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