Skip to contentSkip to conversation

preadv/preadv02.c: add new testcase

PATCH New Xiao Yang 2 participants 4 messages Dec 29, 2015 – Jan 27, 2016

lore
Share & tools
lore

Xiao Yang

author
#0 lore raw

PATCH 1/1 preadv/preadv02.c: add new testcase

1) preadv(2) fails if iov_len is invalid and set errno to EINVAL.
2) preadv(2) fails if the vector count is less than zero and set errno to EINVAL.
3) preadv(2) fails if offset is negative and set errno to EINVAL.

---
 runtest/ltplite                             |   1 +
 runtest/stress.part3                        |   1 +
 runtest/syscalls                            |   2 +
 testcases/kernel/syscalls/.gitignore        |   2 +
 testcases/kernel/syscalls/preadv/preadv02.c | 126 ++++++++++++++++++++++++++++
 5 files changed, 132 insertions(+)
 create mode 100644 testcases/kernel/syscalls/preadv/preadv02.c
runtest/ltplite +1 -0
index 1aa93e6..e129c66 100644
@@ -589,6 +589,7 @@ pread02 pread02
 pread03 pread03
 
 preadv01 preadv01
+preadv02 preadv02
 
 profil01 profil01
 
runtest/stress.part3 +1 -0
index 87f42ea..0ed71c0 100644
@@ -499,6 +499,7 @@ pread02 pread02
 pread03 pread03
 
 preadv01 preadv01
+preadv02 preadv02
 
 profil01 profil01
 
runtest/syscalls +2 -0
index 7173f22..e940146 100644
@@ -781,6 +781,8 @@ pread03_64 pread03_64
 
 preadv01 preadv01
 preadv01_64 preadv01_64
+preadv02 preadv02
+preadv02_64 preadv02_64
 
 profil01 profil01
 
testcases/kernel/syscalls/.gitignore +2 -0
index d5f21ef..197f444 100644
@@ -659,6 +659,8 @@
 /pread/pread03_64
 /preadv/preadv01
 /preadv/preadv01_64
+/preadv/preadv02
+/preadv/preadv02_64
 /profil/profil01
 /pselect/pselect01
 /pselect/pselect01_64
testcases/kernel/syscalls/preadv/preadv02.c new file +126 -0

126 lines not on this page · raw message

Signature · 1 line
1.8.3.1
author
#1 lore raw

PATCH 1/1 pwritev/pwritev02.c: add new testcase

1) pwritev(2) fails if iov_len is invalid and set errno to EINVAL.
2) pwritev(2) fails if the vector count is less than zero set errno to EINVAL.
3) pwritev(2) fails if offset is negative and set errno to EINVAL.

---
 runtest/ltplite                               |   1 +
 runtest/stress.part3                          |   1 +
 runtest/syscalls                              |   2 +
 testcases/kernel/syscalls/.gitignore          |   2 +
 testcases/kernel/syscalls/pwritev/pwritev02.c | 126 ++++++++++++++++++++++++++
 5 files changed, 132 insertions(+)
 create mode 100644 testcases/kernel/syscalls/pwritev/pwritev02.c
runtest/ltplite +1 -0
index 1aa93e6..5356cf3 100644
@@ -609,6 +609,7 @@ pwrite02_64 pwrite02_64
 pwrite04_64 pwrite04_64
 
 pwritev01 pwritev01
+pwritev02 pwritev02
 
 read01 read01
 read02 read02
runtest/stress.part3 +1 -0
index 87f42ea..68bacff 100644
@@ -518,6 +518,7 @@ pwrite02_64 pwrite02_64
 pwrite04_64 pwrite04_64
 
 pwritev01 pwritev01
+pwritev02 pwritev02
 
 read01 read01
 read02 read02
runtest/syscalls +2 -0
index 7173f22..9158f39 100644
@@ -815,6 +815,8 @@ pwrite04_64 pwrite04_64
 
 pwritev01 pwritev01
 pwritev01_64 pwritev01_64
+pwritev02 pwritev02
+pwritev02_64 pwritev02_64
 
 quotactl01 quotactl01
 quotactl02 quotactl02
testcases/kernel/syscalls/.gitignore +2 -0
index d5f21ef..423ad55 100644
@@ -680,6 +680,8 @@
 /pwrite/pwrite04_64
 /pwritev/pwritev01
 /pwritev/pwritev01_64
+/pwritev/pwritev02
+/pwritev/pwritev02_64
 /quotactl/quotactl01
 /quotactl/quotactl02
 /read/read01
testcases/kernel/syscalls/pwritev/pwritev02.c new file +126 -0

126 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#2 lore raw

PATCH 1/1 pwritev/pwritev02.c: add new testcase

Hi!
Both pushed, thanks.

BTW: both preadv() and pwritev() can also fail with errors specified for
read() and write(), so we should, get EBADFD if fd is invalid or not open for reading/writing for read/write, etc.

Signature · 2 lines
Cyril Hrubis
[email protected]
author
#3 lore raw

PATCH 1/1 pwritev/pwritev02.c: add new testcase

? 2016/01/27 0:38, Cyril Hrubis ??:

Quoted 6 lines

Hi!
Both pushed, thanks.

BTW: both preadv() and pwritev() can also fail with errors specified for
read() and write(), so we should, get EBADFD if fd is invalid or not open for reading/writing for read/write, etc.

Thanks for your suggestion. I will send patches to test other errors.