fixed GH #1204: getdtablesize has been removed on Android 21

This commit is contained in:
Guenter Obiltschnig 2016-03-17 11:19:32 +01:00
parent 6f44a02a65
commit 9d21ddd8ca

View File

@ -201,7 +201,7 @@ ProcessHandleImpl* ProcessImpl::launchByForkExecImpl(const std::string& command,
if (outPipe) outPipe->close(Pipe::CLOSE_BOTH);
if (errPipe) errPipe->close(Pipe::CLOSE_BOTH);
// close all open file descriptors other than stdin, stdout, stderr
for (int i = 3; i < getdtablesize(); ++i)
for (int i = 3; i < sysconf(_SC_OPEN_MAX); ++i)
{
close(i);
}