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>

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

On 23/05/17 09:33, Sebastian Huber wrote:

> Hello,
>
> the Termios header <termios.h>, <sys/_termios.h>, etc. use sometimes 
> _POSIX_SOURCE directly to determine if a thing should be exposed to 
> 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 
> expansion */
> #define        TAB3        0x00000004        /* expand tabs to spaces */
> #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 */
> #define    ONLRET        0x00000040    /* NL performs CR function */
> #endif  /*_POSIX_SOURCE */
>
> This circumvents the feature mechanisms of <sys/cdefs.h>. Why is 
> __BSD_VISIBLE not used for this?
>

This was already changed in one spot:

https://github.com/freebsd/freebsd/commit/e63fa4cfabc535a5f9ec7ea2b383692931c13465

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

-- 
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äftliche Mitteilung im Sinne des EHUG.



help

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