[PATCH] bits/waitstatus.h: correctly interpret status 0x007f

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Thu Jul 4 09:43:20 UTC 2013


On 29 June 2013 23:55, Denys Vlasenko <vda.linux at googlemail.com> wrote:
> On Sat, Jun 29, 2013 at 10:12 PM, James Hogan <james.hogan at imgtec.com> wrote:
>>> +/* Nonzero if STATUS indicates the child is stopped.
>>> + * Low byte should be 0x7f and 2nd byte should be nonzero.
>>> + * The condition is true if both bytes have at least one set bit in the same
>>> + * position in bits 0-6, but at least one of 7th bits are clear
>>> + * (because we must not match 0xffff == WCONTINUED).
>>> + */
>>> +#define        __WIFSTOPPED(status)    ((signed char)(((status) >> 8) & (status)) > 0)
>>
>> Sneaky. Of course it would match certain status codes which aren't
>> strictly WIFSTOPPED (e.g. 0x0202, WIFSIGNALED && WTERMSIG==2).
>
> There are many possible invalid combinations.
> They are not supposed to be generated by the kernel, ever.

yea, i guess it's ok to apply, please install.

thanks,


More information about the uClibc mailing list