Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F135922354
D3076.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D3076.id.diff
View Options
Index: head/sys/compat/cloudabi/cloudabi_proc.c
===================================================================
--- head/sys/compat/cloudabi/cloudabi_proc.c
+++ head/sys/compat/cloudabi/cloudabi_proc.c
@@ -27,9 +27,10 @@
__FBSDID("$FreeBSD$");
#include <sys/param.h>
+#include <sys/lock.h>
+#include <sys/mutex.h>
#include <sys/proc.h>
-#include <sys/syscallsubr.h>
-#include <sys/sysproto.h>
+#include <sys/signalvar.h>
#include <compat/cloudabi/cloudabi_proto.h>
@@ -92,21 +93,22 @@
[CLOUDABI_SIGXCPU] = SIGXCPU,
[CLOUDABI_SIGXFSZ] = SIGXFSZ,
};
- static const struct sigaction sigdfl = {
- .sa_handler = SIG_DFL,
- };
- struct kill_args kill_args = {
- .pid = td->td_proc->p_pid,
- };
+ ksiginfo_t ksi;
+ struct proc *p;
- if (uap->sig >= nitems(signals) ||
- (uap->sig != 0 && signals[uap->sig] == 0)) {
- /* Invalid signal. */
- return (EINVAL);
+ if (uap->sig >= nitems(signals) || signals[uap->sig] == 0) {
+ /* Invalid signal, or the null signal. */
+ return (uap->sig == 0 ? 0 : EINVAL);
}
- kill_args.signum = signals[uap->sig];
- /* Restore to default signal action and send signal. */
- kern_sigaction(td, kill_args.signum, &sigdfl, NULL, 0);
- return (sys_kill(td, &kill_args));
+ p = td->td_proc;
+ ksiginfo_init(&ksi);
+ ksi.ksi_signo = signals[uap->sig];
+ ksi.ksi_code = SI_USER;
+ ksi.ksi_pid = p->p_pid;
+ ksi.ksi_uid = td->td_ucred->cr_ruid;
+ PROC_LOCK(p);
+ pksignal(p, ksi.ksi_signo, &ksi);
+ PROC_UNLOCK(p);
+ return (0);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 15, 4:47 AM (3 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25294013
Default Alt Text
D3076.id.diff (1 KB)
Attached To
Mode
D3076: Let proc_raise() call into pksignal() directly.
Attached
Detach File
Event Timeline
Log In to Comment