public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Attempt to build aplus-fsf-4.22 (EnumTable)
@ 2012-03-19 14:51 Tom Szczesny
  2012-03-19 16:01 ` marco atzeri
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Szczesny @ 2012-03-19 14:51 UTC (permalink / raw)
  To: cygwin

Well, of course, you are correct.  It did not work.
It was like a sinkhole.
For each header file that I included in the aplus source,
an additional header file was required.

You asked what definitions were initially required.  They are:

FIOCLEX
FIONCLEX
FIOSETOWN
FIOGETOWN
TIOCOUTQ
TIOCSTI

I assume from your question, that I should declare these
variables in the source, rather than bring in the header files
that the source is expecting.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Attempt to build aplus-fsf-4.22 (EnumTable)
  2012-03-19 14:51 Attempt to build aplus-fsf-4.22 (EnumTable) Tom Szczesny
@ 2012-03-19 16:01 ` marco atzeri
  0 siblings, 0 replies; 4+ messages in thread
From: marco atzeri @ 2012-03-19 16:01 UTC (permalink / raw)
  To: cygwin

On 3/19/2012 3:51 PM, Tom Szczesny wrote:
> Well, of course, you are correct.  It did not work.
> It was like a sinkhole.
> For each header file that I included in the aplus source,
> an additional header file was required.
>
> You asked what definitions were initially required.  They are:
>
> FIOCLEX
> FIONCLEX
> FIOSETOWN
> FIOGETOWN
> TIOCOUTQ
> TIOCSTI
>
> I assume from your question, that I should declare these
> variables in the source, rather than bring in the header files
> that the source is expecting.
>

Tom,
FYI, in the past the xmon maintainer used
this strategy, to overcome the lack of FIOCLEX/FIONCLEX

#if defined(SYSV) || defined(__CYGWIN__)
      fcntl(ConnectionSocket, F_SETFD, FD_CLOEXEC);
#else
      ioctl(ConnectionSocket, FIOCLEX, 0);
#endif


#if defined(SYSV) || defined(__CYGWIN__)
      fcntl(ClientFD, F_SETFD, FD_CLOEXEC);
#else
      ioctl(ClientFD, FIOCLEX, 0);
#endif


Regards
Marco



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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Attempt to build aplus-fsf-4.22 (EnumTable)
  2012-03-18 16:46 Tom Szczesny
@ 2012-03-18 17:50 ` marco atzeri
  0 siblings, 0 replies; 4+ messages in thread
From: marco atzeri @ 2012-03-18 17:50 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Attempt to build aplus-fsf-4.22 (EnumTable)
@ 2012-03-18 16:46 Tom Szczesny
  2012-03-18 17:50 ` marco atzeri
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Szczesny @ 2012-03-18 16:46 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-03-19 16:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-19 14:51 Attempt to build aplus-fsf-4.22 (EnumTable) Tom Szczesny
2012-03-19 16:01 ` marco atzeri
  -- strict thread matches above, loose matches on Subject: below --
2012-03-18 16:46 Tom Szczesny
2012-03-18 17:50 ` marco atzeri

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).