aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/test/os_SUITE_data/my_fds.c
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2016-09-02 14:29:26 +0200
committerLukas Larsson <[email protected]>2016-09-02 16:34:56 +0200
commitc0ed19c1261ee281d3c8f36ec3f28fa7328f0f39 (patch)
treec0bc86162e6a429289245b0da5cfc0901f9ebfbf /lib/kernel/test/os_SUITE_data/my_fds.c
parent71894a879d6254693791585246ce340dd7414b82 (diff)
downloadotp-c0ed19c1261ee281d3c8f36ec3f28fa7328f0f39.tar.gz
otp-c0ed19c1261ee281d3c8f36ec3f28fa7328f0f39.tar.bz2
otp-c0ed19c1261ee281d3c8f36ec3f28fa7328f0f39.zip
kernel: Close stdin of commands run in os:cmd
This is needed when running programs that only exit when stdin has been closed, e.g. 'more'.
Diffstat (limited to 'lib/kernel/test/os_SUITE_data/my_fds.c')
-rw-r--r--lib/kernel/test/os_SUITE_data/my_fds.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/kernel/test/os_SUITE_data/my_fds.c b/lib/kernel/test/os_SUITE_data/my_fds.c
new file mode 100644
index 0000000000..704a4d1e1d
--- /dev/null
+++ b/lib/kernel/test/os_SUITE_data/my_fds.c
@@ -0,0 +1,9 @@
+#include <stdio.h>
+
+int
+main(int argc, char** argv)
+{
+ char buff[1];
+ int res = read(stdin, buff, 1);
+ printf("%d", res);
+}