Hi Sebastian,

Here's an updated patch.

On Tue, 2015-12-15 at 09:13 +0100, Sebastian Huber wrote:
> Hello Nick,
> 
> I checked in the shell changes separately. With them I can build the 
> latest Newlib with --disable-networking. It should be sufficient to 
> remove the <sys/select.h> from libnetworking.

Now that Newlib's reverted the inclusion of sys/select.h in
sys/types.h, it's largely the same as the previous version, minus the
bits you've committed separately.

Would you be able to test with libbsd?

> On 14/12/15 10:09, Sebastian Huber wrote:
> > Hello Nick,
> > 
> > this patch needs an update once this is committed to Newlib:
> > 
> > https://sourceware.org/ml/newlib/2015/msg00905.html
> > 
> > On 10/12/15 10:04, Nick Withers wrote:
> > > Hi all,
> > > 
> > > Attached is a patch for master similar to that I posted to the
> > > Newlib
> > > mailing list in 
> > > https://sourceware.org/ml/newlib/2015/msg00888.html *.
> > > 
> > > It chases Newlib changes to sys/types.h / sys/select.h and allows
> > > us to
> > > use Newlib's sys/select.h directly rather than rolling our own.
> > > 
> > > A few notes:
> > >   - I removed the BSD advertising clause from what's now
> > > sys/selinfo.h,
> > > but am not sure that I should have
> > >   - I made a few not-really-related but minor changes to
> > > cpukit/libmisc/shell/*.c printf()s to ensure format specifiers
> > > matched
> > > parameter types
> > >   - the sys/selinfo.h file doesn't directly correspond to any
> > > FreeBSD
> > > revision, though it's basically the same as 
> > > https://svnweb.freebsd.org/
> > > base/head/sys/sys/selinfo.h?revision=70650&view=markup , not sure
> > > how
> > > fussed we are with e.g., $FreeBSD$ tags and such...?
> > > 
> > > * It doesn't mess with disabling dl tests on PSim; I ran into
> > > troubles
> > > with dl02 which I'll look into separately
From fc1acc7620c94144e3a59b05725c47d980686b34 Mon Sep 17 00:00:00 2001
From: Nick Withers <nick.with...@anu.edu.au>
Date: Mon, 21 Dec 2015 10:38:51 +1100
Subject: [PATCH] Chase Newlib sys/types.h / sys/select.h changes

---
 cpukit/libnetworking/Makefile.am          |  2 +-
 cpukit/libnetworking/libc/res_send.c      |  3 ++
 cpukit/libnetworking/preinstall.am        |  6 +--
 cpukit/libnetworking/rtems/rtems_select.c |  1 +
 cpukit/libnetworking/sys/select.h         | 69 -------------------------------
 cpukit/libnetworking/sys/selinfo.h        | 56 +++++++++++++++++++++++++
 cpukit/libnetworking/sys/socketvar.h      |  2 +-
 cpukit/librpc/include/rpc/svc.h           |  1 +
 cpukit/librpc/src/rpc/clnt_tcp.c          |  1 +
 cpukit/librpc/src/rpc/clnt_udp.c          |  1 +
 cpukit/librpc/src/rpc/pmap_rmt.c          |  1 +
 cpukit/librpc/src/rpc/rpc_dtablesize.c    |  2 +-
 cpukit/librpc/src/rpc/svc.c               |  1 +
 13 files changed, 71 insertions(+), 75 deletions(-)
 delete mode 100644 cpukit/libnetworking/sys/select.h
 create mode 100644 cpukit/libnetworking/sys/selinfo.h

diff --git a/cpukit/libnetworking/Makefile.am b/cpukit/libnetworking/Makefile.am
index 927245b..2a8e06a 100644
--- a/cpukit/libnetworking/Makefile.am
+++ b/cpukit/libnetworking/Makefile.am
@@ -177,7 +177,7 @@ include_sys_HEADERS += sys/proc.h
 include_sys_HEADERS += sys/protosw.h
 include_sys_HEADERS += sys/reboot.h
 include_sys_HEADERS += sys/resourcevar.h
-include_sys_HEADERS += sys/select.h
+include_sys_HEADERS += sys/selinfo.h
 include_sys_HEADERS += sys/signalvar.h
 include_sys_HEADERS += sys/socket.h
 include_sys_HEADERS += sys/socketvar.h
diff --git a/cpukit/libnetworking/libc/res_send.c b/cpukit/libnetworking/libc/res_send.c
index b1dc337..316d3ad 100644
--- a/cpukit/libnetworking/libc/res_send.c
+++ b/cpukit/libnetworking/libc/res_send.c
@@ -79,6 +79,9 @@
 #include <sys/types.h>
 #include <sys/param.h>
 #include <sys/time.h>
+#ifndef NOSELECT
+#include <sys/select.h>
+#endif
 #include <sys/socket.h>
 #include <sys/uio.h>
 
diff --git a/cpukit/libnetworking/preinstall.am b/cpukit/libnetworking/preinstall.am
index bff9065..477b19a 100644
--- a/cpukit/libnetworking/preinstall.am
+++ b/cpukit/libnetworking/preinstall.am
@@ -367,9 +367,9 @@ $(PROJECT_INCLUDE)/sys/resourcevar.h: sys/resourcevar.h $(PROJECT_INCLUDE)/sys/$
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/sys/resourcevar.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/sys/resourcevar.h
 
-$(PROJECT_INCLUDE)/sys/select.h: sys/select.h $(PROJECT_INCLUDE)/sys/$(dirstamp)
-	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/sys/select.h
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/sys/select.h
+$(PROJECT_INCLUDE)/sys/selinfo.h: sys/selinfo.h $(PROJECT_INCLUDE)/sys/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/sys/selinfo.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/sys/selinfo.h
 
 $(PROJECT_INCLUDE)/sys/signalvar.h: sys/signalvar.h $(PROJECT_INCLUDE)/sys/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/sys/signalvar.h
diff --git a/cpukit/libnetworking/rtems/rtems_select.c b/cpukit/libnetworking/rtems/rtems_select.c
index 05c8951..eddb122 100644
--- a/cpukit/libnetworking/rtems/rtems_select.c
+++ b/cpukit/libnetworking/rtems/rtems_select.c
@@ -17,6 +17,7 @@
 #include <sys/types.h>
 #include <sys/param.h>
 #include <sys/mbuf.h>
+#include <sys/select.h>
 #include <sys/socket.h>
 #include <sys/socketvar.h>
 #include <sys/protosw.h>
diff --git a/cpukit/libnetworking/sys/select.h b/cpukit/libnetworking/sys/select.h
deleted file mode 100644
index 8a84e4c..0000000
--- a/cpukit/libnetworking/sys/select.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*-
- * Copyright (c) 1992, 1993
- *	The Regents of the University of California.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *	@(#)select.h	8.2 (Berkeley) 1/4/94
- */
-
-#ifndef _SYS_SELECT_H_
-#define	_SYS_SELECT_H_
-
-#include <sys/time.h> /* struct timeval */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Used to maintain information about processes that wish to be
- * notified when I/O becomes possible.
- */
-struct selinfo {
-	pid_t	si_pid;		/* process to be notified */
-	short	si_flags;	/* see below */
-};
-#define	SI_COLL	0x0001		/* collision occurred */
-
-/* Check the first NFDS descriptors each in READFDS (if not NULL) for read
-   readiness, in WRITEFDS (if not NULL) for write readiness, and in EXCEPTFDS
-   (if not NULL) for exceptional conditions.  If TIMEOUT is not NULL, time out
-   after waiting the interval specified therein.  Returns the number of ready
-   descriptors, or -1 for errors.  */
-extern int select (int __nfds, fd_set *__restrict __readfds,
-                   fd_set *__restrict __writefds,
-                   fd_set *__restrict __exceptfds,
-                   struct timeval *__restrict __timeout);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !_SYS_SELECT_H_ */
diff --git a/cpukit/libnetworking/sys/selinfo.h b/cpukit/libnetworking/sys/selinfo.h
new file mode 100644
index 0000000..785c33f
--- /dev/null
+++ b/cpukit/libnetworking/sys/selinfo.h
@@ -0,0 +1,56 @@
+/*-
+ * Copyright (c) 1992, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *	@(#)select.h	8.2 (Berkeley) 1/4/94
+ */
+
+#ifndef _SYS_SELINFO_H_
+#define	_SYS_SELINFO_H_
+
+#include <sys/types.h> /* pid_t */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Used to maintain information about processes that wish to be
+ * notified when I/O becomes possible.
+ */
+struct selinfo {
+	pid_t	si_pid;		/* process to be notified */
+	short	si_flags;	/* see below */
+};
+#define	SI_COLL	0x0001		/* collision occurred */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !_SYS_SELINFO_H_ */
+
diff --git a/cpukit/libnetworking/sys/socketvar.h b/cpukit/libnetworking/sys/socketvar.h
index 09bb2a5..13b3674 100644
--- a/cpukit/libnetworking/sys/socketvar.h
+++ b/cpukit/libnetworking/sys/socketvar.h
@@ -34,7 +34,7 @@
 #define _SYS_SOCKETVAR_H_
 
 #include <sys/queue.h>			/* for TAILQ macros */
-#include <sys/select.h>			/* for struct selinfo */
+#include <sys/selinfo.h>		/* for struct selinfo */
 
 
 /*
diff --git a/cpukit/librpc/include/rpc/svc.h b/cpukit/librpc/include/rpc/svc.h
index 0ef3b8c..0808ddd 100644
--- a/cpukit/librpc/include/rpc/svc.h
+++ b/cpukit/librpc/include/rpc/svc.h
@@ -43,6 +43,7 @@
 #include <sys/cdefs.h>
 #include <rpc/types.h>
 #include <rpc/xdr.h> /* xdrproc_t */
+#include <sys/select.h> /* fd_set */
 #include <sys/socket.h> /* socklen_t */
 #include <netinet/in.h> /* struct sockaddr_in */
 #include <rpc/auth.h> /* auth_stat */
diff --git a/cpukit/librpc/src/rpc/clnt_tcp.c b/cpukit/librpc/src/rpc/clnt_tcp.c
index f53edae..c85531d 100644
--- a/cpukit/librpc/src/rpc/clnt_tcp.c
+++ b/cpukit/librpc/src/rpc/clnt_tcp.c
@@ -61,6 +61,7 @@ static char *rcsid = "$FreeBSD: src/lib/libc/rpc/clnt_tcp.c,v 1.14 2000/01/27 23
 #include <unistd.h>
 #include <string.h>
 #include <rpc/rpc.h>
+#include <sys/param.h>
 #include <sys/socket.h>
 #include <netdb.h>
 #include <errno.h>
diff --git a/cpukit/librpc/src/rpc/clnt_udp.c b/cpukit/librpc/src/rpc/clnt_udp.c
index 68e085e..e48508b 100644
--- a/cpukit/librpc/src/rpc/clnt_udp.c
+++ b/cpukit/librpc/src/rpc/clnt_udp.c
@@ -48,6 +48,7 @@ static char *rcsid = "$FreeBSD: src/lib/libc/rpc/clnt_udp.c,v 1.15 2000/01/27 23
 #include <unistd.h>
 #include <string.h>
 #include <rpc/rpc.h>
+#include <sys/param.h>
 #include <sys/socket.h>
 #include <sys/ioctl.h>
 #include <netdb.h>
diff --git a/cpukit/librpc/src/rpc/pmap_rmt.c b/cpukit/librpc/src/rpc/pmap_rmt.c
index 1ab72b2..c7d36b0 100644
--- a/cpukit/librpc/src/rpc/pmap_rmt.c
+++ b/cpukit/librpc/src/rpc/pmap_rmt.c
@@ -46,6 +46,7 @@ static char *rcsid = "$FreeBSD: src/lib/libc/rpc/pmap_rmt.c,v 1.15 2000/01/27 23
 #endif
 
 #include <sys/ioctl.h>
+#include <sys/param.h>
 #include <sys/socket.h>
 
 #include <net/if.h>
diff --git a/cpukit/librpc/src/rpc/rpc_dtablesize.c b/cpukit/librpc/src/rpc/rpc_dtablesize.c
index 65f2953..a102acc 100644
--- a/cpukit/librpc/src/rpc/rpc_dtablesize.c
+++ b/cpukit/librpc/src/rpc/rpc_dtablesize.c
@@ -37,7 +37,7 @@ static char *rcsid = "$FreeBSD: src/lib/libc/rpc/rpc_dtablesize.c,v 1.10 1999/08
 #include "config.h"
 #endif
 
-#include <sys/types.h>
+#include <sys/select.h>
 #include <unistd.h>
 
 /*
diff --git a/cpukit/librpc/src/rpc/svc.c b/cpukit/librpc/src/rpc/svc.c
index 9cc5cf3..64cc964 100644
--- a/cpukit/librpc/src/rpc/svc.c
+++ b/cpukit/librpc/src/rpc/svc.c
@@ -53,6 +53,7 @@ static char *rcsid = "$FreeBSD: src/lib/libc/rpc/svc.c,v 1.14 1999/08/28 00:00:4
 #endif
 #include <stdlib.h>
 #include <sys/errno.h>
+#include <sys/param.h>
 #include <rpc/rpc.h>
 #include <rpc/pmap_clnt.h>
 
-- 
1.9.1
_______________________________________________
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Reply via email to