[Devel] [PATCH 2/4] restart: (build fix hack) define sa_family_t and struct linger

Nathan Lynch ntl at pobox.com
Wed Sep 16 02:27:49 PDT 2009


restart.c doesn't build against exported kernel headers:

$ make CPPFLAGS=-I$PWD/../linux-2.6.git/usr/include
cc -g -Wall -Wstrict-prototypes -Wno-trigraphs -I../linux/include -I../linux/arch//include -DCHECKPOINT_DEBUG -D__REENTRANT -pthread -I/home/nathanl/devel/user-cr.git/../linux-2.6.git/usr/include restart.c clone_ppc32.o -o restart
In file included from /home/nathanl/devel/user-cr.git/../linux-2.6.git/usr/include/linux/checkpoint_hdr.h:16,
                 from restart.c:42:
/home/nathanl/devel/user-cr.git/../linux-2.6.git/usr/include/linux/un.h:7: error: expected specifier-qualifier-list before ‘sa_family_t’
In file included from restart.c:42:
/home/nathanl/devel/user-cr.git/../linux-2.6.git/usr/include/linux/checkpoint_hdr.h:407: error: field ‘linger’ has incomplete type
make: *** [restart] Error 1

I am not sure what the right fix is.  This is not it.
---
 restart.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/restart.c b/restart.c
index 2d8d796..b93a2e1 100644
--- a/restart.c
+++ b/restart.c
@@ -10,6 +10,13 @@
 
 #define _GNU_SOURCE
 
+/* Hacks ahoy */
+typedef unsigned short	sa_family_t;
+struct linger {
+	int		l_onoff;	/* Linger active		*/
+	int		l_linger;	/* How long to linger for	*/
+};
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-- 
1.6.0.6

_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list