From 64578c0589a3a741f81fb55c16eeb882128da00b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 29 Jul 1998 03:08:05 +0000 Subject: merge from the autoconf2 branch to the main branch (This used to be commit 3bda7ac417107a7b01d91805ca71c4330657ed21) --- source3/tests/ftruncate.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 source3/tests/ftruncate.c (limited to 'source3/tests/ftruncate.c') diff --git a/source3/tests/ftruncate.c b/source3/tests/ftruncate.c new file mode 100644 index 0000000000..8d5e8942e3 --- /dev/null +++ b/source3/tests/ftruncate.c @@ -0,0 +1,24 @@ +/* test whether ftruncte() can extend a file */ + +#include +#include +#include +#include + +#define DATA "conftest.trunc" +#define LEN 7663 + +main() +{ + int *buf; + int fd = open(DATA,O_RDWR|O_CREAT|O_TRUNC,0666); + + ftruncate(fd, LEN); + + unlink(DATA); + + if (lseek(fd, 0, SEEK_END) == LEN) { + exit(0); + } + exit(1); +} -- cgit