FreeBSD support
[lcore.git] / unitfork.pas
index 019695bfb796ea852173ef290476c5e926bab579..9e8503fbe576936203992b0bdf660655e775b6cf 100644 (file)
@@ -3,7 +3,9 @@
     which is included in the package\r
       ----------------------------------------------------------------------------- }\r
 unit unitfork;\r
     which is included in the package\r
       ----------------------------------------------------------------------------- }\r
 unit unitfork;\r
-\r
+{$ifdef fpc}\r
+  {$mode delphi}\r
+{$endif}\r
 interface\r
 \r
 procedure dofork(const programname:string);\r
 interface\r
 \r
 procedure dofork(const programname:string);\r
@@ -63,7 +65,11 @@ begin
     if ioresult <> 0 then exit;\r
   end;\r
 \r
     if ioresult <> 0 then exit;\r
   end;\r
 \r
+  {$IF FPC_FULLVERSION>=20602}\r
+  handle := getfilehandle(pidfile);\r
+  {$else}\r
   handle := getfs(pidfile);\r
   handle := getfs(pidfile);\r
+  {$endif}\r
 \r
   //debugout('got handle');\r
   {check if locking is possible: it's not if other process still runs}\r
 \r
   //debugout('got handle');\r
   {check if locking is possible: it's not if other process still runs}\r