summaryrefslogtreecommitdiff
path: root/gprof/gmon_io.h
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2000-05-26 13:11:57 +0000
committerAlan Modra <amodra@bigpond.net.au>2000-05-26 13:11:57 +0000
commit0ec238fa07cba008eba87c85d917d849fcb4c492 (patch)
tree63de07d189bc1be9db1080c93c385aab223e0ede /gprof/gmon_io.h
parent20b373ea5e261308d08c71629f0c6ac2b652b0ea (diff)
downloadbinutils-redhat-0ec238fa07cba008eba87c85d917d849fcb4c492.tar.gz
Eli Zaretskii's DOSish file name patches.
Diffstat (limited to 'gprof/gmon_io.h')
-rw-r--r--gprof/gmon_io.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/gprof/gmon_io.h b/gprof/gmon_io.h
index bf257a49df..06bca377b4 100644
--- a/gprof/gmon_io.h
+++ b/gprof/gmon_io.h
@@ -4,6 +4,24 @@
#include "bfd.h"
#include "gmon.h"
+/* Some platforms need to put stdin into binary mode, to read
+ binary files. */
+#include "sysdep.h"
+#ifdef HAVE_SETMODE
+#ifndef O_BINARY
+#ifdef _O_BINARY
+#define O_BINARY _O_BINARY
+#define setmode _setmode
+#else
+#define O_BINARY 0
+#endif
+#endif
+#if O_BINARY
+#include <io.h>
+#define SET_BINARY(f) do { if (!isatty(f)) setmode(f,O_BINARY); } while (0)
+#endif
+#endif
+
#define INPUT_HISTOGRAM (1<<0)
#define INPUT_CALL_GRAPH (1<<1)
#define INPUT_BB_COUNTS (1<<2)