* CRTSCTS wrong in man tcsetattr
@ 2006-04-12 13:08 Karel Kulhavy
0 siblings, 0 replies; 3+ messages in thread
From: Karel Kulhavy @ 2006-04-12 13:08 UTC (permalink / raw)
To: linux-kernel
Man tcsetattr in gentoo implicitly states that after
#include <termios.h>
#include <unistd.h>
CRTSCTS constant will be defined. This is however false:
tty.c:38: error: `CRTSCTS' undeclared (first use in this function)
CRTSCTS is defined in bits/termios.h and in asm/termbits.h The question
is what is the correct state of affairs?
1) the manpage should say bits/termios.h instead of termios.h
2) the manpage should say asm/termbits.h instead of termios.h
3) the termios.h should include bits/termios.h or asm/termbits.h
4) the manpage should not mention CRTSCTS at all
CL<
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: CRTSCTS wrong in man tcsetattr
2006-04-12 14:13 ` Nick Craig-Wood
@ 2006-04-12 14:42 ` linux-os (Dick Johnson)
0 siblings, 0 replies; 3+ messages in thread
From: linux-os (Dick Johnson) @ 2006-04-12 14:42 UTC (permalink / raw)
To: Nick Craig-Wood; +Cc: Karel Kulhavy, linux-kernel
On Wed, 12 Apr 2006, Nick Craig-Wood wrote:
> In linux.kernel, you wrote:
>> Man tcsetattr in gentoo implicitly states that after
>> #include <termios.h>
>> #include <unistd.h>
>>
>> CRTSCTS constant will be defined. This is however false:
>> tty.c:38: error: `CRTSCTS' undeclared (first use in this function)
>>
>> CRTSCTS is defined in bits/termios.h and in asm/termbits.h The question
>> is what is the correct state of affairs?
>> 1) the manpage should say bits/termios.h instead of termios.h
>> 2) the manpage should say asm/termbits.h instead of termios.h
>> 3) the termios.h should include bits/termios.h or asm/termbits.h
>> 4) the manpage should not mention CRTSCTS at all
> 5) there is a bug in your installation
>
> Works for me in Debian testing
>
> cat <<'EOF' > z.c
> #include <termios.h>
> #include <unistd.h>
> #include <stdio.h>
>
> int main(void)
> {
> printf("0x%08X", CRTSCTS);
> return 0;
> }
> EOF
> gcc -Wall z.c -o z
> ./z
>
> Gives
>
> 0x80000000
>
> --
> Nick Craig-Wood <nick@craig-wood.com> -- http://www.craig-wood.com/nick
> -
No headers in the /usr/include/bits directory should never be
referenced in user code. /usr/include/termios.h picks up whatever
it needs but it is referenced to the user's environment so the
user could certainly screw it up!
Snipped header:
#ifndef _TERMIOS_H
#define _TERMIOS_H 1
#include <features.h>
#ifdef __USE_UNIX98
/* We need `pid_t'. */
# include <bits/types.h>
# ifndef __pid_t_defined
typedef __pid_t pid_t;
# define __pid_t_defined
# endif
#endif
__BEGIN_DECLS
#include <bits/termios.h> <----------- Included here
__END_DECLS
#endif /* termios.h */
If the user had redefined the C_INCLUDE_PATH to junk, this might
quietly fail, depending upon the gcc version.
Cheers,
Dick Johnson
Penguin : Linux version 2.6.15.4 on an i686 machine (5589.42 BogoMips).
Warning : 98.36% of all statistics are fiction, book release in April.
_
\x1a\x04
****************************************************************
The information transmitted in this message is confidential and may be privileged. Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to DeliveryErrors@analogic.com - and destroy all copies of this information, including any attachments, without reading or disclosing them.
Thank you.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: CRTSCTS wrong in man tcsetattr
[not found] <60Nqo-4kw-5@gated-at.bofh.it>
@ 2006-04-12 14:13 ` Nick Craig-Wood
2006-04-12 14:42 ` linux-os (Dick Johnson)
0 siblings, 1 reply; 3+ messages in thread
From: Nick Craig-Wood @ 2006-04-12 14:13 UTC (permalink / raw)
To: Karel Kulhavy, linux-kernel
In linux.kernel, you wrote:
> Man tcsetattr in gentoo implicitly states that after
> #include <termios.h>
> #include <unistd.h>
>
> CRTSCTS constant will be defined. This is however false:
> tty.c:38: error: `CRTSCTS' undeclared (first use in this function)
>
> CRTSCTS is defined in bits/termios.h and in asm/termbits.h The question
> is what is the correct state of affairs?
> 1) the manpage should say bits/termios.h instead of termios.h
> 2) the manpage should say asm/termbits.h instead of termios.h
> 3) the termios.h should include bits/termios.h or asm/termbits.h
> 4) the manpage should not mention CRTSCTS at all
5) there is a bug in your installation
Works for me in Debian testing
cat <<'EOF' > z.c
#include <termios.h>
#include <unistd.h>
#include <stdio.h>
int main(void)
{
printf("0x%08X", CRTSCTS);
return 0;
}
EOF
gcc -Wall z.c -o z
./z
Gives
0x80000000
--
Nick Craig-Wood <nick@craig-wood.com> -- http://www.craig-wood.com/nick
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-04-12 14:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-12 13:08 CRTSCTS wrong in man tcsetattr Karel Kulhavy
[not found] <60Nqo-4kw-5@gated-at.bofh.it>
2006-04-12 14:13 ` Nick Craig-Wood
2006-04-12 14:42 ` linux-os (Dick Johnson)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®