Provide POSIX network header for all normal Newlib targets?

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Apr 21 10:12:12 UTC 2016


Hello,

with the recent type changes for <sys/types.h> etc. we are now able to 
build the FreeBSD 9.3 network stack on RTEMS. We directly use

  * <machine/endian.h>,
  * <sys/_stdint.h>,
  * <sys/time.h>,
  * <sys/_timespec.h>,
  * <sys/_timeval.h>,
  * <sys/_types.h>, and
  * <sys/types.h>

from Newlib with mostly unmodified FreeBSD header and source files.

Cygwin and Linux provide currently their own set of network header files 
in Newlib. RTEMS has its own sets outside of Newlib. Since the Linux 
port is a bit special I don't consider it here. I think for the other 
Newlib targets it may be beneficial to provide at least the POSIX 
network header files

  * <arpa/inet.h>,
  * <netdb.h>,
  * <net/if.h>,
  * <netinet/in.h>,
  * <netinet/tcp.h>,
  * <syslog.h>,
  * <sys/socket.h>,
  * <sys/uio.h>, and
  * <sys/un.h>

in Newlib. It has the advantage that Newlib users get a consistent set 
of POSIX network header files with compatibility to FreeBSD. Since there 
are a lot of software packages available for Cygwin it would be quite 
nice for the smaller embedded systems targets to share header files with 
Cygwin.

My approach would be to import the latest network header files from 
FreeBSD.  Then remove all #ifdef _KERNEL parts and use an #include 
<machine/XZY.h> to provide machine-specific stuff for each header file, 
e.g. <machine/socket.h>, <machine/in.h>. Keep the #ifndef _KERNEL parts 
for FreeBSD compatibility.

I only roughly looked at the Cygwin network headers, but it would be a 
bit of work to import the latest network headers from FreeBSD and use 
them in Cygwin, e.g. deal with __INSIDE_CYGWIN_NET__.

How do you think about this?

-- 
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 at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the devel mailing list