From: Riku Voipio <riku.voipio@iki.fi>
To: Arnaud Patard <arnaud.patard@rtp-net.org>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] linux-user: fix getcwd syscall
Date: Thu, 16 Apr 2009 17:09:12 +0300 [thread overview]
Message-ID: <20090416140912.GG28127@kos.to> (raw)
In-Reply-To: <87ab6ghhrc.fsf@lechat.rtp-net.org>
Hi,
You are right. This is what I get for only checking the manpage.
Acked-By: Riku Voipio <riku.voipio@iki.fi>
On Thu, Apr 16, 2009 at 03:04:23PM +0200, Arnaud Patard wrote:
>
> The patch called "prefer glibc over direct syscalls" (commit 7118) has
> replaced the getcwd syscall with a call to the glibc. With this change,
> the syscall is returning -1 in error case and 0 otherwise.
> This is problematic as the sys_getcwd syscall should return the number
> of bytes written to the buffer including the '\0'.
>
> Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
> ---
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 74b41a8..f5875aa 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -293,7 +293,7 @@ static int sys_getcwd1(char *buf, size_t size)
> /* getcwd() sets errno */
> return (-1);
> }
> - return (0);
> + return strlen(buf)+1;
> }
>
> #ifdef CONFIG_ATFILE
--
"rm -rf" only sounds scary if you don't have backups
next prev parent reply other threads:[~2009-04-16 14:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-16 13:04 [Qemu-devel] linux-user: fix getcwd syscall Arnaud Patard
2009-04-16 14:09 ` Riku Voipio [this message]
2009-04-16 14:17 ` Aurelien Jarno
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=20090416140912.GG28127@kos.to \
--to=riku.voipio@iki.fi \
--cc=arnaud.patard@rtp-net.org \
--cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.