]> granicus.if.org Git - strace/blobdiff - stream.c
Merge Harald Böhme's solaris patches
[strace] / stream.c
index 35b3ecc6d75962a547b7cb42ca23d2591f1641df..1c2667270bfb3b2483e1e980ad5b2372def12f57 100644 (file)
--- a/stream.c
+++ b/stream.c
@@ -30,7 +30,7 @@
 
 #include "defs.h"
 
-#if defined(HAVE_SYS_STREAM_H) || defined(linux)
+#if defined(HAVE_SYS_STREAM_H) || defined(linux) || defined(FREEBSD)
 
 #if defined(linux)
 #ifdef HAVE_SYS_POLL_H
@@ -48,11 +48,15 @@ struct strbuf {
 
 #else /* linux */
 
+#ifndef FREEBSD
 #include <stropts.h>
 #include <poll.h>
 #include <sys/conf.h>
 #include <sys/stream.h>
 #include <sys/tihdr.h>
+#else /* FREEBSD */
+#include <poll.h>
+#endif /* FREEBSD */
 
 #endif /* linux */
 
@@ -62,6 +66,7 @@ struct strbuf {
 #include <sys/timod.h>
 #endif /* HAVE_SYS_TIUSER_H */
 
+#ifndef FREEBSD
 static struct xlat msgflags[] = {
        { RS_HIPRI,     "RS_HIPRI"      },
        { 0,            NULL            },
@@ -173,9 +178,15 @@ struct tcb *tcp;
 #ifdef HAVE_PUTPMSG
 
 static struct xlat pmsgflags[] = {
+#ifdef MSG_HIPRI
        { MSG_HIPRI,    "MSG_HIPRI"     },
+#endif
+#ifdef MSG_AND
        { MSG_ANY,      "MSG_ANY"       },
+#endif
+#ifdef MSG_BAND
        { MSG_BAND,     "MSG_BAND"      },
+#endif
        { 0,            NULL            },
 };
 
@@ -252,8 +263,11 @@ struct tcb *tcp;
 }
 
 #endif /* HAVE_PUTPMSG */
+#endif /* !FREEBSD */
 
 
+#ifdef HAVE_SYS_POLL_H
+
 static struct xlat pollflags[] = {
 #ifdef POLLIN
        { POLLIN,       "POLLIN"        },
@@ -284,7 +298,6 @@ struct tcb *tcp;
 {
        struct pollfd *pollp;
 
-#ifdef HAVE_SYS_POLL_H
        if (exiting(tcp)) {
                int i;
                int nfds = tcp->u_arg[1];
@@ -336,11 +349,19 @@ struct tcb *tcp;
                        tprintf("%ld", tcp->u_arg[2]);
                free(pollp);
        }
-#endif
        return 0;
 }
 
-#ifndef linux
+#else /* !HAVE_SYS_POLL_H */
+int
+sys_poll(tcp)
+struct tcb *tcp;
+{
+       return 0;
+}
+#endif
+
+#if !defined(linux) && !defined(FREEBSD)
 
 static struct xlat stream_flush_options[] = {
        { FLUSHR,       "FLUSHR"        },
@@ -815,7 +836,7 @@ int code, arg;
        }
 }
 
-#endif /* linux */
+#endif /* !linux && !FREEBSD */ 
 
-#endif /* LINUXSPARC && linux */
+#endif /* HAVE_SYS_STREAM_H || linux || FREEBSD */