| Line |  | 
|---|
| 1 | #include <stdio.h> | 
|---|
| 2 | #include <io.h> | 
|---|
| 3 | #include <errno.h> | 
|---|
| 4 | #include <Windows.h> | 
|---|
| 5 |  | 
|---|
| 6 | __int64 prf_now(void) | 
|---|
| 7 | { | 
|---|
| 8 | return GetTickCount(); | 
|---|
| 9 | } | 
|---|
| 10 |  | 
|---|
| 11 | #undef open | 
|---|
| 12 | int prf_open(const char *name, int of, int mask) | 
|---|
| 13 | { | 
|---|
| 14 | int fd; | 
|---|
| 15 | //    int err; | 
|---|
| 16 | //    __int64 t = prf_now(); | 
|---|
| 17 | fd = _open(name, of, mask); | 
|---|
| 18 | //    err = errno; | 
|---|
| 19 | //    t = prf_now() - t; | 
|---|
| 20 | //    fprintf(stderr, "open(%s, %#x) -> %d/%d in %lu\n", name, of, fd, err, (long)t); | 
|---|
| 21 | //    errno = err; | 
|---|
| 22 | return fd; | 
|---|
| 23 | } | 
|---|
| 24 |  | 
|---|
| 25 | #undef close | 
|---|
| 26 | int prf_close(int fd) | 
|---|
| 27 | { | 
|---|
| 28 | int rc; | 
|---|
| 29 | rc = _close(fd); | 
|---|
| 30 | return rc; | 
|---|
| 31 | } | 
|---|
| 32 |  | 
|---|
| 33 |  | 
|---|
| 34 | #undef read | 
|---|
| 35 | int prf_read(int fd, void *buf, long cb) | 
|---|
| 36 | { | 
|---|
| 37 | int cbRead; | 
|---|
| 38 | cbRead = _read(fd, buf, cb); | 
|---|
| 39 | return cbRead; | 
|---|
| 40 | } | 
|---|
| 41 |  | 
|---|
| 42 | #undef lseek | 
|---|
| 43 | long prf_lseek(int fd, long off, int whence) | 
|---|
| 44 | { | 
|---|
| 45 | long rc; | 
|---|
| 46 | rc = _lseek(fd, off, whence); | 
|---|
| 47 | return rc; | 
|---|
| 48 | } | 
|---|
| 49 |  | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.