Summary Files Commits Branches @commit @diff @stats
path: root / Year 3 / System programming / Practice08 / ex1.c
diff options
context:
space:
mode:
1 files changed, 16 insertions, 0 deletions
-rw-r--r--Year 3/System programming/Practice08/ex1.c16
diff --git a/Year 3/System programming/Practice08/ex1.c b/Year 3/System programming/Practice08/ex1.c
new file mode 100644
index 0000000..63ee62e
--- /dev/null
+++ b/Year 3/System programming/Practice08/ex1.c
@@ -0,0 +1,16 @@
+#include <signal.h>
+#include <stdio.h>
+#include <unistd.h>
+
+int main() {
+ signal(SIGPIPE, SIG_IGN);
+
+ int filedes[2];
+ pipe(filedes);
+ close(filedes[0]);
+
+ write(filedes[1], "aba\n", 4);
+ write(1, "mnm\n", 4);
+
+ return 0;
+}