Line | |
---|
1 | #include <lib.h>
|
---|
2 | #define open _open
|
---|
3 | #include <fcntl.h>
|
---|
4 | #include <stdarg.h>
|
---|
5 | #include <string.h>
|
---|
6 |
|
---|
7 | #if _ANSI
|
---|
8 | PUBLIC int open(const char *name, int flags, ...)
|
---|
9 | #else
|
---|
10 | PUBLIC int open(name, flags)
|
---|
11 | _CONST char *name;
|
---|
12 | int flags;
|
---|
13 | #endif
|
---|
14 | {
|
---|
15 | va_list argp;
|
---|
16 | message m;
|
---|
17 |
|
---|
18 | va_start(argp, flags);
|
---|
19 | if (flags & O_CREAT) {
|
---|
20 | m.m1_i1 = strlen(name) + 1;
|
---|
21 | m.m1_i2 = flags;
|
---|
22 | m.m1_i3 = va_arg(argp, _mnx_Mode_t);
|
---|
23 | m.m1_p1 = (char *) name;
|
---|
24 | } else {
|
---|
25 | _loadname(name, &m);
|
---|
26 | m.m3_i2 = flags;
|
---|
27 | }
|
---|
28 | va_end(argp);
|
---|
29 | return (_syscall(FS, OPEN, &m));
|
---|
30 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.