From: Justin Cinkelj <justin.cink...@xlab.si>
Committer: Nadav Har'El <n...@scylladb.com>
Branch: master

af_local: stub ioctl FIOASYNC

nginx doesn't start if ioctl with cmd=FIOASYNC fails. Stub it, so that
nginx can start unpatched.

Signed-off-by: Justin Cinkelj <justin.cink...@xlab.si>
Message-Id: <20170718091623.23284-2-justin.cink...@xlab.si>

---
diff --git a/libc/af_local.cc b/libc/af_local.cc
--- a/libc/af_local.cc
+++ b/libc/af_local.cc
@@ -19,6 +19,8 @@
 #include <utility>
 #include <sys/ioctl.h>

+#include <osv/stubbing.hh>
+
 using namespace std;

 struct af_local final : public special_file {
@@ -42,11 +44,17 @@ int af_local::ioctl(u_long cmd, void *data)
     int error = ENOTTY;
     switch (cmd) {
     case FIONBIO:
-        SCOPE_LOCK(f_lock);
-        if (*(int *)data)
-            f_flags |= FNONBLOCK;
-        else
-            f_flags &= ~FNONBLOCK;
+        {
+            SCOPE_LOCK(f_lock);
+            if (*(int *)data)
+                f_flags |= FNONBLOCK;
+            else
+                f_flags &= ~FNONBLOCK;
+        }
+        error = 0;
+        break;
+    case FIOASYNC:
+        WARN_ONCE("af_local::ioctl(FIOASYNC) stubbed\n");
         error = 0;
         break;
     }

--
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to