file: fileflagstovnodeflags O_NONBLOCK -> V_FFLAGS_NONBLOCKING support

This commit is contained in:
Matheus
2023-07-05 00:04:23 -03:00
parent c0fdd5700e
commit 3910646494
+12 -10
View File
@@ -34,16 +34,6 @@ int fd_clone(proc_t *proc);
#define FILE_WRITE 2
#define FILE_KNOWN_FLAGS 3
static inline int fileflagstovnodeflags(int flags) {
int vnflags = 0;
if (flags & FILE_READ)
vnflags |= V_FFLAGS_READ;
if (flags & FILE_WRITE)
vnflags |= V_FFLAGS_WRITE;
return vnflags;
}
#define O_RDONLY 0
#define O_WRONLY 1
#define O_RDWR 2
@@ -66,6 +56,18 @@ static inline int fileflagstovnodeflags(int flags) {
#define O_RSYNC 04010000
#define O_TMPFILE 020000000
static inline int fileflagstovnodeflags(int flags) {
int vnflags = 0;
if (flags & FILE_READ)
vnflags |= V_FFLAGS_READ;
if (flags & FILE_WRITE)
vnflags |= V_FFLAGS_WRITE;
if (flags & O_NONBLOCK)
vnflags |= V_FFLAGS_NONBLOCKING;
return vnflags;
}
#define FDTABLE_LIMIT 256
#endif