diff options
author | dchagin <dchagin@FreeBSD.org> | 2017-03-15 17:11:01 +0000 |
---|---|---|
committer | dchagin <dchagin@FreeBSD.org> | 2017-03-15 17:11:01 +0000 |
commit | 94495fcc0c582fbe9dede61a715fb1241a7d40f8 (patch) | |
tree | 9ddccd78a2244af9191057cdb80e40a6f34b1c74 /sys | |
parent | 5a4fc650c2d6acbc7dcbc7f40efb693d890b9fa0 (diff) | |
download | FreeBSD-src-94495fcc0c582fbe9dede61a715fb1241a7d40f8.zip FreeBSD-src-94495fcc0c582fbe9dede61a715fb1241a7d40f8.tar.gz |
MFC r313940:
Implement rt_tgsigqueueinfo system call used by glibc for pthread_sigqueue(3).
Diffstat (limited to 'sys')
-rw-r--r-- | sys/amd64/linux/linux_dummy.c | 1 | ||||
-rw-r--r-- | sys/amd64/linux32/linux32_dummy.c | 1 | ||||
-rw-r--r-- | sys/compat/linux/linux_signal.c | 29 | ||||
-rw-r--r-- | sys/i386/linux/linux_dummy.c | 1 |
4 files changed, 29 insertions, 3 deletions
diff --git a/sys/amd64/linux/linux_dummy.c b/sys/amd64/linux/linux_dummy.c index 85b6757..9c98800 100644 --- a/sys/amd64/linux/linux_dummy.c +++ b/sys/amd64/linux/linux_dummy.c @@ -112,7 +112,6 @@ DUMMY(timerfd_gettime); DUMMY(signalfd4); DUMMY(inotify_init1); /* linux 2.6.31: */ -DUMMY(rt_tgsigqueueinfo); DUMMY(perf_event_open); /* linux 2.6.38: */ DUMMY(fanotify_init); diff --git a/sys/amd64/linux32/linux32_dummy.c b/sys/amd64/linux32/linux32_dummy.c index 27f26f4..8a59859 100644 --- a/sys/amd64/linux32/linux32_dummy.c +++ b/sys/amd64/linux32/linux32_dummy.c @@ -111,7 +111,6 @@ DUMMY(timerfd_gettime); DUMMY(signalfd4); DUMMY(inotify_init1); /* linux 2.6.31: */ -DUMMY(rt_tgsigqueueinfo); DUMMY(perf_event_open); /* linux 2.6.33: */ DUMMY(fanotify_init); diff --git a/sys/compat/linux/linux_signal.c b/sys/compat/linux/linux_signal.c index 0ecf537..69bcd94 100644 --- a/sys/compat/linux/linux_signal.c +++ b/sys/compat/linux/linux_signal.c @@ -764,3 +764,32 @@ linux_rt_sigqueueinfo(struct thread *td, struct linux_rt_sigqueueinfo_args *args return (error); } + +int +linux_rt_tgsigqueueinfo(struct thread *td, struct linux_rt_tgsigqueueinfo_args *args) +{ + l_siginfo_t linfo; + struct thread *tds; + ksiginfo_t ksi; + int error; + int sig; + + if (!LINUX_SIG_VALID(args->sig)) + return (EINVAL); + + error = copyin(args->uinfo, &linfo, sizeof(linfo)); + if (error != 0) + return (error); + + if (linfo.lsi_code >= 0) + return (EPERM); + + tds = linux_tdfind(td, args->tid, args->tgid); + if (tds == NULL) + return (ESRCH); + + sig = linux_to_bsd_signal(args->sig); + ksiginfo_init(&ksi); + lsiginfo_to_ksiginfo(&linfo, &ksi, sig); + return (linux_do_tkill(td, tds, &ksi)); +} diff --git a/sys/i386/linux/linux_dummy.c b/sys/i386/linux/linux_dummy.c index f046600..06145c0 100644 --- a/sys/i386/linux/linux_dummy.c +++ b/sys/i386/linux/linux_dummy.c @@ -107,7 +107,6 @@ DUMMY(timerfd_gettime); DUMMY(signalfd4); DUMMY(inotify_init1); /* linux 2.6.31: */ -DUMMY(rt_tgsigqueueinfo); DUMMY(perf_event_open); /* linux 2.6.33: */ DUMMY(fanotify_init); |