[PATCH] Allow usage of union wait for wait() functions and macros

Eric Blake eblake@redhat.com
Wed Oct 5 13:55:00 GMT 2011

On 10/05/2011 04:57 AM, Christian Franke wrote:
> The file include/sys/wait.h provides union wait but neither the wait()
> functions nor the W*() macros allow to actually use it. Compilation of
> cdrkit 1.1.11 fails because the configure check assumes that union wait
> is the status parameter type if its declaration exists.
> The attached patch fixes this. It uses GCC extensions for C and
> overloading for C++. Works also with the old Cygwin gcc-3.

> +/* Will be redefined in sys/wait.h.  */
> +#define __wait_status_to_int(w)  (w)
> +
>   /* A status looks like:
>         <2 bytes info>  <2 bytes code>

As long as you're touching this code, fix this incorrect comment.

A status is 16 bits, and looks like:
   <1 byte info> <1 byte code>

Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

More information about the Cygwin-patches mailing list