fcntl/O_CLOEXEC: add O_CLOEXEC map for hostfs
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
This commit is contained in:
parent
31bb362aab
commit
094e986bbd
@ -181,6 +181,11 @@ int host_open(const char *pathname, int flags, nuttx_mode_t mode)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (flags & NUTTX_O_CLOEXEC)
|
||||
{
|
||||
mapflags |= O_CLOEXEC;
|
||||
}
|
||||
|
||||
int ret = open(pathname, mapflags, mode);
|
||||
if (ret == -1)
|
||||
{
|
||||
|
@ -84,6 +84,7 @@
|
||||
#define NUTTX_O_SYNC (1 << 7) /* Synchronize output on write */
|
||||
#define NUTTX_O_BINARY (1 << 8) /* Open the file in binary mode. */
|
||||
#define NUTTX_O_DIRECT (1 << 9) /* Avoid caching, write directly to hardware */
|
||||
#define NUTTX_O_CLOEXEC (1 << 10) /* Close on execute */
|
||||
|
||||
#define NUTTX_O_RDWR (NUTTX_O_RDONLY | NUTTX_O_WRONLY)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user