summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport/src/creat.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/libcsupport/src/creat.c')
-rw-r--r--cpukit/libcsupport/src/creat.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/cpukit/libcsupport/src/creat.c b/cpukit/libcsupport/src/creat.c
new file mode 100644
index 0000000000..ed7a872d4a
--- /dev/null
+++ b/cpukit/libcsupport/src/creat.c
@@ -0,0 +1,19 @@
+/*
+ * $Id$
+ */
+
+/* creat() "system call" */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+/* This is needed by f2c and therefore the SPEC benchmarks. */
+
+#include <fcntl.h>
+
+int
+creat (const char *path, mode_t mode)
+{
+ return open (path, O_WRONLY | O_CREAT | O_TRUNC, mode);
+}