diff --git a/src/which/Process.hx b/src/which/Process.hx index 2503c93..25b5159 100644 --- a/src/which/Process.hx +++ b/src/which/Process.hx @@ -1,35 +1,27 @@ package which; import asys.io.Process as AsyncProcess; +import haxe.Int64; using StringTools; using tink.io.Source; -#if java -import haxe.Int64; -import java.security.auth.module.UnixSystem; -#elseif nodejs -import js.Node; -#elseif php -import php.Syntax; -#end - /** Provides information about the current process. **/ abstract class Process { /** The identifier of the current process's group. **/ public static var gid(get, never): Promise; static inline function get_gid() return Finder.isWindows ? new Error(MethodNotAllowed, "Not supported on Windows platform.") : - #if java Promise.resolve(Int64.toInt(new UnixSystem().getGid())) - #elseif js Promise.resolve(Node.process.getgid()) - #elseif php Promise.resolve(Syntax.code("posix_getgid()")) + #if java Promise.resolve(Int64.toInt(new java.security.auth.module.UnixSystem().getGid())) + #elseif js Promise.resolve(js.Node.process.getgid()) + #elseif php Promise.resolve(php.Syntax.code("posix_getgid()")) #else getProcessId("g") #end; /** The identifier of the current process's user. **/ public static var uid(get, never): Promise; static inline function get_uid() return Finder.isWindows ? new Error(MethodNotAllowed, "Not supported on Windows platform.") : - #if java Promise.resolve(Int64.toInt(new UnixSystem().getUid())) - #elseif js Promise.resolve(Node.process.getuid()) - #elseif php Promise.resolve(Syntax.code("posix_getuid()")) + #if java Promise.resolve(Int64.toInt(new java.security.auth.module.UnixSystem().getUid())) + #elseif js Promise.resolve(js.Node.process.getuid()) + #elseif php Promise.resolve(php.Syntax.code("posix_getuid()")) #else getProcessId("u") #end; /** Gets the numeric identity of the current process by using the "id" command. **/