Index: file.c
--- file.c.orig	2005-06-08 22:45:28 +0200
+++ file.c	2005-06-25 13:07:36 +0200
@@ -1481,7 +1481,11 @@
 		statbuf.f_bsize, statbuf.f_blocks, statbuf.f_bfree);
 	tprintf("f_bavail=%u, f_files=%u, f_ffree=%u, f_fsid={%d, %d}, f_namelen=%u",
 		statbuf.f_bavail,statbuf.f_files, statbuf.f_ffree,
+#ifdef LINUX
 		statbuf.f_fsid.__val[0], statbuf.f_fsid.__val[1],
+#else
+		statbuf.f_fsid.val[0], statbuf.f_fsid.val[1],
+#endif
 		statbuf.f_namelen);
 #else /* !ALPHA */
 	tprintf("{f_type=%s, f_bsize=%lu, f_blocks=%lu, f_bfree=%lu, ",
@@ -1493,7 +1497,11 @@
 		(unsigned long)statbuf.f_bavail,
 		(unsigned long)statbuf.f_files,
 		(unsigned long)statbuf.f_ffree,
+#ifdef LINUX
 		statbuf.f_fsid.__val[0], statbuf.f_fsid.__val[1]);
+#else
+		statbuf.f_fsid.val[0], statbuf.f_fsid.val[1]);
+#endif
 #ifdef LINUX
 	tprintf(", f_namelen=%lu", (unsigned long)statbuf.f_namelen);
 #endif /* LINUX */
@@ -2479,6 +2487,7 @@
 }
 
 
+#ifdef LINUX
 static const struct xlat advise[] = {
   { POSIX_FADV_NORMAL,		"POSIX_FADV_NORMAL"	},
   { POSIX_FADV_RANDOM,		"POSIX_FADV_RANDOM"	},
@@ -2488,6 +2497,7 @@
   { POSIX_FADV_NOREUSE,		"POSIX_FADV_NOREUSE"	},
   { 0,				NULL			}
 };
+#endif
 
 
 #ifdef LINUX
@@ -2511,6 +2521,7 @@
 #endif
 
 
+#ifdef LINUX
 int
 sys_fadvise64_64(tcp)
 struct tcb *tcp;
@@ -2529,3 +2540,4 @@
     }
     return 0;
 }
+#endif
Index: net.c
--- net.c.orig	2005-06-01 21:22:07 +0200
+++ net.c	2005-06-25 13:45:39 +0200
@@ -43,12 +43,8 @@
 #endif
 
 #include <netinet/in.h>
-#ifdef HAVE_NETINET_TCP_H
 #include <netinet/tcp.h>
-#endif
-#ifdef HAVE_NETINET_UDP_H
 #include <netinet/udp.h>
-#endif
 #include <arpa/inet.h>
 #include <net/if.h>
 #if defined(LINUX)
@@ -1070,6 +1066,9 @@
 #ifdef SCM_RIGHTS
 	{ SCM_RIGHTS,		"SCM_RIGHTS"		},
 #endif
+#ifdef SCM_CREDS
+	{ SCM_CREDS,		"SCM_CREDS"			},
+#endif
 #ifdef SCM_CREDENTIALS
 	{ SCM_CREDENTIALS,	"SCM_CREDENTIALS"	},
 #endif
@@ -1116,6 +1115,13 @@
 			free(cmsg);
 			return;
 		}
+#ifdef SCM_CREDS
+		if (cmsg->cmsg_type == SCM_CREDS
+		    && CMSG_LEN(sizeof(struct cmsgcred)) <= cmsg_len) {
+			struct cmsgcred *uc = (struct cmsgcred *) CMSG_DATA (cmsg);
+			tprintf("{pid=%ld, uid=%ld, gid=%ld}}",
+				(long)uc->cmcred_pid, (long)uc->cmcred_uid, (long)uc->cmcred_gid);
+#else
 		if (cmsg->cmsg_type == SCM_CREDENTIALS
 		    && CMSG_LEN(sizeof(struct ucred)) <= cmsg_len) {
 			struct ucred *uc = (struct ucred *) CMSG_DATA (cmsg);
@@ -1123,6 +1129,7 @@
 			tprintf("{pid=%ld, uid=%ld, gid=%ld}}",
 				(long)uc->pid, (long)uc->uid, (long)uc->gid);
 			free(cmsg);
+#endif
 			return;
 		}
 	}
@@ -1148,17 +1155,12 @@
 	tprint_iov(tcp, (unsigned long)msg.msg_iovlen,
 		   (unsigned long)msg.msg_iov);
 
-#ifdef HAVE_STRUCT_MSGHDR_MSG_CONTROL
 	tprintf(", msg_controllen=%lu", (unsigned long)msg.msg_controllen);
 	if (msg.msg_controllen)
 		printcmsghdr(tcp, (unsigned long) msg.msg_control,
 			     msg.msg_controllen);
 	tprintf(", msg_flags=");
 	printflags(msg_flags, msg.msg_flags, "MSG_???");
-#else /* !HAVE_STRUCT_MSGHDR_MSG_CONTROL */
-	tprintf("msg_accrights=%#lx, msg_accrightslen=%u",
-		(unsigned long) msg.msg_accrights, msg.msg_accrightslen);
-#endif /* !HAVE_STRUCT_MSGHDR_MSG_CONTROL */
 	tprintf("}");
 }
 
Index: process.c
--- process.c.orig	2005-06-08 22:45:28 +0200
+++ process.c	2005-06-25 13:07:36 +0200
@@ -2965,7 +2965,9 @@
 sys_ptrace(tcp)
 struct tcb *tcp;
 {
+#ifndef FREEBSD
 	const struct xlat *x;
+#endif
 	long addr;
 
 	if (entering(tcp)) {
Index: sock.c
--- sock.c.orig	2005-06-01 21:02:37 +0200
+++ sock.c	2005-06-25 13:07:36 +0200
@@ -37,6 +37,7 @@
 #include <sys/sockio.h>
 #endif
 #include <arpa/inet.h>
+#include <netinet/in.h>
 
 #if defined (ALPHA) || defined(SH) || defined(SH64)
 #ifdef HAVE_SYS_IOCTL_H
@@ -55,20 +56,31 @@
 	{ IFF_DEBUG,		"IFF_DEBUG"		},
 	{ IFF_LOOPBACK,		"IFF_LOOPBACK"		},
 	{ IFF_POINTOPOINT,	"IFF_POINTOPOINT"	},
+#ifdef IFF_NOTRAILERS
 	{ IFF_NOTRAILERS,	"IFF_NOTRAILERS"	},
+#endif
 	{ IFF_RUNNING,		"IFF_RUNNING"		},
 	{ IFF_NOARP,		"IFF_NOARP"		},
 	{ IFF_PROMISC,		"IFF_PROMISC"		},
 	{ IFF_ALLMULTI,		"IFF_ALLMULTI"		},
+#ifdef IFF_MASTER
 	{ IFF_MASTER,		"IFF_MASTER"		},
+#endif
+#ifdef IFF_SLAVE
 	{ IFF_SLAVE,		"IFF_SLAVE"		},
+#endif
 	{ IFF_MULTICAST,	"IFF_MULTICAST"		},
+#ifdef IFF_PORTSEL
 	{ IFF_PORTSEL,		"IFF_PORTSEL"		},
+#endif
+#ifdef IFF_AUTOMEDIA
 	{ IFF_AUTOMEDIA,	"IFF_AUTOMEDIA"		},
+#endif
 	{ 0,			NULL			}
 };
 
 
+#ifdef LINUX
 static void
 print_addr(tcp, addr, ifr)
 struct tcb *tcp;
@@ -82,16 +94,21 @@
 	} else
 		printstr(tcp, addr, sizeof(ifr->ifr_addr.sa_data));
 }
+#endif
 
 int
 sock_ioctl(tcp, code, arg)
 struct tcb *tcp;
 long code, arg;
 {
+#ifdef LINUX
 	struct ifreq ifr;
+#endif
 	struct ifconf ifc;
+#ifdef LINUX
 	const char *str = NULL;
 	unsigned char *bytes;
+#endif
 
 	if (entering(tcp)) {
 		if (code == SIOCGIFCONF) {
