summaryrefslogtreecommitdiffstats
path: root/src/kmk/kbuildprf.c
blob: 9fb4b9773c497eafa0ef31c8a85801e74aabe636 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include <stdio.h>
#include <io.h>
#include <errno.h>
#include <Windows.h>

__int64 prf_now(void)
{
    return GetTickCount();
}

#undef open
int prf_open(const char *name, int of, int mask)
{
    int fd;
//    int err;
//    __int64 t = prf_now();
    fd = _open(name, of, mask);
//    err = errno;
//    t = prf_now() - t;
//    fprintf(stderr, "open(%s, %#x) -> %d/%d in %lu\n", name, of, fd, err, (long)t);
//    errno = err;
    return fd;
}

#undef close
int prf_close(int fd)
{
    int rc;
    rc = _close(fd);
    return rc;
}


#undef read
int prf_read(int fd, void *buf, long cb)
{
    int cbRead;
    cbRead = _read(fd, buf, cb);
    return cbRead;
}

#undef lseek
long prf_lseek(int fd, long off, int whence)
{
    long rc;
    rc = _lseek(fd, off, whence);
    return rc;
}