aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-09-18 13:24:13 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-09-18 13:24:13 -0700
commitd34408d7f800ff9294cfc799e27455ca9618f84e (patch)
tree9460da161f22fbb4de4cbbb92373fc41868b46c7 /tests
parentc72022ee3788281dd764782eb51395e322efb1bc (diff)
parentee9d51029780b6542f3b27ab7071a90e8b9a2577 (diff)
Merge pull request #1628 from michaeljbishop/pread-fix2
Fixes in pread()
Diffstat (limited to 'tests')
-rw-r--r--tests/unistd/io.c6
-rw-r--r--tests/unistd/io.out4
2 files changed, 10 insertions, 0 deletions
diff --git a/tests/unistd/io.c b/tests/unistd/io.c
index 0ff5f4fb..6bf22593 100644
--- a/tests/unistd/io.c
+++ b/tests/unistd/io.c
@@ -104,6 +104,12 @@ int main() {
printf("errno: %d\n\n", errno);
errno = 0;
+ printf("pread past end of file: %d\n", pread(f, readBuffer, sizeof readBuffer, 99999999999));
+ printf("data: %s\n", readBuffer);
+ memset(readBuffer, 0, sizeof readBuffer);
+ printf("errno: %d\n\n", errno);
+ errno = 0;
+
printf("seek: %d\n", lseek(f, 3, SEEK_SET));
printf("errno: %d\n\n", errno);
printf("partial read from file: %d\n", read(f, readBuffer, 3));
diff --git a/tests/unistd/io.out b/tests/unistd/io.out
index 037d0c34..c979557e 100644
--- a/tests/unistd/io.out
+++ b/tests/unistd/io.out
@@ -31,6 +31,10 @@ read from file: 10
data: 1234567890
errno: 0
+pread past end of file: 0
+data:
+errno: 0
+
seek: 3
errno: 0