Signed-off-by: Waldemar Kozaczuk <jwkozac...@gmail.com>
---
 fs/vfs/main.cc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/vfs/main.cc b/fs/vfs/main.cc
index 7e028ffb..a5bbf087 100644
--- a/fs/vfs/main.cc
+++ b/fs/vfs/main.cc
@@ -1454,6 +1454,10 @@ int fcntl(int fd, int cmd, int arg)
     // ignored in OSv anyway, as it doesn't support exec().
     switch (cmd) {
     case F_DUPFD:
+    // On Linux F_DUPFD_CLOEXEC is used to affect behavior of duplicated file 
descriptor
+    // across execve() boundaries, but on OSv there is single process so we 
make it
+    // behave exactly like F_DUPFD does
+    case F_DUPFD_CLOEXEC:
         error = _fdalloc(fp, &ret, arg);
         if (error)
             goto out_errno;
-- 
2.20.1

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osv-dev/20191130041217.13741-1-jwkozaczuk%40gmail.com.

Reply via email to