Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <4154231F.8050303@tcd.ie> Date: Fri, 24 Sep 2004 14:37:35 +0100 From: david moloney User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.3) Gecko/20040910 MIME-Version: 1.0 To: cygwin AT cygwin DOT com, David Moloney Subject: Porting question: cygwin equivalent of Linux getdirentries()? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiVirus: checked by Vexira MailArmor (version: 2.0.1.16; VAE: 6.27.0.12; VDF: 6.27.0.71; host: smtp3.tcd.ie) 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 -- 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/