MCPcopy Create free account
hub / github.com/MhmRdd/NoHello / forkcall

Function forkcall

module/src/main/cpp/utils.cpp:115–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113}
114
115int forkcall(const std::function<int()> &lambda)
116{
117 pid_t pid = fork();
118 if (pid == -1)
119 return -1;
120 if (pid == 0) {
121 exit(lambda());
122 } else {
123 int status = -1;
124 waitpid(pid, &status, 0);
125 if (WIFEXITED(status)) {
126 return WEXITSTATUS(status);
127 }
128 }
129 return -1;
130}
131
132static inline int seccomp(int op, int fd, void *arg) {
133 return syscall(SYS_seccomp, op, fd, arg);

Callers 1

NoRootFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected