s4:torture/rpc/epmapper.c: make use of dcerpc_binding_handle stubs
[Samba/gebeck_regimport.git] / tests / ftruncate.c
blobd3e5de3afbe695baaaecb1f0c214401d450ccf78
1 /* test whether ftruncte() can extend a file */
3 #if defined(HAVE_UNISTD_H)
4 #include <unistd.h>
5 #endif
7 #include <sys/types.h>
8 #include <sys/stat.h>
9 #include <fcntl.h>
11 #define DATA "conftest.trunc"
12 #define LEN 7663
14 main()
16 int *buf;
17 int fd = open(DATA,O_RDWR|O_CREAT|O_TRUNC,0666);
19 if (fd == -1) {
20 exit(1);
23 ftruncate(fd, LEN);
25 unlink(DATA);
27 if (lseek(fd, 0, SEEK_END) == LEN) {
28 exit(0);
30 exit(1);