Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Aug 2008 16:47:08 +0200
From:      Ed Schouten <ed@80386.nl>
To:        Alexey Shuvaev <shuvaev@physik.uni-wuerzburg.de>
Cc:        FreeBSD Current <freebsd-current@freebsd.org>
Subject:   Re: POSIX compliant termios.h?
Message-ID:  <20080812144708.GY99951@hoeg.nl>
In-Reply-To: <20080812135142.GA1033@wep4017.physik.uni-wuerzburg.de>
References:  <20080812135142.GA1033@wep4017.physik.uni-wuerzburg.de>

next in thread | previous in thread | raw e-mail | index | archive | help

--8fFQOkr0mRRE6sJ/
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hello Alexey,

* Alexey Shuvaev <shuvaev@physik.uni-wuerzburg.de> wrote:
> I have just tried to unBROKEN cad/brlcad and noticed that FreeBSD
> termios.h is missing some POSIX mandatory flags. In this case,
> TAB3 output processing flag (expand TABs on output =3D=3D OXTABS).
> Are there any plans to fix it in the base?
>=20
> Attached is the workaround patch for cad/brlcad. Should I push it
> into the ports (via PR, etc...) or it is better to wait a little
> for a fix in the base?

Until very recently, it wasn't really possible to properly add TAB3 to
<termios.h>, because TAB3 was also used inside the <sgtty.h> interface.
Now that <sgtty.h> is no longer accessible by userspace applications, we
could commit the following patch to -CURRENT, but we cannot safely
backport it to RELENG_*:

| --- sys/sys/termios.h
| +++ sys/sys/termios.h
| @@ -109,6 +109,9 @@
|  #ifndef _POSIX_SOURCE
|  #define ONLCR		0x00000002	/* map NL to CR-NL (ala CRMOD) */
|  #define OXTABS		0x00000004	/* expand tabs to spaces */
| +#ifndef _KERNEL
| +#define	TAB3		OXTABS
| +#endif /* !_KERNEL */
|  #define ONOEOT		0x00000008	/* discard EOT's (^D) on output) */
|  #define OCRNL		0x00000010	/* map CR to NL on output */
|  #define ONOCR		0x00000020	/* no CR output at column 0 */

In the mean time, you'd better use the following cpp tricks:

| #ifndef TAB3
| #ifdef OXTABS
| #define TAB3 OXTABS
| #else
| #define TAB3 0
| #endif
| #endif

--=20
 Ed Schouten <ed@80386.nl>
 WWW: http://80386.nl/

--8fFQOkr0mRRE6sJ/
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEYEARECAAYFAkihomwACgkQ52SDGA2eCwXUdgCfUeyXgfxTT6mODdsdvhN2qk5X
0TAAn0wqz2sKvlhFRHtQX9CD8RFzRfen
=QST8
-----END PGP SIGNATURE-----

--8fFQOkr0mRRE6sJ/--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080812144708.GY99951>