Can't
believe that FreeBSD has no baudrate > 38400 !
> serial.c:443:44: error: use of undeclared identifier 'B3000000'
> serial.c:444:16: error: use of undeclared identifier 'B2500000'
> serial.c:445:16: error: use of undeclared identifier 'B2000000'
At
least some systems don't use Bxxxx constants except for
compatability - they simply stick the baudrate in c_ospeed and/or
c_ispeed. (I don't use FreeBSD myself; I don't know whether it's one
of them or not.)
But there were a bunch of other undefined symbols too, many of which
(eg, CRDLY, NLDLY) I don't recognize and which are not present in at
least one other termio implementatino (NetBSD's). So at least part of
the problem is that the code isn't all that portable.
I notice you used gmake, from which I infer the Makefile is
GNU-make-specific, which makes it at least somewhat likely the code was
written for Linux, which makes the nonportabilities less surprising.
(Code being written for Linux correlates positively, in my experience,
with it assuming every system matches the developer's. Not that this
is necessarily bad - I've done it myself often enough, though not often
with Linux - but it does, to some extent, explain what you're seeing.)
You're right, it's Linux.
And for other systems we must start to #ifdef lots of Unix-flavour
specific termios code into serial.c.
Joerg