This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Conflicting include tree's (glibc <-> kernel)


> 
> Hi,
> 
> Glibc based Linux distribs (RedHat 5.x) are to me a bit confusing.
> 
> For instance try to build kermit from source.  Within that the 
> include file termbits.h is used. If I now do a diff between
> /usr/include/termbits.h and /usr/include/asm/termbits.h I get:
> 
> 
> 1,18c1,2
> < /* termios type and macro definitions.  Linux version.
> <    Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
> <    This file is part of the GNU C Library.
> < 
> <    The GNU C Library is free software; you can redistribute it and/or
> <    modify it under the terms of the GNU Library General Public License as
> <    published by the Free Software Foundation; either version 2 of the
> <    License, or (at your option) any later version.
> < 
> <    The GNU C Library is distributed in the hope that it will be useful,
> <    but WITHOUT ANY WARRANTY; without even the implied warranty of
> <    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> <    Library General Public License for more details.
> < 
> <    You should have received a copy of the GNU Library General Public
> <    License along with the GNU C Library; see the file COPYING.LIB.  If not,
> <    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
> <    Boston, MA 02111-1307, USA.  */
> ---
> > #ifndef __ARCH_I386_TERMBITS_H__
> > #define __ARCH_I386_TERMBITS_H__
> 20,21c4
> < #ifndef _TERMBITS_H
> < #define _TERMBITS_H	1
> ---
> > #include <linux/posix_types.h>
> 27,38c10,18
> < #define NCCS 32
> < struct termios
> <   {
> <     tcflag_t c_iflag;		/* input mode flags */
> <     tcflag_t c_oflag;		/* output mode flags */
> <     tcflag_t c_cflag;		/* control mode flags */
> <     tcflag_t c_lflag;		/* local mode flags */
> <     cc_t c_line;			/* line discipline */
> <     cc_t c_cc[NCCS];		/* control characters */
> <     speed_t c_ispeed;		/* input speed */
> <     speed_t c_ospeed;		/* output speed */
> <   };
> ---
> > #define NCCS 19
> > struct termios {
> > 	tcflag_t c_iflag;		/* input mode flags */
> > 	tcflag_t c_oflag;		/* output mode flags */
> > 	tcflag_t c_cflag;		/* control mode flags */
> > 	tcflag_t c_lflag;		/* local mode flags */
> > 	cc_t c_line;			/* line discipline */
> > 	cc_t c_cc[NCCS];		/* control characters */
> > };
> 180,184c160
> < 
> < #define _IOT_termios /* Hurd ioctl type field.  */ \
> <   _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2)
> < 
> < #endif /* termbits.h */
> ---
> > #endif
> 
> The variable NCCS has conflicting value's so which one is right?
> The kernel version or the glibc version?
> 
> I think there is a mismatch somewhere...
> 

glibc 2 does a translation between the user termios and the kernel
termios, just like many other data structures. But glibc may miss
a few places. Please send me a bug report with a simple testcase. I
will fix it.


-- 
H.J. Lu (hjl@gnu.org)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]