tests: fix false uio.test failures
* tests/uio.c (main): Use descriptor number 0 in pread/pwrite and preadv/pwritev syscalls. * tests/uio.expected: Update regexps. Reported-by: Lennart Sorensen <lsorense@csclub.uwaterloo.ca>
This commit is contained in:
parent
ad25c74f4b
commit
f4d6a0d4e1
18
tests/uio.c
18
tests/uio.c
@ -11,19 +11,19 @@ main(void)
|
|||||||
{
|
{
|
||||||
#if defined(HAVE_PREADV) && defined(HAVE_PWRITEV)
|
#if defined(HAVE_PREADV) && defined(HAVE_PWRITEV)
|
||||||
const off_t offset = 0xdefaceddeadbeefLL;
|
const off_t offset = 0xdefaceddeadbeefLL;
|
||||||
int fd;
|
|
||||||
char buf[4];
|
char buf[4];
|
||||||
struct iovec iov = { buf, sizeof buf };
|
struct iovec iov = { buf, sizeof buf };
|
||||||
|
|
||||||
assert((fd = open("/dev/zero", O_RDONLY)) >= 0);
|
(void) close(0);
|
||||||
assert(pread(fd, buf, sizeof buf, offset) == 4);
|
assert(open("/dev/zero", O_RDONLY) == 0);
|
||||||
assert(preadv(fd, &iov, 1, offset) == 4);
|
assert(pread(0, buf, sizeof buf, offset) == 4);
|
||||||
assert(!close(fd));
|
assert(preadv(0, &iov, 1, offset) == 4);
|
||||||
|
assert(!close(0));
|
||||||
|
|
||||||
assert((fd = open("/dev/null", O_WRONLY)) >= 0);
|
assert(open("/dev/null", O_WRONLY) == 0);
|
||||||
assert(pwrite(fd, buf, sizeof buf, offset) == 4);
|
assert(pwrite(0, buf, sizeof buf, offset) == 4);
|
||||||
assert(pwritev(fd, &iov, 1, offset) == 4);
|
assert(pwritev(0, &iov, 1, offset) == 4);
|
||||||
assert(!close(fd));
|
assert(!close(0));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
pread(64)?\(3, "\\0\\0\\0\\0", 4, 1004211379570065135\) += 4
|
pread(64)?\(0, "\\0\\0\\0\\0", 4, 1004211379570065135\) += 4
|
||||||
preadv\(3, \[{"\\0\\0\\0\\0", 4}\], 1, 1004211379570065135\) += 4
|
preadv\(0, \[{"\\0\\0\\0\\0", 4}\], 1, 1004211379570065135\) += 4
|
||||||
pwrite(64)?\(3, "\\0\\0\\0\\0", 4, 1004211379570065135\) += 4
|
pwrite(64)?\(0, "\\0\\0\\0\\0", 4, 1004211379570065135\) += 4
|
||||||
pwritev\(3, \[{"\\0\\0\\0\\0", 4}\], 1, 1004211379570065135\) += 4
|
pwritev\(0, \[{"\\0\\0\\0\\0", 4}\], 1, 1004211379570065135\) += 4
|
||||||
|
Loading…
x
Reference in New Issue
Block a user