[oe-commits] Martin Jansa : klibc-1.5.16: add socket.h patch for build with 2.6.33

git version control git at git.openembedded.org
Fri Feb 26 22:45:42 UTC 2010


Module: openembedded.git
Branch: org.openembedded.dev
Commit: 43b197ec24c328ac678eb1db09658b7a0c2947a9
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=43b197ec24c328ac678eb1db09658b7a0c2947a9

Author: Martin Jansa <Martin.Jansa at gmail.com>
Date:   Fri Feb 26 22:47:47 2010 +0100

klibc-1.5.16: add socket.h patch for build with 2.6.33

Signed-off-by: Martin Jansa <Martin.Jansa at gmail.com>

---

 recipes/klibc/klibc-1.5.15+1.5.16/socket.h.patch |  139 ++++++++++++++++++++++
 recipes/klibc/klibc_1.5.15+1.5.16.inc            |    1 +
 2 files changed, 140 insertions(+), 0 deletions(-)

diff --git a/recipes/klibc/klibc-1.5.15+1.5.16/socket.h.patch b/recipes/klibc/klibc-1.5.15+1.5.16/socket.h.patch
new file mode 100644
index 0000000..016fadb
--- /dev/null
+++ b/recipes/klibc/klibc-1.5.15+1.5.16/socket.h.patch
@@ -0,0 +1,139 @@
+upstream: http://www.zytor.com/pipermail/klibc/2010-February/002486.html,http://www.zytor.com/pipermail/klibc/2010-February/002487.html,http://www.zytor.com/pipermail/klibc/2010-February/002488.html
+status: pending
+comment: squashed 3 commits togheter
+
+Subject: Add relevant socket.h definitions
+From: maximilian attems <max at stro.at>
+Date: Tue Feb 23 06:02:42 PST 2010
+
+
+linux-2.6 9c501935a3cdcf6b1d35aaee3aa11c7a7051a305 cleaned
+<linux/socket.h> from allmost any userspace export.
+
+thus define the stuff that used to be there in klibc socket.h
+
+Signed-off-by: maximilian attems <max at stro.at>
+---
+
+diff --git a/usr/include/sys/socket.h b/usr/include/sys/socket.h
+index 7d47087..a6357d1 100644
+--- a/usr/include/sys/socket.h
++++ b/usr/include/sys/socket.h
+@@ -9,6 +9,9 @@
+ #include <klibc/compiler.h>
+ #include <klibc/sysconfig.h>
+ #include <linux/socket.h>
++#include <linux/sockios.h>		/* the SIOCxxx I/O controls     */
++#include <linux/uio.h>			/* iovec support                */
++#include <asm/socket.h>			/* arch-dependent defines       */
+ #if _KLIBC_HAS_ARCHSOCKET_H
+ #include <klibc/archsocket.h>
+ #endif
+@@ -27,6 +30,40 @@
+ # define SOCK_PACKET    10
+ #endif
+ 
++
++typedef unsigned short	sa_family_t;
++
++struct sockaddr {
++	sa_family_t	sa_family;	/* address family, AF_xxx	*/
++	char		sa_data[14];	/* 14 bytes of protocol address	*/
++};
++
++
++/*
++ *	As we do 4.4BSD message passing we use a 4.4BSD message passing
++ *	system, not 4.3. Thus msg_accrights(len) are now missing. They
++ *	belong in an obscure libc emulation or the bin.
++ */
++ 
++struct msghdr {
++	void	*	msg_name;	/* Socket name			*/
++	int		msg_namelen;	/* Length of name		*/
++	struct iovec *	msg_iov;	/* Data blocks			*/
++	size_t		msg_iovlen;	/* Number of blocks		*/
++	void 	*	msg_control;	/* Per protocol magic (eg BSD file descriptor passing) */
++	size_t		msg_controllen;	/* Length of cmsg list */
++	unsigned	msg_flags;
++};
++
++
++/* address families */
++#define AF_INET		2	/* Internet IP Protocol 	*/
++#define AF_INET6	10	/* IP version 6			*/
++#define AF_PACKET	17	/* Packet family		*/
++
++/* Flags we can use with send/ and recv. */
++#define MSG_PEEK	2
++
+ typedef int socklen_t;
+ 
+ __extern int socket(int, int, int);
+diff --git a/usr/kinit/nfsmount/nfsmount.h b/usr/kinit/nfsmount/nfsmount.h
+index 6d958bc..59c20cb 100644
+--- a/usr/kinit/nfsmount/nfsmount.h
++++ b/usr/kinit/nfsmount/nfsmount.h
+@@ -3,6 +3,9 @@
+ 
+ #include <linux/nfs_mount.h>
+ 
++#define MNTPROC_MNT            1
++#define MNTPROC_UMNT           3
++
+ extern int nfs_port;
+ 
+ extern int nfsmount_main(int argc, char *argv[]);
+diff --git a/usr/kinit/nfsmount/dummypmap.c b/usr/kinit/nfsmount/dummypmap.c
+index 43abe37..481e23b 100644
+--- a/usr/kinit/nfsmount/dummypmap.c
++++ b/usr/kinit/nfsmount/dummypmap.c
+@@ -39,7 +39,7 @@ struct portmap_reply {
+ 
+ static int bind_portmap(void)
+ {
+-	int sock = socket(PF_INET, SOCK_DGRAM, 0);
++	int sock = socket(AF_INET, SOCK_DGRAM, 0);
+ 	struct sockaddr_in sin;
+ 
+ 	if (sock < 0)
+diff --git a/usr/kinit/nfsmount/mount.c b/usr/kinit/nfsmount/mount.c
+index a55af91..f18cffa 100644
+--- a/usr/kinit/nfsmount/mount.c
++++ b/usr/kinit/nfsmount/mount.c
+@@ -290,9 +290,9 @@ int nfs_mount(const char *pathname, const char *hostname,
+ 	mounted = 1;
+ 
+ 	if (data->flags & NFS_MOUNT_TCP) {
+-		sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
++		sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
+ 	} else {
+-		sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
++		sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
+ 	}
+ 
+ 	if (sock == -1) {
+diff --git a/usr/kinit/nfsmount/sunrpc.c b/usr/kinit/nfsmount/sunrpc.c
+index 6607cf7..6fb81a1 100644
+--- a/usr/kinit/nfsmount/sunrpc.c
++++ b/usr/kinit/nfsmount/sunrpc.c
+@@ -152,7 +152,7 @@ struct client *tcp_client(uint32_t server, uint16_t port, uint32_t flags)
+ 
+ 	memset(clnt, 0, sizeof(clnt));
+ 
+-	if ((sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1) {
++	if ((sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1) {
+ 		perror("socket");
+ 		goto bail;
+ 	}
+@@ -197,7 +197,7 @@ struct client *udp_client(uint32_t server, uint16_t port, uint32_t flags)
+ 
+ 	memset(clnt, 0, sizeof(clnt));
+ 
+-	if ((sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1) {
++	if ((sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1) {
+ 		perror("socket");
+ 		goto bail;
+ 	}
+-- 
+1.6.6.1
diff --git a/recipes/klibc/klibc_1.5.15+1.5.16.inc b/recipes/klibc/klibc_1.5.15+1.5.16.inc
index 8d39852..7685cf8 100644
--- a/recipes/klibc/klibc_1.5.15+1.5.16.inc
+++ b/recipes/klibc/klibc_1.5.15+1.5.16.inc
@@ -17,6 +17,7 @@ SRC_URI += "file://fstype-sane-vfat-and-jffs2-for-1.5.patch;patch=1 \
             file://mntproc-definitions.patch;patch=1 \
             file://signal-cleanup.patch;patch=1 \
             file://isystem.patch;patch=1 \
+            file://socket.h.patch;patch=1 \
             "
 
 S = "${WORKDIR}/klibc-1.5.15"





More information about the Openembedded-commits mailing list