. pci driver now returns devices, even when they have been pci_reserve()d
[minix3.git] / lib / posix / _open.c
blobcf5ea4c201de032fc8bb95b74bb488e8e3109330
1 #include <lib.h>
2 #define open _open
3 #include <fcntl.h>
4 #include <stdarg.h>
5 #include <string.h>
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
15 va_list argp;
16 message m;
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;
28 va_end(argp);
29 return (_syscall(FS, OPEN, &m));