[PATCH v2 1/3] Posix asynchronous I/O support: aio files
Brian Inglis
Brian.Inglis@SystematicSw.ab.ca
Wed May 2 18:11:00 GMT 2018
On 2018-05-02 02:21, Mark Geisert wrote:
> I found a discrepancy in the Cygwin source tree and would like input on how to
> resolve it...
> On Thu, 19 Apr 2018, Corinna Vinschen wrote:
>>> +static void
>>> +aionotify (struct aiocb *aio)
>>> +{
>>> +Â /* if signal notification wanted, send AIO-complete signal */
>>> +Â //XXX Is sigqueue() the best way to send signo+value within same process?
>>> +Â if (aio->aio_sigevent.sigev_notify == SIGEV_SIGNAL)
>>> +Â Â Â sigqueue (mypid,
>>> +Â Â Â Â Â Â Â Â Â Â Â Â Â aio->aio_sigevent.sigev_signo,
>>> +Â Â Â Â Â Â Â Â Â Â Â Â Â aio->aio_sigevent.sigev_value);
>> Given you have direct access to pinfo, you can just as well call
>> sig_send (myself, ...). This also drop the requirement to know your pid.
> While making the change from sigqueue() to sig_send() I was researching
> siginfo_t, and I found that the values for element si_code in Cygwin's
> /usr/include/sys/signal.h...
> /* Signal Actions, P1003.1b-1993, p. 64 */
> /* si_code values, p. 66 */
> #define SI_USERÂ Â Â 1Â /* Sent by a user. kill(), abort(), etc */
> #define SI_QUEUEÂ Â 2Â /* Sent by sigqueue() */
> #define SI_TIMERÂ Â 3Â /* Sent by expiration of a timer_settime() timer */
> #define SI_ASYNCIO 4Â /* Indicates completion of asycnhronous IO */
> #define SI_MESGQÂ Â 5Â /* Indicates arrival of a message at an empty queue */
> ...are inconsistent with the enum values in internal file
> winsup/cygwin/include/cygwin/signal.h...
> enum
> {
>  SI_USER = 0,        /* sent by kill, raise, pthread_kill */
>  SI_ASYNCIO = 2,     /* sent by AIO completion (currently unimplemented) */
>  SI_MESGQ,           /* sent by real time mesq state change
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â (currently unimplemented) */
>  SI_TIMER,           /* sent by timer expiration */
>  SI_QUEUE,           /* sent by sigqueue */
>  SI_KERNEL,          /* sent by system */
>
>  ILL_ILLOPC,         /* illegal opcode */
>  ILL_ILLOPN,         /* illegal operand */
> Â [...]
> };
> I figure it's the /usr/include/sys/signal.h defines that should be changed,
> given that Posix doesn't specify values but only the names of the values. And
> the winsup* enum values are the ones used internally so should likely not be
> changed.
> Does this sound like the right way to go?
The other values appear to be used by non-Cygwin newlib implementations
bracketed by:
#if defined(__CYGWIN__)
#include <cygwin/signal.h>
#else
... 100+ lines
#endif /* defined(__CYGWIN__) */
and, if that was required, should be changed via the newlib list.
--
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada
More information about the Cygwin-patches
mailing list