This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Porting question: cygwin equivalent of Linux getdirentries()?

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)) {
counter < READ_GPR(V0_REG) && direntp->d_fd > 0;
i++, counter += direntp->d_fd, direntp=(struct dirent *)(buffer+counter)) {

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

-- Unsubscribe info: Problem reports: Documentation: FAQ:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]