bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] tcgetsid: fix cygwin header bug


From: Bruno Haible
Subject: Re: [PATCH] tcgetsid: fix cygwin header bug
Date: Wed, 29 Feb 2012 14:59:57 +0100
User-agent: KMail/4.7.4 (Linux/3.1.0-1.2-desktop; KDE/4.7.4; x86_64; ; )

Hi Eric,

> Cygwin added tcgetsid in 1.7.10, but with int instead of pid_t:
> http://cygwin.com/ml/cygwin-patches/2012-q1/msg00031.html
> For now, since cygwin's pid_t is int, I'm not worrying about
> correcting the return type.
> ...
> diff --git a/lib/termios.in.h b/lib/termios.in.h
> index 85d1c60..3836e2d 100644
> --- a/lib/termios.in.h
> +++ b/lib/termios.in.h
> @@ -32,6 +32,12 @@ extern "C" {
>  }
>  #endif
> 
> +/* On Cygwin 1.7.11, tcgetsid returns int instead of pid_t; at least
> +   they are the same size on that platform.  */
> +#ifdef __CYGWIN__
> +# include <sys/types.h>
> +#endif
> +

I don't understand: what is the need for pid_t here? What was the error
that you got?

Is it needed because Cygwin's termios.h is not self-contained? Then this
should be mentioned in doc/posix-headers/termios.texi.
@item
This header file is not self-contained on some platforms: it requires
@code{<sys/types.h>} to be included first.
Cygwin.

Is it needed to make tests/test-termios.c compile? Then the lack of pid_t
should be mentioned in doc/posix-headers/termios.texi.
@item
The type @code{pid_t} is not defined on some platforms:
Cygwin.

Is it needed for the declaration of tcgetsid? The code earlier in that
file should cope with it:
#if @GNULIB_TCGETSID@
/* Get pid_t.  */
# include <sys/types.h>
#endif

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]