summaryrefslogtreecommitdiffstats
path: root/sys/compat/freebsd32
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2013-07-21 19:33:48 +0000
committerkib <kib@FreeBSD.org>2013-07-21 19:33:48 +0000
commit97d40396c6138592e15718c1b7c6d6b33f61efea (patch)
tree07205baf2311c75224512c86bb251b68fa9f790e /sys/compat/freebsd32
parent1d140c8ee835525df03225e15a8c3e1ae7d99185 (diff)
downloadFreeBSD-src-97d40396c6138592e15718c1b7c6d6b33f61efea.zip
FreeBSD-src-97d40396c6138592e15718c1b7c6d6b33f61efea.tar.gz
Move the convert_sigevent32() utility function into freebsd32_misc.c
for consumption outside the vfs_aio.c. For SIGEV_THREAD_ID and SIGEV_SIGNAL notification delivery methods, also copy in the sigev_value, since librt event pumping loop compares note generation number with the value passed through sigev_value. Tested by: Petr Salinger <Petr.Salinger@seznam.cz> Sponsored by: The FreeBSD Foundation MFC after: 1 week
Diffstat (limited to 'sys/compat/freebsd32')
-rw-r--r--sys/compat/freebsd32/freebsd32_misc.c26
-rw-r--r--sys/compat/freebsd32/freebsd32_signal.h2
2 files changed, 28 insertions, 0 deletions
diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c
index 38bc3e5..13d2bcb 100644
--- a/sys/compat/freebsd32/freebsd32_misc.c
+++ b/sys/compat/freebsd32/freebsd32_misc.c
@@ -2912,3 +2912,29 @@ freebsd32_posix_fadvise(struct thread *td,
return (kern_posix_fadvise(td, uap->fd, PAIR32TO64(off_t, uap->offset),
PAIR32TO64(off_t, uap->len), uap->advice));
}
+
+int
+convert_sigevent32(struct sigevent32 *sig32, struct sigevent *sig)
+{
+
+ CP(*sig32, *sig, sigev_notify);
+ switch (sig->sigev_notify) {
+ case SIGEV_NONE:
+ break;
+ case SIGEV_THREAD_ID:
+ CP(*sig32, *sig, sigev_notify_thread_id);
+ /* FALLTHROUGH */
+ case SIGEV_SIGNAL:
+ CP(*sig32, *sig, sigev_signo);
+ PTRIN_CP(*sig32, *sig, sigev_value.sival_ptr);
+ break;
+ case SIGEV_KEVENT:
+ CP(*sig32, *sig, sigev_notify_kqueue);
+ CP(*sig32, *sig, sigev_notify_kevent_flags);
+ PTRIN_CP(*sig32, *sig, sigev_value.sival_ptr);
+ break;
+ default:
+ return (EINVAL);
+ }
+ return (0);
+}
diff --git a/sys/compat/freebsd32/freebsd32_signal.h b/sys/compat/freebsd32/freebsd32_signal.h
index d31a8ae..18899f8 100644
--- a/sys/compat/freebsd32/freebsd32_signal.h
+++ b/sys/compat/freebsd32/freebsd32_signal.h
@@ -97,6 +97,8 @@ struct sigevent32 {
} _sigev_un;
};
+struct sigevent;
+int convert_sigevent32(struct sigevent32 *sig32, struct sigevent *sig);
void siginfo_to_siginfo32(const siginfo_t *src, struct siginfo32 *dst);
#endif /* !_COMPAT_FREEBSD32_SIGNAL_H_ */
OpenPOWER on IntegriCloud