Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 May 2017 07:55:56 +0200
From:      Sebastian Huber <sebastian.huber@embedded-brains.de>
To:        FreeBSD <freebsd-hackers@freebsd.org>
Subject:   Re: Why is _POSIX_SOURCE used instead of __BSD_VISIBLE in <termios.h>?
Message-ID:  <2517757f-0c8c-c500-a6ce-aec2f08e2aeb@embedded-brains.de>
In-Reply-To: <742294fc-99db-3f9c-17a6-9aee7f42b066@embedded-brains.de>
References:  <742294fc-99db-3f9c-17a6-9aee7f42b066@embedded-brains.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On 23/05/17 09:33, Sebastian Huber wrote:

> Hello,
>
> the Termios header <termios.h>, <sys/_termios.h>, etc. use sometimes=20
> _POSIX_SOURCE directly to determine if a thing should be exposed to=20
> the user, e.g.
>
> #ifndef _POSIX_SOURCE
> #define    ONLCR        0x00000002    /* map NL to CR-NL (ala CRMOD) */
> #define    TABDLY        0x00000004    /* tab delay mask */
> #define        TAB0        0x00000000        /* no tab delay and=20
> expansion */
> #define        TAB3        0x00000004        /* expand tabs to spaces *=
/
> #define    ONOEOT        0x00000008    /* discard EOT's (^D) on=20
> output) */
> #define    OCRNL        0x00000010    /* map CR to NL on output */
> #define    ONOCR        0x00000020    /* no CR output at column 0 */
> #define    ONLRET        0x00000040    /* NL performs CR function */
> #endif  /*_POSIX_SOURCE */
>
> This circumvents the feature mechanisms of <sys/cdefs.h>. Why is=20
> __BSD_VISIBLE not used for this?
>

This was already changed in one spot:

https://github.com/freebsd/freebsd/commit/e63fa4cfabc535a5f9ec7ea2b383692=
931c13465

There are not many places left using _POSIX_SOURCE directly. To me this=20
looks like someone forgot to update the Termios headers to use the=20
visibility defines.

--=20
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber@embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine gesch=C3=A4ftliche Mitteilung im Sinne des EHUG=
.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2517757f-0c8c-c500-a6ce-aec2f08e2aeb>