* [PATCH] posix: Set p{read,write}v2 to return ENOTSUP (BZ#21780)
@ 2017-07-17 14:29 Adhemerval Zanella
2017-07-18 11:40 ` John David Anglin
0 siblings, 1 reply; 4+ messages in thread
From: Adhemerval Zanella @ 2017-07-17 14:29 UTC (permalink / raw)
To: libc-alpha; +Cc: John David Anglin
Different than other architectures hppa-linux-gnu define different values
for ENOTSUP and EOPNOTSUPP, where the later is a Linux specific one.
This leads to tst-preadwritev{64}v2 tests failures:
$ ./testrun.sh misc/tst-preadvwritev2
error: tst-preadvwritev2-common.c:35: preadv2 failure did not set errno to ENOTSUP (223)
error: 1 test failures
The straightforward fix is to return the POSIX defined ENOTSUP on all
p{read,write}v{64}v2 implementations intead of Linux specific one.
Checked on x86_64-linux-gnu and the tst-preadwritev{64}v2 on
hppa-linux-gnu (although due the installed kernel on my testing system
the pwritev{64}v2 with an invalid flag still fails due a known kernel
issue [1]).
[BZ #21780]
* sysdeps/posix/preadv2.c (preadv2): Use ENOTSUP instead of
EOPNOTSUPP.
* sysdeps/posix/preadv64v2.c (preadv64v2): Likewise.
* sysdeps/posix/pwritev2.c (pwritev2): Likewise.
* sysdeps/posix/pwritev64v2.c (pwritev64v2): Likewise.
* sysdeps/unix/sysv/linux/preadv2.c (preadv2): Likewise.
* sysdeps/unix/sysv/linux/preadv64v2.c (preadv64v2): Likewise.
* sysdeps/unix/sysv/linux/pwritev2.c (pwritev2): Likewise.
* sysdeps/unix/sysv/linux/pwritev64v2.c (pwritev64v2): Likewise.
[1] https://sourceware.org/ml/libc-alpha/2017-06/msg00726.html
---
ChangeLog | 13 +++++++++++++
sysdeps/posix/preadv2.c | 2 +-
sysdeps/posix/preadv64v2.c | 2 +-
sysdeps/posix/pwritev2.c | 2 +-
sysdeps/posix/pwritev64v2.c | 2 +-
sysdeps/unix/sysv/linux/preadv2.c | 4 ++--
sysdeps/unix/sysv/linux/preadv64v2.c | 4 ++--
sysdeps/unix/sysv/linux/pwritev2.c | 4 ++--
sysdeps/unix/sysv/linux/pwritev64v2.c | 4 ++--
9 files changed, 25 insertions(+), 12 deletions(-)
diff --git a/sysdeps/posix/preadv2.c b/sysdeps/posix/preadv2.c
index 2a7cf11..d27f702 100644
--- a/sysdeps/posix/preadv2.c
+++ b/sysdeps/posix/preadv2.c
@@ -28,7 +28,7 @@ preadv2 (int fd, const struct iovec *vector, int count, OFF_T offset,
{
if (flags != 0)
{
- __set_errno (EOPNOTSUPP);
+ __set_errno (ENOTSUP);
return -1;
}
diff --git a/sysdeps/posix/preadv64v2.c b/sysdeps/posix/preadv64v2.c
index e084f3f..ce7cb40 100644
--- a/sysdeps/posix/preadv64v2.c
+++ b/sysdeps/posix/preadv64v2.c
@@ -25,7 +25,7 @@ preadv64v2 (int fd, const struct iovec *vector, int count, OFF_T offset,
{
if (flags != 0)
{
- __set_errno (EOPNOTSUPP);
+ __set_errno (ENOTSUP);
return -1;
}
diff --git a/sysdeps/posix/pwritev2.c b/sysdeps/posix/pwritev2.c
index 5b7650c..7ec8cbc 100644
--- a/sysdeps/posix/pwritev2.c
+++ b/sysdeps/posix/pwritev2.c
@@ -28,7 +28,7 @@ pwritev2 (int fd, const struct iovec *vector, int count, OFF_T offset,
{
if (flags != 0)
{
- __set_errno (EOPNOTSUPP);
+ __set_errno (ENOTSUP);
return -1;
}
diff --git a/sysdeps/posix/pwritev64v2.c b/sysdeps/posix/pwritev64v2.c
index 0f2f9ef..be98aee 100644
--- a/sysdeps/posix/pwritev64v2.c
+++ b/sysdeps/posix/pwritev64v2.c
@@ -26,7 +26,7 @@ pwritev64v2 (int fd, const struct iovec *vector, int count, OFF_T offset,
{
if (flags != 0)
{
- __set_errno (EOPNOTSUPP);
+ __set_errno (ENOTSUP);
return -1;
}
diff --git a/sysdeps/unix/sysv/linux/preadv2.c b/sysdeps/unix/sysv/linux/preadv2.c
index 11fe85e..137e2dd 100644
--- a/sysdeps/unix/sysv/linux/preadv2.c
+++ b/sysdeps/unix/sysv/linux/preadv2.c
@@ -32,7 +32,7 @@ preadv2 (int fd, const struct iovec *vector, int count, off_t offset,
# ifdef __NR_preadv2
ssize_t result = SYSCALL_CANCEL (preadv2, fd, vector, count,
LO_HI_LONG (offset), flags);
- if (result >= 0 || errno != ENOSYS)
+ if (result >= 0)
return result;
# endif
/* Trying to emulate the preadv2 syscall flags is troublesome:
@@ -46,7 +46,7 @@ preadv2 (int fd, const struct iovec *vector, int count, off_t offset,
if (flags != 0)
{
- __set_errno (EOPNOTSUPP);
+ __set_errno (ENOTSUP);
return -1;
}
return preadv (fd, vector, count, offset);
diff --git a/sysdeps/unix/sysv/linux/preadv64v2.c b/sysdeps/unix/sysv/linux/preadv64v2.c
index 9d7f8c9..8f41325 100644
--- a/sysdeps/unix/sysv/linux/preadv64v2.c
+++ b/sysdeps/unix/sysv/linux/preadv64v2.c
@@ -30,7 +30,7 @@ preadv64v2 (int fd, const struct iovec *vector, int count, off64_t offset,
#ifdef __NR_preadv64v2
ssize_t result = SYSCALL_CANCEL (preadv64v2, fd, vector, count,
LO_HI_LONG (offset), flags);
- if (result >= 0 || errno != ENOSYS)
+ if (result >= 0)
return result;
#endif
/* Trying to emulate the preadv2 syscall flags is troublesome:
@@ -44,7 +44,7 @@ preadv64v2 (int fd, const struct iovec *vector, int count, off64_t offset,
if (flags != 0)
{
- __set_errno (EOPNOTSUPP);
+ __set_errno (ENOTSUP);
return -1;
}
return preadv64 (fd, vector, count, offset);
diff --git a/sysdeps/unix/sysv/linux/pwritev2.c b/sysdeps/unix/sysv/linux/pwritev2.c
index 72f0471..8e5032f 100644
--- a/sysdeps/unix/sysv/linux/pwritev2.c
+++ b/sysdeps/unix/sysv/linux/pwritev2.c
@@ -28,7 +28,7 @@ pwritev2 (int fd, const struct iovec *vector, int count, off_t offset,
# ifdef __NR_pwritev2
ssize_t result = SYSCALL_CANCEL (pwritev2, fd, vector, count,
LO_HI_LONG (offset), flags);
- if (result >= 0 || errno != ENOSYS)
+ if (result >= 0)
return result;
# endif
/* Trying to emulate the pwritev2 syscall flags is troublesome:
@@ -42,7 +42,7 @@ pwritev2 (int fd, const struct iovec *vector, int count, off_t offset,
if (flags != 0)
{
- __set_errno (EOPNOTSUPP);
+ __set_errno (ENOTSUP);
return -1;
}
return pwritev (fd, vector, count, offset);
diff --git a/sysdeps/unix/sysv/linux/pwritev64v2.c b/sysdeps/unix/sysv/linux/pwritev64v2.c
index def9a0b..d2800c6 100644
--- a/sysdeps/unix/sysv/linux/pwritev64v2.c
+++ b/sysdeps/unix/sysv/linux/pwritev64v2.c
@@ -30,7 +30,7 @@ pwritev64v2 (int fd, const struct iovec *vector, int count, off64_t offset,
#ifdef __NR_pwritev64v2
ssize_t result = SYSCALL_CANCEL (pwritev64v2, fd, vector, count,
LO_HI_LONG (offset), flags);
- if (result >= 0 || errno != ENOSYS)
+ if (result >= 0)
return result;
#endif
/* Trying to emulate the pwritev2 syscall flags is troublesome:
@@ -44,7 +44,7 @@ pwritev64v2 (int fd, const struct iovec *vector, int count, off64_t offset,
if (flags != 0)
{
- __set_errno (EOPNOTSUPP);
+ __set_errno (ENOTSUP);
return -1;
}
return pwritev64 (fd, vector, count, offset);
--
2.7.4
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] posix: Set p{read,write}v2 to return ENOTSUP (BZ#21780)
2017-07-17 14:29 [PATCH] posix: Set p{read,write}v2 to return ENOTSUP (BZ#21780) Adhemerval Zanella
@ 2017-07-18 11:40 ` John David Anglin
2017-07-18 19:02 ` Adhemerval Zanella
0 siblings, 1 reply; 4+ messages in thread
From: John David Anglin @ 2017-07-18 11:40 UTC (permalink / raw)
To: Adhemerval Zanella; +Cc: libc-alpha
On 2017-07-17, at 10:29 AM, Adhemerval Zanella wrote:
> Checked on x86_64-linux-gnu and the tst-preadwritev{64}v2 on
> hppa-linux-gnu (although due the installed kernel on my testing system
> the pwritev{64}v2 with an invalid flag still fails due a known kernel
> issue [1]).
>
> [BZ #21780]
> * sysdeps/posix/preadv2.c (preadv2): Use ENOTSUP instead of
> EOPNOTSUPP.
> * sysdeps/posix/preadv64v2.c (preadv64v2): Likewise.
> * sysdeps/posix/pwritev2.c (pwritev2): Likewise.
> * sysdeps/posix/pwritev64v2.c (pwritev64v2): Likewise.
> * sysdeps/unix/sysv/linux/preadv2.c (preadv2): Likewise.
> * sysdeps/unix/sysv/linux/preadv64v2.c (preadv64v2): Likewise.
> * sysdeps/unix/sysv/linux/pwritev2.c (pwritev2): Likewise.
> * sysdeps/unix/sysv/linux/pwritev64v2.c (pwritev64v2): Likewise.
Fixes the st-preadwritev{64}v2 test failures on hppa.
Dave
--
John David Anglin dave.anglin@bell.net
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] posix: Set p{read,write}v2 to return ENOTSUP (BZ#21780)
2017-07-18 11:40 ` John David Anglin
@ 2017-07-18 19:02 ` Adhemerval Zanella
2017-08-08 12:12 ` Adhemerval Zanella
0 siblings, 1 reply; 4+ messages in thread
From: Adhemerval Zanella @ 2017-07-18 19:02 UTC (permalink / raw)
To: John David Anglin; +Cc: libc-alpha
On 18/07/2017 08:40, John David Anglin wrote:
> On 2017-07-17, at 10:29 AM, Adhemerval Zanella wrote:
>
>> Checked on x86_64-linux-gnu and the tst-preadwritev{64}v2 on
>> hppa-linux-gnu (although due the installed kernel on my testing system
>> the pwritev{64}v2 with an invalid flag still fails due a known kernel
>> issue [1]).
>>
>> [BZ #21780]
>> * sysdeps/posix/preadv2.c (preadv2): Use ENOTSUP instead of
>> EOPNOTSUPP.
>> * sysdeps/posix/preadv64v2.c (preadv64v2): Likewise.
>> * sysdeps/posix/pwritev2.c (pwritev2): Likewise.
>> * sysdeps/posix/pwritev64v2.c (pwritev64v2): Likewise.
>> * sysdeps/unix/sysv/linux/preadv2.c (preadv2): Likewise.
>> * sysdeps/unix/sysv/linux/preadv64v2.c (preadv64v2): Likewise.
>> * sysdeps/unix/sysv/linux/pwritev2.c (pwritev2): Likewise.
>> * sysdeps/unix/sysv/linux/pwritev64v2.c (pwritev64v2): Likewise.
>
> Fixes the st-preadwritev{64}v2 test failures on hppa.
Is it ok to push on freeze?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] posix: Set p{read,write}v2 to return ENOTSUP (BZ#21780)
2017-07-18 19:02 ` Adhemerval Zanella
@ 2017-08-08 12:12 ` Adhemerval Zanella
0 siblings, 0 replies; 4+ messages in thread
From: Adhemerval Zanella @ 2017-08-08 12:12 UTC (permalink / raw)
To: John David Anglin; +Cc: libc-alpha
On 18/07/2017 16:02, Adhemerval Zanella wrote:
>
>
> On 18/07/2017 08:40, John David Anglin wrote:
>> On 2017-07-17, at 10:29 AM, Adhemerval Zanella wrote:
>>
>>> Checked on x86_64-linux-gnu and the tst-preadwritev{64}v2 on
>>> hppa-linux-gnu (although due the installed kernel on my testing system
>>> the pwritev{64}v2 with an invalid flag still fails due a known kernel
>>> issue [1]).
>>>
>>> [BZ #21780]
>>> * sysdeps/posix/preadv2.c (preadv2): Use ENOTSUP instead of
>>> EOPNOTSUPP.
>>> * sysdeps/posix/preadv64v2.c (preadv64v2): Likewise.
>>> * sysdeps/posix/pwritev2.c (pwritev2): Likewise.
>>> * sysdeps/posix/pwritev64v2.c (pwritev64v2): Likewise.
>>> * sysdeps/unix/sysv/linux/preadv2.c (preadv2): Likewise.
>>> * sysdeps/unix/sysv/linux/preadv64v2.c (preadv64v2): Likewise.
>>> * sysdeps/unix/sysv/linux/pwritev2.c (pwritev2): Likewise.
>>> * sysdeps/unix/sysv/linux/pwritev64v2.c (pwritev64v2): Likewise.
>>
>> Fixes the st-preadwritev{64}v2 test failures on hppa.
>
> Is it ok to push on freeze?
>
If no one opposes it I will commit it shortly.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-08-08 12:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-17 14:29 [PATCH] posix: Set p{read,write}v2 to return ENOTSUP (BZ#21780) Adhemerval Zanella
2017-07-18 11:40 ` John David Anglin
2017-07-18 19:02 ` Adhemerval Zanella
2017-08-08 12:12 ` Adhemerval Zanella
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).