LinuxNativeProtocolsDB(LinuxLibProto lib) { this.lib = lib; this.runtime = Library.getRuntime(lib); this.buf = Memory.allocateDirect(runtime, BUFLEN); }
LinuxServicesDB(LibServices lib) { super(lib); this.lib = (LinuxLibServices) lib; this.runtime = Library.getRuntime(lib); this.buf = Memory.allocateDirect(runtime, BUFLEN); }
public long posix_spawnp(String path, Collection<? extends SpawnFileAction> fileActions, CharSequence[] argv, CharSequence[] envp) { AbstractNumberReference<? extends Number> pid = Library.getRuntime(libc()).findType(TypeAlias.pid_t).size() == 4 ? new IntByReference(-1) : new LongLongByReference(-1); Pointer nativeFileActions = nativeFileActions(fileActions); try { if (((UnixLibC) libc()).posix_spawnp(pid, path, nativeFileActions, null, argv, envp) < 0) { Errno e = Errno.valueOf(errno()); handler.error(e, "posix_spawnp", e.description()); } } finally { ((UnixLibC) libc()).posix_spawn_file_actions_destroy(nativeFileActions); } return pid.longValue(); }