rlimit(RLIMIT_NOFILE): return one less to make sure sync pipe can be created (LTP fork09)

This commit is contained in:
Balazs Gerofi bgerofi@riken.jp
2014-12-04 17:40:00 +09:00
parent b2cab453f1
commit af83f1be64

View File

@ -2330,6 +2330,12 @@ SYSCALL_DECLARE(getrlimit)
case RLIMIT_NOFILE: case RLIMIT_NOFILE:
/* just forward */ /* just forward */
ret = syscall_generic_forwarding(n, ctx); ret = syscall_generic_forwarding(n, ctx);
/* return one less than the actual value to make sure mcexec can open
* its temporary synchronization pipe when a new process is forked */
if (resource == RLIMIT_NOFILE) {
ret -= 1;
}
break; break;
default: default: