public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: Florian Weimer <fweimer@redhat.com>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH] Implement the mlock2 function
Date: Mon, 27 Nov 2017 16:35:00 -0000	[thread overview]
Message-ID: <61bf1cb7-a45d-0b61-3fcf-e0585901191d@linaro.org> (raw)
In-Reply-To: <f8f6026b-65fe-a73b-35b5-997c66496465@redhat.com>



On 27/11/2017 14:07, Florian Weimer wrote:
> On 11/27/2017 02:11 PM, Adhemerval Zanella wrote:
>> This is a reasonable approach and I am ok with this patch with the
>> INLINE_SYSCALL_CALL change. I wonder if it is worth to add a similar
>> change to p{read,write}v2 to return ENOSUP in the case of ENOSYS.
> 
> My copy of the manual page says that EINVAL is used there as well.
> 
> Thanks,
> Florian

Indeed manpages [1] states that EINVAL is returned, but our documentation
states otherwise:

manual/llio.texi

1286 @item EOPNOTSUPP
1287 
1288 @c The default sysdeps/posix code will return it for any flags value
1289 @c different than 0.
1290 An unsupported @var{flags} was used.

Also, "tst-preadvwritev" on a 4.13.0-17-generic indeed generates Linux
EOPNOTSUPP (ENOSUP):

[pid  7896] preadv2(3,  <unfinished ...>
[pid  7895] <... rt_sigaction resumed> {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
[pid  7896] <... preadv2 resumed> [{iov_base=0x7ffca77846d0, iov_len=32}], 1, 0, 0x10 /* RWF_??? */) = -1 EOPNOTSUPP (Operation not supported)
[pid  7895] wait4(7896,  <unfinished ...>
[pid  7896] pwritev2(3, [{iov_base="\0\0\0\0\0\0\0\0\241H\363?\244\177\0\0@Gx\247\374\177\0\0\0\0\0\0\0\0\0\0", iov_len=32}], 1, 0, 0x10 /* RWF_??? */) = -1 EOPNOTSUPP (Operation not supported)

So I think it would be worth to change p{read,write}v2 on GLIBC to 
return EINVAL for invalid flags. I will prepare a patch.

[1] http://man7.org/linux/man-pages/man2/preadv2.2.html

  reply	other threads:[~2017-11-27 16:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-24 16:59 Florian Weimer
2017-11-24 17:02 ` Joseph Myers
2017-11-24 17:09   ` Florian Weimer
2017-11-24 17:24 ` Adhemerval Zanella
2017-11-24 19:20   ` Florian Weimer
2017-11-27 13:12     ` Adhemerval Zanella
2017-11-27 16:07       ` Florian Weimer
2017-11-27 16:35         ` Adhemerval Zanella [this message]
2017-11-27 16:43           ` Florian Weimer
2017-11-27 18:40             ` Adhemerval Zanella
2017-11-27 18:46               ` Florian Weimer
2017-11-28 13:38                 ` Adhemerval Zanella
2017-11-27  9:25 ` Rical Jasan
2017-11-27 10:25   ` Florian Weimer

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=61bf1cb7-a45d-0b61-3fcf-e0585901191d@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=fweimer@redhat.com \
    --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).