From: Florian Weimer <fw@deneb.enyo.de>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH v2 1/2] manual: Add preadv and pwritev documentation
Date: Thu, 04 May 2017 12:51:00 -0000 [thread overview]
Message-ID: <87fugk6b0m.fsf@mid.deneb.enyo.de> (raw)
In-Reply-To: <1493901791-13438-1-git-send-email-adhemerval.zanella@linaro.org> (Adhemerval Zanella's message of "Thu, 4 May 2017 09:43:10 -0300")
* Adhemerval Zanella:
> +@comment sys/uio.h
> +@comment BSD
> +@deftypefun ssize_t pwritev (int @var{fd}, const struct iovec *@var{iov}, int @var{iovcnt}, off_t @var{offset})
> +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
> +@c This is a syscall for Linux 3.2 for all architectures but microblaze
> +@c (which was added on 3.15). The sysdeps/posix fallback emulation
> +@c is also MT-Safe since it calls pwrite, and it is now a syscall on all
> +@c targets.
> +
> +This function is similar to the @code{writev} function, with the difference
> +it adds an extra @var{offset} parameter of type @code{off_t} similar to
> +@code{pwrite}. The data is written to the file starting at position
> +@var{offset}. The position of the file descriptor itself is not affected
> +by the operation. The value is the same as before the call.
This description is incorrect for O_APPEND descriptors. pwrite
ignores the offset for them, and so does pwritev. Maybe you can fix
pwrite as well in this commit?
(The GNU implementation is not POSIX-conforming, probably because the
POSIX specification introduces a security hole.)
> +When the source file is compiled with @code{_FILE_OFFSET_BITS == 64} the
> +@code{pwritev} function is in fact @code{pwritev64} and the type
> +@code{off_t} has 64 bits, which makes it possible to handle files up to
> +@twoexp{63} bytes in length.
> +
> +The return value is a count of bytes (@emph{not} buffers) written, @math{0}
> +indicating end-of-file, or @math{-1} indicating an error. The possible
> +errors are the same as in @code{writev} and @code{pwrite}.
The end-of-file part does not make sense here. I don't know what the
out-of-space behavior of our implementation is (could be 0, could be
ENOSPC).
next prev parent reply other threads:[~2017-05-04 12:51 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-04 12:43 Adhemerval Zanella
2017-05-04 12:43 ` [PATCH v3 2/2] posix: Implement preadv2 and pwritev2 Adhemerval Zanella
2017-05-11 19:02 ` Adhemerval Zanella
2017-05-30 14:19 ` Adhemerval Zanella
2017-05-31 18:51 ` Adhemerval Zanella
2017-06-01 16:40 ` Siddhesh Poyarekar
2017-06-01 18:14 ` Adhemerval Zanella
2017-06-02 13:00 ` H.J. Lu
2017-06-02 13:04 ` Zack Weinberg
2017-06-02 13:34 ` Florian Weimer
2017-06-02 14:07 ` Adhemerval Zanella
2017-06-02 14:22 ` Zack Weinberg
2017-06-02 18:20 ` Adhemerval Zanella
2017-06-02 19:02 ` Florian Weimer
2017-06-02 19:46 ` Adhemerval Zanella
2017-06-03 1:47 ` H.J. Lu
2017-06-03 8:22 ` Andreas Schwab
2017-06-03 11:04 ` H.J. Lu
2017-06-03 11:23 ` Florian Weimer
2017-06-03 11:27 ` H.J. Lu
2017-06-03 11:29 ` H.J. Lu
2017-06-03 12:52 ` Andreas Schwab
2017-06-03 12:57 ` H.J. Lu
2017-06-03 13:48 ` Zack Weinberg
2017-06-03 13:52 ` H.J. Lu
2017-06-03 13:58 ` Zack Weinberg
2017-06-03 14:16 ` H.J. Lu
2017-06-03 15:28 ` Andreas Schwab
2017-06-04 13:42 ` H.J. Lu
2017-06-04 15:03 ` Zack Weinberg
2017-06-05 13:37 ` Adhemerval Zanella
2017-06-02 13:04 ` Tulio Magno Quites Machado Filho
2017-06-02 14:04 ` Adhemerval Zanella
2017-05-04 12:51 ` Florian Weimer [this message]
2017-05-04 13:47 ` [PATCH v2 1/2] manual: Add preadv and pwritev documentation Adhemerval Zanella
2017-05-04 18:46 ` Adhemerval Zanella
2017-05-04 18:46 ` Florian Weimer
2017-05-04 18:53 ` Adhemerval Zanella
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=87fugk6b0m.fsf@mid.deneb.enyo.de \
--to=fw@deneb.enyo.de \
--cc=adhemerval.zanella@linaro.org \
--cc=libc-alpha@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).