Mail Archives: djgpp/2001/11/08/08:14:49
--- Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> wrote:
> Some error
> messages, together with the code fragments which
> cause them, would be
> nice. Attaching a large program is not going to
> help: most people
> here are busy and don't have time to read large
> sources.
>
> In general, DJGPP doesn't have sgtty.h, and the
> commented-out parts of
> sys/ioctl.h refer to functionality that is not
> implemented in DJGPP.
>
> To port programs which use such facilities, you
> would need some
> serious changes in the sources. Preferably, look
> for a version of the
> program which uses termios.h, not sgtty.h, since
> DJGPP includes a
> fairly functional emulation of termios.
This is a piece of mipdown.c:
struct sgttyb lkterm;
termst()
{
if(ioctl(f3,TIOCEXCL)==0 &&
ioctl(f4,TIOCEXCL)==0){
lkterm.sg_ispeed = bdrate;
lkterm.sg_ospeed = bdrate;
lkterm.sg_erase = ERASECH;
lkterm.sg_kill = KILLCH;
lkterm.sg_flags = FLAG;
if(ioctl(f3,TIOCSETP,&lkterm)!=0 ||
ioctl(f4,TIOCSETP,&lkterm)!=0){
error("terminalsettings can not be
changed",-1,"\n");
finish(-1);
}
}
else{
error("device is busy",-1,"\n");
finish(-1);
}
}
finish(a)
int a;
{
ioctl(f3,TIOCNXCL);
ioctl(f4,TIOCNXCL);
exit(a);
}
And these are the errors I get:
mipdown.c: In function `termst':
mipdown.c:974: `TIOCEXCL' undeclared (first use in
this function)
mipdown.c:974: (Each undeclared identifier is reported
only once
mipdown.c:974: for each function it appears in.)
mipdown.c:976: invalid use of undefined type `struct
sgttyb'
mipdown.c:977: invalid use of undefined type `struct
sgttyb'
mipdown.c:978: invalid use of undefined type `struct
sgttyb'
mipdown.c:979: invalid use of undefined type `struct
sgttyb'
mipdown.c:980: invalid use of undefined type `struct
sgttyb'
mipdown.c:981: `TIOCSETP' undeclared (first use in
this function)
mipdown.c: In function `finish':
mipdown.c:1019: `TIOCNXCL' undeclared (first use in
this function)
mipdown.c: At top level:
mipdown.c:70: storage size of `lkterm' isn't known
When I change the struct sgtty into termios I get the
following errors:
mipdown.c: In function `termst':
mipdown.c:974: `TIOCEXCL' undeclared (first use in
this function)
mipdown.c:974: (Each undeclared identifier is reported
only once
mipdown.c:974: for each function it appears in.)
mipdown.c:976: structure has no member named
`sg_ispeed'
mipdown.c:977: structure has no member named
`sg_ospeed'
mipdown.c:978: structure has no member named
`sg_erase'
mipdown.c:979: structure has no member named `sg_kill'
mipdown.c:980: structure has no member named
`sg_flags'
mipdown.c:981: `TIOCSETP' undeclared (first use in
this function)
mipdown.c: In function `finish':
mipdown.c:1019: `TIOCNXCL' undeclared (first use in
this function)
Can anybody tell me what to change in order to get
this working?
__________________________________________________
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com
- Raw text -