summaryrefslogtreecommitdiffstats
path: root/sys/compat
diff options
context:
space:
mode:
Diffstat (limited to 'sys/compat')
-rw-r--r--sys/compat/freebsd32/freebsd32.h5
-rw-r--r--sys/compat/freebsd32/freebsd32_misc.c38
-rw-r--r--sys/compat/freebsd32/syscalls.master5
3 files changed, 48 insertions, 0 deletions
diff --git a/sys/compat/freebsd32/freebsd32.h b/sys/compat/freebsd32/freebsd32.h
index fccdef0..a95b0e5 100644
--- a/sys/compat/freebsd32/freebsd32.h
+++ b/sys/compat/freebsd32/freebsd32.h
@@ -88,6 +88,11 @@ struct rusage32 {
int32_t ru_nivcsw;
};
+struct wrusage32 {
+ struct rusage32 wru_self;
+ struct rusage32 wru_children;
+};
+
struct itimerval32 {
struct timeval32 it_interval;
struct timeval32 it_value;
diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c
index ce8bd7a..8c5f5a6 100644
--- a/sys/compat/freebsd32/freebsd32_misc.c
+++ b/sys/compat/freebsd32/freebsd32_misc.c
@@ -180,6 +180,44 @@ freebsd32_wait4(struct thread *td, struct freebsd32_wait4_args *uap)
return (error);
}
+int
+freebsd32_wait6(struct thread *td, struct freebsd32_wait6_args *uap)
+{
+ struct wrusage32 wru32;
+ struct __wrusage wru, *wrup;
+ struct siginfo32 si32;
+ struct __siginfo si, *sip;
+ int error, status;
+
+ if (uap->wrusage != NULL)
+ wrup = &wru;
+ else
+ wrup = NULL;
+
+ if (uap->info != NULL) {
+ sip = &si;
+ bzero(sip, sizeof(*sip));
+ } else
+ sip = NULL;
+
+ error = kern_wait6(td, uap->idtype, uap->id, &status, uap->options,
+ wrup, sip);
+ if (error != 0)
+ return (error);
+ if (uap->status != NULL)
+ error = copyout(&status, uap->status, sizeof(status));
+ if (uap->wrusage != NULL && error == 0) {
+ freebsd32_rusage_out(&wru.wru_self, &wru32.wru_self);
+ freebsd32_rusage_out(&wru.wru_children, &wru32.wru_children);
+ error = copyout(&wru32, uap->wrusage, sizeof(wru32));
+ }
+ if (uap->info != NULL && error == 0) {
+ siginfo_to_siginfo32 (&si, &si32);
+ error = copyout(&si32, uap->info, sizeof(si32));
+ }
+ return (error);
+}
+
#ifdef COMPAT_FREEBSD4
static void
copy_statfs(struct statfs *in, struct statfs32 *out)
diff --git a/sys/compat/freebsd32/syscalls.master b/sys/compat/freebsd32/syscalls.master
index 478558a..4106447 100644
--- a/sys/compat/freebsd32/syscalls.master
+++ b/sys/compat/freebsd32/syscalls.master
@@ -1000,3 +1000,8 @@
uint32_t offset1, uint32_t offset2,\
uint32_t len1, uint32_t len2, \
int advice); }
+532 AUE_WAIT6 STD { int freebsd32_wait6(int idtype, int id, \
+ int *status, int options, \
+ struct wrusage32 *wrusage, \
+ siginfo_t *info); }
+
OpenPOWER on IntegriCloud