Skip to contentSkip to conversation

termios

parisc-linux Matthew Wilcox 1 participant 1 message Dec 31, 1999

lore
Share & tools
lore
#0 lore raw

I think the best thing to do with struct termios is to define it in a way which is compatible with HPUX apps:

# define NCCS 16

typedef unsigned int tcflag_t;
typedef unsigned char cc_t;
typedef unsigned int speed_t;

# ifdef _TERMIOS_INCLUDED
struct termios {
tcflag_t c_iflag; /* Input modes */
tcflag_t c_oflag; /* Output modes */
tcflag_t c_cflag; /* Control modes */
tcflag_t c_lflag; /* Local modes */
tcflag_t c_reserved; /* Reserved for future use */
cc_t c_cc[NCCS]; /* Control characters */
};

As you can see, there are 4 bytes reserved before c_cc starts. Linux defines more than 16 NCCS, and also has a 1-byte field for the line discipline. So I propose:

struct termios {

        tcflag_t        c_iflag;        /* Input modes */
        tcflag_t        c_oflag;        /* Output modes */
        tcflag_t        c_cflag;        /* Control modes */
        tcflag_t        c_lflag;        /* Local modes */
	cc_t		c_line;		/* Line Discipline */
	cc_t		c_cc[19];	/* Control characters */
};

and then adjust the symbolic constants for VINTR et al to ensure they still refer to the same offset within the structure. Any comments? I hope HP won't mind me using the reserved field in this way.