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

Function ParseFd

module/src/main/cpp/external/fdutils/fd_utils.cpp:325–337  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

323}
324
325static int ParseFd(dirent* dir_entry, int dir_fd) {
326 char* end;
327 const int fd = strtol(dir_entry->d_name, &end, 10);
328 if ((*end) != '\0') {
329 return -1;
330 }
331 // Don't bother with the standard input/output/error, they're handled
332 // specially post-fork anyway.
333 if (fd <= STDERR_FILENO || fd == dir_fd) {
334 return -1;
335 }
336 return fd;
337}

Callers 1

GetOpenFdsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected