aboutsummaryrefslogtreecommitdiff
path: root/tests/unistd/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unistd/io.c')
-rw-r--r--tests/unistd/io.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/unistd/io.c b/tests/unistd/io.c
index eeb80373..a96290ef 100644
--- a/tests/unistd/io.c
+++ b/tests/unistd/io.c
@@ -34,6 +34,19 @@ int main() {
printf("errno: %d\n\n", errno);
errno = 0;
+ int cd_ro_r = open("/createDevice-read-only", O_RDONLY);
+ printf("open read-only device from createDevice for read, errno: %d\n", errno);
+ errno = 0;
+ int cd_ro_w = open("/createDevice-read-only", O_WRONLY);
+ printf("open read-only device from createDevice for write, errno: %d\n", errno);
+ errno = 0;
+ int cd_wo_r = open("/createDevice-write-only", O_RDONLY);
+ printf("open write-only device from createDevice for read, errno: %d\n", errno);
+ errno = 0;
+ int cd_wo_w = open("/createDevice-write-only", O_WRONLY);
+ printf("open write-only device from createDevice for write, errno: %d\n\n", errno);
+ errno = 0;
+
int f = open("/file", O_RDWR);
printf("read from file: %d\n", read(f, readBuffer, sizeof readBuffer));
printf("data: %s\n", readBuffer);