git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
refactor: separate syscall interfaces from kernel space, into posix compliant structure.
[lunaix-os.git]
/
lunaix-os
/
kernel
/
demos
/
iotest.c
diff --git
a/lunaix-os/kernel/demos/iotest.c
b/lunaix-os/kernel/demos/iotest.c
index cba89623af1ab9c3dc6893bf84195385380ca23e..91c3571043e3a09893bf14857c2cb9c31c90ed88 100644
(file)
--- a/
lunaix-os/kernel/demos/iotest.c
+++ b/
lunaix-os/kernel/demos/iotest.c
@@
-1,8
+1,8
@@
-#include <lunaix/fctrl.h>
-#include <lunaix/foptions.h>
-#include <lunaix/lunaix.h>
-#include <lunaix/lunistd.h>
#include <ulibc/stdio.h>
#include <ulibc/stdio.h>
+#include <usr/errno.h>
+#include <usr/fcntl.h>
+#include <usr/sys/lunaix.h>
+#include <usr/unistd.h>
void
_iotest_main()
void
_iotest_main()
@@
-13,8
+13,8
@@
_iotest_main()
char read_out[256];
// 切换工作目录至 /dev
char read_out[256];
// 切换工作目录至 /dev
- int
errno
= chdir("/dev");
- if (
errno
) {
+ int
status
= chdir("/dev");
+ if (
status
) {
write(stdout, "fail to chdir", 15);
return;
}
write(stdout, "fail to chdir", 15);
return;
}
@@
-29,7
+29,7
@@
_iotest_main()
int fd = open("./sda", 0);
if (fd < 0) {
int fd = open("./sda", 0);
if (fd < 0) {
- printf("fail to open (%d)\n",
geterrno()
);
+ printf("fail to open (%d)\n",
errno
);
return;
}
return;
}