MCPcopy Create free account
hub / github.com/questdb/questdb / forkExec

Method forkExec

core/src/main/java/io/questdb/std/Os.java:69–90  ·  view source on GitHub ↗
(CharSequence args)

Source from the content-addressed store, hash-verified

67 public static native int errno();
68
69 public static long forkExec(CharSequence args) {
70 ObjList<Path> paths = Chars.splitLpsz(args);
71 int n = paths.size();
72 try {
73 long argv = Unsafe.malloc((n + 1) * 8L, MemoryTag.NATIVE_DEFAULT);
74 try {
75 long p = argv;
76 for (int i = 0; i < n; i++) {
77 Unsafe.putLong(p, paths.getQuick(i).ptr());
78 p += 8;
79 }
80 Unsafe.putLong(p, 0);
81 return forkExec(argv);
82 } finally {
83 Unsafe.free(argv, n + 1, MemoryTag.NATIVE_DEFAULT);
84 }
85 } finally {
86 for (int i = 0; i < n; i++) {
87 paths.getQuick(i).close();
88 }
89 }
90 }
91
92 public static int forkExecPid(long forkExecT) {
93 return Unsafe.getInt(forkExecT + 8);

Callers

nothing calls this directly

Calls 8

splitLpszMethod · 0.95
mallocMethod · 0.95
putLongMethod · 0.95
freeMethod · 0.95
sizeMethod · 0.65
ptrMethod · 0.65
getQuickMethod · 0.65
closeMethod · 0.65

Tested by

no test coverage detected