From 5398df49be900051b88e6539595d7354181f336e Mon Sep 17 00:00:00 2001
From: whh8b <whh8b@git.zephyr-software.com>
Date: Mon, 11 Apr 2016 03:32:47 +0000
Subject: [PATCH] Actually include the necessary files for mkfifo support.

---
 .gitattributes        |  2 ++
 libc/include/mkfifo.h | 27 +++++++++++++++++++++++++++
 libc/src/mkfifo.c     | 41 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 70 insertions(+)
 create mode 100644 libc/include/mkfifo.h
 create mode 100644 libc/src/mkfifo.c

diff --git a/.gitattributes b/.gitattributes
index 8ccfb40..05c4d4e 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -42,6 +42,7 @@ libc/include/close.h -text
 libc/include/itoa.h -text
 libc/include/itox.h -text
 libc/include/malloc.h -text
+libc/include/mkfifo.h -text
 libc/include/null.h -text
 libc/include/open.h -text
 libc/include/read.h -text
@@ -55,6 +56,7 @@ libc/src/cgc.s -text
 libc/src/close.c -text
 libc/src/itoa.c -text
 libc/src/malloc.c -text
+libc/src/mkfifo.c -text
 libc/src/open.c -text
 libc/src/read.c -text
 libc/src/stdlib.c -text
diff --git a/libc/include/mkfifo.h b/libc/include/mkfifo.h
new file mode 100644
index 0000000..c94eb3e
--- /dev/null
+++ b/libc/include/mkfifo.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2014 - Zephyr Software LLC
+ *
+ * This file may be used and modified for non-commercial purposes as long as
+ * all copyright, permission, and nonwarranty notices are preserved.
+ * Redistribution is prohibited without prior written consent from Zephyr
+ * Software.
+ *
+ * Please contact the authors for restrictions applying to commercial use.
+ *
+ * THIS SOURCE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+ * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Author: Zephyr Software
+ * e-mail: jwd@zephyr-software.com
+ * URL   : http://www.zephyr-software.com/
+ *
+ */
+
+#ifndef mkfifo_h
+#define mkfifo_h
+
+int mkfifo(char *file, int mode);
+
+#endif
+
diff --git a/libc/src/mkfifo.c b/libc/src/mkfifo.c
new file mode 100644
index 0000000..6ece015
--- /dev/null
+++ b/libc/src/mkfifo.c
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2014 - Zephyr Software LLC
+ *
+ * This file may be used and modified for non-commercial purposes as long as
+ * all copyright, permission, and nonwarranty notices are preserved.
+ * Redistribution is prohibited without prior written consent from Zephyr
+ * Software.
+ *
+ * Please contact the authors for restrictions applying to commercial use.
+ *
+ * THIS SOURCE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+ * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Author: Zephyr Software
+ * e-mail: jwd@zephyr-software.com
+ * URL   : http://www.zephyr-software.com/
+ *
+ */
+
+#include <mkfifo.h>
+#include <syscall.h>
+
+/*
+int open(char *file, int flags)
+{
+#ifndef CGC
+	syscall(SYS_open,file,flags);
+#endif
+}
+*/
+#define M_FIFO 0010000
+int mkfifo(char *file, int mode)
+{
+#ifndef CGC
+	int dev = 0;
+	return syscall(SYS_mknod, file, mode | M_FIFO, &dev);
+#else
+	return -1;
+#endif
+}
-- 
GitLab