#2833 new enhancement

POSIX header files should move to Newlib

Reported by: Sebastian Huber Owned by:
Priority: normal Milestone: Indefinite
Component: tool Version:
Severity: normal Keywords:
Cc: Blocked By:

Description (last modified by Sebastian Huber)

This has the following benefits.

  1. It ensures compatibility between the standard and libbsd network stack at user API level.
  1. These files may be used by lwIP to provide the standard API.
  1. It allows 3rd party code depending only on the POSIX network headers to build without RTEMS, e.g. GCC Ada, Go and Cilk Plus languages, libressl library etc. Allows build of libraries per multilib.

List of POSIX headers not in Newlib or GCC for RTEMS:

aio.h asynchronous input and output
cpio.h cpio archive values
dlfcn.h dynamic linking
fenv.h floating-point environment
fmtmsg.h message display structures
ftw.h file tree traversal
iso646.h alternative spellings
monetary.h monetary types
mqueue.h message queues (REALTIME)
ndbm.h definitions for ndbm database operations
nl_types.h data types
poll.h definitions for the poll() function
stropts.h STREAMS interface (STREAMS)
sys/ipc.h XSI interprocess communication access structure
sys/msg.h XSI message queue structures
sys/sem.h XSI semaphore facility
sys/shm.h XSI shared memory facility
sys/statvfs.h VFS File System information structure
sys/utsname.h system name structure
trace.h tracing
ulimit.h ulimit commands
utmpx.h user accounting database definitions

See also:


Change History (30)

comment:1 Changed on 12/07/16 at 12:51:30 by Gedare Bloom

I added sys/mman.h to newlib earlier this year.

comment:2 Changed on 12/07/16 at 13:43:13 by Joel Sherrill

termios.h is missing from that list.

I THINK shm.h and msg.h are the other ones that are in RTEMS proper.

comment:3 Changed on 12/08/16 at 09:34:30 by Sebastian Huber

Description: modified (diff)

comment:4 Changed on 06/07/17 at 13:23:18 by Sebastian Huber <sebastian.huber@…>

In 6987fa5/rtems-source-builder:

4.12: Update to use Newlib

Add POSIX header file patches for Newlib.

Update #2833.

comment:5 Changed on 06/07/17 at 13:25:32 by Sebastian Huber <sebastian.huber@…>

In cf54965/rtems:

network: Include missing <inttypes.h>

Update #2833.

comment:6 Changed on 06/07/17 at 13:25:47 by Sebastian Huber <sebastian.huber@…>

In eddb134/rtems:

network: Do not use MSIZE

Do not use the MSIZE for the legacy network stack. Instead use

Update #2833.

comment:7 Changed on 06/07/17 at 13:26:02 by Sebastian Huber <sebastian.huber@…>

In d60bc7c8/rtems:

Provide kernel space headers used by Newlib

Update #2833.

comment:8 Changed on 06/07/17 at 13:26:17 by Sebastian Huber <sebastian.huber@…>

In 81ea001/rtems:

Test for POSIX headers from Newlib 20170522

Update #2833.

comment:9 Changed on 06/07/17 at 13:26:33 by Sebastian Huber <sebastian.huber@…>

In 64ecfc1/rtems:

Do not use deprecated <sys/termios.h>

Update #2833.

comment:10 Changed on 06/07/17 at 13:26:52 by Sebastian Huber <sebastian.huber@…>

In 93531e9b/rtems:

Move RTEMS-specific Termios API content

Remove obsolete support for OFILL, OFDEL, NLDLY, CRDLY, BSDLY, VTDLY,
and FFDLY which is not present on FreeBSD and not implemented in Linux.

Update #2833.

comment:11 Changed on 06/07/17 at 13:27:08 by Sebastian Huber <sebastian.huber@…>

In 787f51f/rtems:

Do not include <sys/ioctl.h> in kernel-space

Update #2833.

comment:12 Changed on 06/07/17 at 13:27:30 by Sebastian Huber <sebastian.huber@…>

In 1e0cc86/rtems:

rpc: Remove superfluous includes

Update #2833.

comment:13 Changed on 06/07/17 at 13:27:48 by Sebastian Huber <sebastian.huber@…>

In 643b820/rtems:

Include missing <sys/param.h>

Some kernel-space header expect that <sys/param.h> is present.

Update #2833.

comment:14 Changed on 06/07/17 at 13:28:05 by Sebastian Huber <sebastian.huber@…>

In d7613f7a/rtems:

network: Include <sys/uio.h> explicitly

Do not rely on indirect includes via other header files.

Update #2833.

comment:15 Changed on 06/07/17 at 13:28:23 by Sebastian Huber <sebastian.huber@…>

In d4ab0aef/rtems:

network: Move RTEMS specifics

Move RTEMS specifics to <rtems/rtems_bsdnet.h>.

Introduce rtems_tap_ifreq. The interface tap support is RTEMS-specific
and only available in the legacy network stack.

Update #2833.

comment:16 Changed on 06/07/17 at 13:28:39 by Sebastian Huber <sebastian.huber@…>

In 3bc19384/rtems:

network: Move header files

Prevent accidental use of legacy network header files.

Update #2833.

comment:17 Changed on 06/07/17 at 13:28:58 by Sebastian Huber <sebastian.huber@…>

In 9b035a0a/rtems:

network: Update <arpa/inet.h>

Update #2833.

comment:18 Changed on 06/07/17 at 13:29:15 by Sebastian Huber <sebastian.huber@…>

In e744c36/rtems:

network: Use inet_ntoa_r()

Update #2833.

comment:19 Changed on 06/07/17 at 13:29:29 by Sebastian Huber <sebastian.huber@…>

In 26ccd139/rtems:

network: Header file compatiblity

Move legacy network stack implementation specifics to
<rtems/rtems_bsdnet_internal.h>. Include missing header files. Add
interface flags compatibility.

Update #2833.

comment:20 Changed on 06/07/17 at 13:41:36 by Sebastian Huber

Description: modified (diff)

comment:21 Changed on 06/08/17 at 09:42:27 by Sebastian Huber <sebastian.huber@…>

In a66accc5/rtems:

libblock: FreeBSD kernel-space compatibility

Update #2833.

comment:22 Changed on 06/12/17 at 11:52:49 by Sebastian Huber <sebastian.huber@…>

In a197dd9/rtems-source-builder:

4.12: Add Newlib patch for <arpa/inet.h>

Update #2833.

comment:23 Changed on 06/12/17 at 12:04:21 by Sebastian Huber <sebastian.huber@…>

In 86c1004/rtems:

network: Remove FreeBSD specific hack

For whatever reason FreeBSD renames several functions provided by
<arpa/inet.h> and uses weak references to provide the standard function
names. This causes problems on targets lacking proper support for weak
references. We do not need this function renaming on RTEMS.lk:x

Update #2833.

comment:24 Changed on 06/12/17 at 13:32:28 by Sebastian Huber <sebastian.huber@…>

In 74a13c8/rtems:

bsp/beatnik: Fixes due to header file changes

Update #2833.

comment:25 Changed on 06/12/17 at 13:41:47 by Sebastian Huber <sebastian.huber@…>

In 0af8bb6/rtems:

bsp: Include missing <sys/param.h>

Update #2833.

comment:26 Changed on 06/13/17 at 09:39:21 by Sebastian Huber <sebastian.huber@…>

In 3f884b4/rtems:

bsp: Fixes due to header file changes

Update #2833.

comment:27 Changed on 08/14/17 at 00:55:55 by Chris Johns


Please review and update the milestone. Thanks.

comment:28 Changed on 08/24/17 at 06:09:04 by Sebastian Huber

Milestone: 4.12.0Indefinite
Version: 4.12

The header file list in the description is up-to-date. The remaining header files are not very important.

comment:29 in reply to:  28 Changed on 06/21/19 at 13:48:09 by Joel Sherrill

Replying to Sebastian Huber:

The header file list in the description is up-to-date. The remaining header files are not very important.

fenv.h is required by FACE General Purpose Profile so it is expected in some embedded systems. We don't support it yet.

I would prefer that all the POSIX .h files RTEMS supports end up in newlib. Since we support aio.h, dlfnc.h, and mqueue.h from the list above, those should eventually migrate.

A GSOC project is adding ndbm.h and ftw.h support.

comment:30 Changed on 06/21/19 at 13:48:56 by Joel Sherrill

iso646.h appears to be provided by gcc. Can someone doublecheck me and then delete it from the master list?

Note: See TracTickets for help on using tickets.