linux(4): wait4() returns ESRCH if pid is INT_MIN.

Weird and undocumented patch was added to the Linux kernel in 2017,
fixes wait403 LTP test.

MFC after:	2 weeks
This commit is contained in:
Dmitry Chagin 2022-03-31 20:49:39 +03:00
parent 5bcf0f7cd7
commit 9103c5582a

View file

@ -1054,6 +1054,10 @@ linux_wait4(struct thread *td, struct linux_wait4_args *args)
LINUX_WCONTINUED | __WCLONE | __WNOTHREAD | __WALL))
return (EINVAL);
/* -INT_MIN is not defined. */
if (args->pid == INT_MIN)
return (ESRCH);
options = 0;
linux_to_bsd_waitopts(args->options, &options);