svn commit: r265185 - in user/dchagin/lemul/sys: amd64/linux32 compat/linux
Dmitry Chagin
dchagin at FreeBSD.org
Thu May 1 14:00:48 UTC 2014
Author: dchagin
Date: Thu May 1 14:00:47 2014
New Revision: 265185
URL: http://svnweb.freebsd.org/changeset/base/265185
Log:
Convert Linux wait options to the native.
Also remove bogus check's which are done by kern_wait().
Modified:
user/dchagin/lemul/sys/amd64/linux32/linux32_machdep.c
user/dchagin/lemul/sys/compat/linux/linux_misc.c
Modified: user/dchagin/lemul/sys/amd64/linux32/linux32_machdep.c
==============================================================================
--- user/dchagin/lemul/sys/amd64/linux32/linux32_machdep.c Thu May 1 13:59:24 2014 (r265184)
+++ user/dchagin/lemul/sys/amd64/linux32/linux32_machdep.c Thu May 1 14:00:47 2014 (r265185)
@@ -1037,10 +1037,8 @@ linux_wait4(struct thread *td, struct li
(void *)args->rusage);
#endif
- options = (args->options & (WNOHANG | WUNTRACED));
- /* WLINUXCLONE should be equal to __WCLONE, but we make sure */
- if (args->options & __WCLONE)
- options |= WLINUXCLONE;
+ options = 0;
+ linux_to_bsd_waitopts(args->options, &options);
if (args->rusage != NULL)
rup = &ru;
Modified: user/dchagin/lemul/sys/compat/linux/linux_misc.c
==============================================================================
--- user/dchagin/lemul/sys/compat/linux/linux_misc.c Thu May 1 13:59:24 2014 (r265184)
+++ user/dchagin/lemul/sys/compat/linux/linux_misc.c Thu May 1 14:00:47 2014 (r265185)
@@ -876,17 +876,8 @@ linux_waitpid(struct thread *td, struct
printf(ARGS(waitpid, "%d, %p, %d"),
args->pid, (void *)args->status, args->options);
#endif
- /*
- * this is necessary because the test in kern_wait doesn't work
- * because we mess with the options here
- */
- if (args->options & ~(WUNTRACED | WNOHANG | WCONTINUED | __WCLONE))
- return (EINVAL);
-
- options = (args->options & (WNOHANG | WUNTRACED));
- /* WLINUXCLONE should be equal to __WCLONE, but we make sure */
- if (args->options & __WCLONE)
- options |= WLINUXCLONE;
+ options = 0;
+ linux_to_bsd_waitopts(args->options, &options);
return (linux_common_wait(td, args->pid, args->status, options, NULL));
}
More information about the svn-src-user
mailing list