> tc{set,get}attr are actually used to control ttys, they have nothing
> to do with termcap.
Try
#define tcsetattr(fd, cmd, arg) ioctl((fd), (cmd), (arg))
#define tcgetattr(fd, arg) ioctl((fd), TCGETA, (arg))
and (if needed)
#define TCSADRAIN TCSETAW
#define TCSANOW TCSETA