| Last change
 on this file since 621 was             206, checked in by Herwig Bauernfeind, 16 years ago | 
        
          | 
Import Samba 3.3 branch at 3.0.0 level (psmedley's port)
 | 
        
          | File size:
            390 bytes | 
      
      
| Line |  | 
|---|
| 1 | /* test whether ftruncte() can extend a file */ | 
|---|
| 2 |  | 
|---|
| 3 | #if defined(HAVE_UNISTD_H) | 
|---|
| 4 | #include <unistd.h> | 
|---|
| 5 | #endif | 
|---|
| 6 |  | 
|---|
| 7 | #include <sys/types.h> | 
|---|
| 8 | #include <sys/stat.h> | 
|---|
| 9 | #include <fcntl.h> | 
|---|
| 10 |  | 
|---|
| 11 | #define DATA "conftest.trunc" | 
|---|
| 12 | #define LEN 7663 | 
|---|
| 13 |  | 
|---|
| 14 | main() | 
|---|
| 15 | { | 
|---|
| 16 | int *buf; | 
|---|
| 17 | int fd = open(DATA,O_RDWR|O_CREAT|O_TRUNC,0666); | 
|---|
| 18 |  | 
|---|
| 19 | ftruncate(fd, LEN); | 
|---|
| 20 |  | 
|---|
| 21 | unlink(DATA); | 
|---|
| 22 |  | 
|---|
| 23 | if (lseek(fd, 0, SEEK_END) == LEN) { | 
|---|
| 24 | exit(0); | 
|---|
| 25 | } | 
|---|
| 26 | exit(1); | 
|---|
| 27 | } | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.