From: Corinna Vinschen <vinschen@redhat.com>
To: newlib@sourceware.org
Subject: Re: [PATCH] Cygwin: signal.cc: Include <unistd.h>
Date: Thu, 12 May 2022 10:14:08 +0200 [thread overview]
Message-ID: <YnzB0NTu2ZA25W8i@calimero.vinschen.de> (raw)
In-Reply-To: <20220512064332.23298-1-sebastian.huber@embedded-brains.de>
Hi Sebastian,
On May 12 08:43, Sebastian Huber wrote:
> Include <unistd.h> for sleep() and usleep() declarations. Fix return type of
> usleep().
> ---
> winsup/cygwin/signal.cc | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/winsup/cygwin/signal.cc b/winsup/cygwin/signal.cc
> index 9b6c2509d..22d3715df 100644
> --- a/winsup/cygwin/signal.cc
> +++ b/winsup/cygwin/signal.cc
> @@ -11,6 +11,7 @@ details. */
>
> #include "winsup.h"
> #include <stdlib.h>
> +#include <unistd.h>
> #include <sys/cygwin.h>
> #include <sys/signalfd.h>
> #include "pinfo.h"
> @@ -163,7 +164,7 @@ nanosleep (const struct timespec *rqtp, struct timespec *rmtp)
> return 0;
> }
>
> -extern "C" unsigned int
> +unsigned int
Why are you dropping the extern "C" here? It's not really necessary at
this point, but all functions in C++ files exported to the userspace are
marked this way.
> sleep (unsigned int seconds)
> {
> struct timespec req, rem;
> @@ -174,7 +175,7 @@ sleep (unsigned int seconds)
> return 0;
> }
>
> -extern "C" unsigned int
> +int
> usleep (useconds_t useconds)
Good catch, otherwise, thank you! I'd prefer if you push just the
type change and keep the extern "C" as a marker for exported functions.
Thanks,
Corinna
next prev parent reply other threads:[~2022-05-12 8:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-12 6:43 Sebastian Huber
2022-05-12 8:14 ` Corinna Vinschen [this message]
2022-05-12 8:22 ` Sebastian Huber
2022-05-12 8:46 ` Corinna Vinschen
2022-05-12 14:48 ` Brian Inglis
2022-05-12 16:05 ` Corinna Vinschen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YnzB0NTu2ZA25W8i@calimero.vinschen.de \
--to=vinschen@redhat.com \
--cc=newlib@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).