In article <CA+SXE9t2KmC8rsdohdTtaXQLPV44L=jbuco6x1ct4+7fjwq...@mail.gmail.com>,
Charles Cui <[email protected]> wrote:
>-=-=-=-=-=-
>
>I will study FreeBSD logic first and share with you guys.
>
>2016-07-17 6:39 GMT-07:00 Christos Zoulas <[email protected]>:
>
>> On Jul 17, 2:02am, [email protected] (Charles Cui) wrote:
>> -- Subject: Re: updates?
>>
>> | Hi Christos,
>> |
>> | I considered the questions that you asked.
>> | Here is another patch that improves the previous one in terms of error
>> | checking
>> |
>>
>https://github.com/ycui1984/posixtestsuite/blob/master/patches/SIGNAL/0003-improve-error-checking.patch
I think it is better instead of using ret = -1, to set error =
EAGAIN, from the beginning and return 0 for success and error (with
errno) for failure like other kernel functions do.
>-=-=-=-=-=-
What I would do now is write a synthetic test using
sigqueue and sigprocmask to queue a bunch of signals and then release
the mask and test for delivery order. Something like:
int siglist[] = {
SIGINT, SIGSEGV, SIGRTMIN + 2, SIGRTMIN + 1, SIGINT, SIGRTMIN + 1,
SIGRTMIN + 2, ...
};
void
handler(int sig, siginfo_t *info, void *aux) {
/* check signal order and sigval */
}
...
/* block signals you want delivered */
/* setup a handler for the signals you want to deliver */
for (size_t i = 0; i < __arraycount(siglist); i++)
/* queue signals you want to deliver */
/* unblock signals... */
/* pause until all signals have been delivered */
...
I would run this on different OS's to see what they do...
christos