Mail Archives: cygwin/2012/03/18/13:50:21
On 3/18/2012 5:46 PM, Tom Szczesny wrote:
> The current issue that I am facing is with an EnumTable. (see code
> listing below).
> It exists in a file named aplus-fsf-4.22/src/cxsys/eponymous.c
> LEXABUG is not defined in Cygwin. As far as I can tell, it is not
> defined in Gentoo Linux either.
> The code builds OK in Gentoo Linux.
>
> In Cygwin, with LEXABUG not defined, I get:
> error: 'FIOCLEX' undeclared here (not in a function)
>
> In Cygwin, with LEXABUG defined, I get:
> error 'FIOCLEX" undeclared (first use in this function)
>
> FIOCLEX is not declared (or mentioned) anywhere else in the source code package.
I suspect that FIOCLEX and FIONCLEX are not defined at all on cygwin.
On BSD they are defined on sys/filio.h as
#define FIOCLEX _IO('f', 1)
#define FIONCLEX _IO('f', 2)
see http://fxr.watson.org/fxr/ident?im=10;i=FIOCLEX
While on Linux they are defined or
#define FIOCLEX _IO('f', 1)
#define FIONCLEX _IO('f', 2)
or
#define FIONCLEX 0x5450
#define FIOCLEX 0x5451
see http://lxr.free-electrons.com/ident?i=FIOCLEX
>
> I will continue to research EnumTable structures in C, but I thouht
> someone might have a recommendation.
> listing of code fragment begins here:
>
> #ifndef LEXABUG
> static EnumTable IoctlEnums[] = {
> { FIOCLEX, "FIOCLEX", 0 },
> { FIONCLEX, "FIONCLEX", 0 },
> { FIONREAD, "FIONREAD", 0 },
> { FIONBIO, "FIONBIO", 0 },
> { FIOASYNC, "FIOASYNC", 0 },
> { FIOSETOWN, "FIOSETOWN", 0 },
> { FIOGETOWN, "FIOGETOWN", 0 },
> { TIOCGPGRP, "TIOCGPGRP", 0 },
> { TIOCSPGRP, "TIOCSPGRP", 0 },
> { TIOCOUTQ, "TIOCOUTQ", 0 },
> { TIOCSTI, "TIOCSTI", 0 },
> { TIOCGWINSZ, "TIOCGWINSZ", 0 },
> { TIOCSWINSZ, "TIOCSWINSZ", 0 },
> { TIOCMGET, "TIOCMGET", 0 },
> { TIOCMBIS, "TIOCMBIS", 0 },
> { TIOCMBIC, "TIOCMBIC", 0 },
> { TIOCMSET, "TIOCMSET", 0 },
> { 0, (char *)0, 0 }
> };
> #else
> static EnumTable IoctlEnums[] = {
> { 0, "FIOCLEX", 0 },
> { 0, "FIONCLEX", 0 },
> { 0, "FIONREAD", 0 },
> { 0, "FIONBIO", 0 },
> { 0, "FIOASYNC", 0 },
> { 0, "FIOSETOWN", 0 },
> { 0, "FIOGETOWN", 0 },
> { 0, "TCGETS", 0 },
> { 0, "TCSETS", 0 },
> { 0, "TCSETSW", 0 },
> { 0, "TCSETSF", 0 },
> { 0, "TCXONC", 0 },
> { 0, "TCFLSH", 0 },
> { 0, "TIOCSCTTY", 0 },
> { 0, "TIOCGPGRP", 0 },
>
> { 0, "TIOCSPGRP", 0 },
> { 0, "TIOCOUTQ", 0 },
> { 0, "TIOCSTI", 0 },
> { 0, "TIOCGWINSZ", 0 },
> { 0, "TIOCSWINSZ", 0 },
> { 0, "TIOCMGET", 0 },
> { 0, "TIOCMBIS", 0 },
> { 0, "TIOCMBIC", 0 },
> { 0, "TIOCMSET", 0 },
> { 0, "TIOCGSOFTCAR", 0 },
> { 0, "TIOCSSOFTCAR", 0 },
> { 0, (char *)0, 0 }
> };
>
> int initIoctlTable(void)
> {
> EnumTable *EnumTablePtr = IoctlEnums;
> EnumTablePtr->value = FIOCLEX; EnumTablePtr ++;
> EnumTablePtr->value = FIONCLEX; EnumTablePtr ++;
> EnumTablePtr->value = FIONREAD; EnumTablePtr ++;
> EnumTablePtr->value = FIONBIO; EnumTablePtr ++;
> EnumTablePtr->value = FIOASYNC; EnumTablePtr ++;
> EnumTablePtr->value = FIOSETOWN; EnumTablePtr ++;
> EnumTablePtr->value = FIOGETOWN; EnumTablePtr ++;
> EnumTablePtr->value = TCGETS; EnumTablePtr ++;
> EnumTablePtr->value = TCSETS; EnumTablePtr ++;
> EnumTablePtr->value = TCSETSW; EnumTablePtr ++;
> EnumTablePtr->value = TCSETSF; EnumTablePtr ++;
> EnumTablePtr->value = TCXONC; EnumTablePtr ++;
> EnumTablePtr->value = TCFLSH; EnumTablePtr ++;
> EnumTablePtr->value = TIOCSCTTY; EnumTablePtr ++;
> EnumTablePtr->value = TIOCGPGRP; EnumTablePtr ++;
> EnumTablePtr->value = TIOCSPGRP; EnumTablePtr ++;
> EnumTablePtr->value = TIOCOUTQ; EnumTablePtr ++;
> EnumTablePtr->value = TIOCSTI; EnumTablePtr ++;
> EnumTablePtr->value = TIOCGWINSZ; EnumTablePtr ++;
> EnumTablePtr->value = TIOCSWINSZ; EnumTablePtr ++;
> EnumTablePtr->value = TIOCMGET; EnumTablePtr ++;
> EnumTablePtr->value = TIOCMBIS; EnumTablePtr ++;
> EnumTablePtr->value = TIOCMBIC; EnumTablePtr ++;
> EnumTablePtr->value = TIOCMSET; EnumTablePtr ++;
> EnumTablePtr->value = TIOCGSOFTCAR; EnumTablePtr ++;
> EnumTablePtr->value = TIOCSSOFTCAR;
> return 0;
>
> }
> #endif
>
--
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 -