aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2012-05-21 10:36:28 -0700
committerH. Peter Anvin <hpa@zytor.com>2012-05-21 10:40:30 -0700
commit83b7c1b245557bfd86ad5e00f64f1120c443d2a8 (patch)
tree2440ec0d28b99d359a1fb2daf17eaa4b01c51c1b
parent2024ab7832dea5dc004f712ffdf348b8239b8ffa (diff)
downloadklibc-83b7c1b245557bfd86ad5e00f64f1120c443d2a8.tar.gz
[klibc] Add trivial lseek test
Add a trivial lseek test which should at least make it possible to catch parameter marshalling errors when converting to llseek. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--usr/klibc/tests/Kbuild1
-rw-r--r--usr/klibc/tests/lseek.c15
2 files changed, 16 insertions, 0 deletions
diff --git a/usr/klibc/tests/Kbuild b/usr/klibc/tests/Kbuild
index 22b2078f03d1b..d7f1d510b52f7 100644
--- a/usr/klibc/tests/Kbuild
+++ b/usr/klibc/tests/Kbuild
@@ -21,6 +21,7 @@ getoptlong.shared-y := getoptlong.o
getpagesize.shared-y := getpagesize.o
hello.shared-y := hello.o
idtest.shared-y := idtest.o
+lseek.shared-y := lseek.o
malloctest.shared-y := malloctest.o
malloctest2.shared-y := malloctest2.o
memstrtest.shared-y := memstrtest.o
diff --git a/usr/klibc/tests/lseek.c b/usr/klibc/tests/lseek.c
new file mode 100644
index 0000000000000..c4e7f54cf6e68
--- /dev/null
+++ b/usr/klibc/tests/lseek.c
@@ -0,0 +1,15 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+int main(void)
+{
+ int fd = open("test.out", O_RDWR|O_CREAT|O_TRUNC, 0666);
+ off_t rv;
+
+ rv = lseek(fd, 123456789012ULL, SEEK_SET);
+
+ printf("seek to: %lld\n", rv);
+ return 0;
+}