One solution is to execute the following for loop in the child process before it calls exec:
int fd;
for (fd = 3; fd <= MaxFdOfTheProcess; fd++) { (void) close(fd); }
You can use PR_GetSysfdTableMax as an example of getting the value of 'MaxFdOfTheProcess'. (PR_GetSysfdTableMax is an unsupported function, so its code may be incorrect.)
One solution is to execute the following for loop in
the child process before it calls exec:
int fd;
for (fd = 3; fd <= MaxFdOfTheProcess; fd++) {
(void) close(fd);
}
You can use PR_GetSysfdTableMax as an example of getting ess'. (PR_GetSysfdTab leMax
the value of 'MaxFdOfTheProc
is an unsupported function, so its code may be incorrect.)