diff --git a/lib/modules/Process.pmod b/lib/modules/Process.pmod
index 9646e3affc7746f101c917b5fe560cb25f9f5f69..65a407ecd6239c2622e1b76b860f43fc854c2929 100644
--- a/lib/modules/Process.pmod
+++ b/lib/modules/Process.pmod
@@ -1101,15 +1101,16 @@ class Spawn
 #endif
 #endif
 
+#if constant(fork) || constant(System.daemon)
 private int low_daemon(int nochdir, int noclose)
 {
-#if System.daemon
+#if constant(System.daemon)
     return System.daemon(nochdir, noclose);
 #else
     if (fork())
         exit(0);
 
-#if System.setsid
+#if constant(System.setsid)
         System.setsid();
 #endif /* System.setsid */
 
@@ -1210,3 +1211,4 @@ void daemon(int nochdir, int noclose,
 
     opened->close();
 }
+#endif