Porting question: cygwin equivalent of Linux getdirentries()?

david moloney moloned@tcd.ie
Fri Sep 24 14:06:00 GMT 2004


Whoops ... forgot the code.

- D.


david moloney wrote:

> I have a piece of Linux code I'm trying to port to cygwin which uses 
> sgtty.h (ioctl) and dirent.h (getdirentries) functions which are not 
> present in cygwin.  Also endian.h was missing but I copied it over 
> from RedHat and that seems to work.  I got round the sgetty problems 
> by using #ifdef __CYGWIN__ to patch in termios.h equivalents.  But on 
> the dirent.h front the dirent struct in Cygwin is different from Linux 
> in that it has a long where Linux has an unsigned short ... I patched 
> it anyway and it compiles OK
>
> #ifndef __CYGWIN__
> counter < READ_GPR(V0_REG) && direntp->d_reclen > 0;
> i++, counter += direntp->d_reclen, direntp=(struct dirent 
> *)(buffer+counter)) {
> #else
> counter < READ_GPR(V0_REG) && direntp->d_fd > 0;
> i++, counter += direntp->d_fd, direntp=(struct dirent 
> *)(buffer+counter)) {
> #endif
>
> The only problem remaining is I cannot find a cygwin equivalent of 
> getdirentries in Linux dirent.h and the program fails to link.  I have 
> patched out the reference in the attached file and it compiles but 
> will obviously not work.
>
> Do any of you know what cygwin function I could use in place of 
> getdirentries()?
>
> I've tried googling for the past day and a half to no avail.
>
> Many thanks,
>
> - David
>

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: sys_call.c
URL: <http://cygwin.com/pipermail/cygwin/attachments/20040924/67b37ab5/attachment.c>
-------------- next part --------------
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


More information about the Cygwin mailing list