Skip to contentSkip to conversation

define sock_type (patch for HOST_MIPS)

Qemu-devel Jun Peng 1 participant 1 message Jun 23, 2007

lore
Share & tools
lore

Jun Peng

author
#0 lore raw

Hello.

This patch is made for HOST_MIPS, to fix a sock_type error.

linux-user/socket.h +10 -0
diff -Nurb qemu-20070623/linux-user/socket.h qemu-loongson/linux-user/socket.h
@@ -135,4 +135,14 @@
 
 	#define TARGET_SO_PEERSEC              31
 
+	enum sock_type {
+	       TARGET_SOCK_STREAM      = 1,
+	       TARGET_SOCK_DGRAM       = 2,
+	       TARGET_SOCK_RAW = 3,
+	       TARGET_SOCK_RDM = 4,
+	       TARGET_SOCK_SEQPACKET   = 5,
+	       //TARGET_SOCK_DCCP        = 6,
+	       TARGET_SOCK_PACKET      = 10,
+	};
+
 #endif
linux-user/syscall.c +1 -1
diff -Nurb qemu-20070623/linux-user/syscall.c qemu-loongson/linux-user/syscall.c
@@ -869,7 +869,7 @@
 
 static long do_socket(int domain, int type, int protocol)
 {
-#if defined(TARGET_MIPS)
+#if defined(TARGET_MIPS) || defined(HOST_MIPS)
     switch(type) {
     case TARGET_SOCK_DGRAM:
         type = SOCK_DGRAM;