Subject: siginfo, signal queues, memory issues
To: None <tech-kern@netbsd.org>
From: Christos Zoulas <christos@zoulas.com>
List: tech-kern
Date: 11/27/2002 23:44:11
I've been adding support for siginfo on the nathanw-sa branch. From looking
at the code, it uses a memory pool for siginfo_t structs and it frees them
when the upcall completes.
It unfortunately does not deal with siginfo non lwp processes, or even
pass proper trap info in it. It seems to me that struct sigctx needs to
keep either an array or a list of siginfo_t's. I leaning more towards a
list, because this will buy us signal queueing.
Questions:
1. Is it ok to queue all the signals, not only the rt ones?
2. How do we deal with memory shortage situations? Do we put
a limit on the size of the signal queue?
3. I am using two structures for siginfo. One for the kernel
that is smallish [60 bytes], and one of userland that is
padded to 128 bytes as the standards advise. Should I bother?
4. It seems to be that the pending signal gets cleared twice in
kern_sig.c (under the comment /* take signal */). Is that
correct?
5. I've changed sendsig() to be sendsig(struct ksiginfo *, sigset_t *),
trapsignal() to be trapsignal(struct lwp *, int sig, int code,
void *addr, u_long trap), issignal() to return struct ksiginfo *,
etc. Does that look sane?
I just need some feedback to make sure that I am going about it
the right way, because some of the changes are quite extensive.
christos