tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern_sig.c



On Sat, Nov 21, 2015 at 8:21 PM, Masao Uebayashi <uebayasi%gmail.com@localhost> wrote:
> On Sat, Nov 21, 2015 at 8:13 PM, Masao Uebayashi <uebayasi%gmail.com@localhost> wrote:
>> I'm too young to understand how signal works in kernel.  But I guess
>> I'm not alone.
>>
>> I think that renaming things a bit would help people to understand the code.
>>
>> *
>> - sendsig() -> netbsd_sendsig()
>> - trapsignal() -> netbsd_trapsignal()
>>
>> These are native emul functions of e_sendsig and e_trapsignal respectively.
>>
>> *
>>
>> - postsig() -> sendsig()
>>
>> This is so badly named and incredibly confusing, as these is a
>> function called sigpost() which is completely different.
>>
>> sigpost() posts a signal to a signal queue.  sigpost() can be called
>> from anywhere including interrupt context, because all it does is to

... put a pending signal onto the target's queue.

- kpsignal2() -> kpsignal()

The code in kpsignal() filling ksi_fd should belong to
kern_filedesc.c; callers are responsible to fill ksi before calling
kpsignal().  Then kpsignal2() can happily declare it as "kpsignal()".
signal(9) has to follow too.

(hi xtos)


Home | Main Index | Thread Index | Old Index