]>
Commit | Line | Data |
---|---|---|
bb742ede | 1 | /* |
359fc2d2 | 2 | * Copyright (C) the libgit2 contributors. All rights reserved. |
bb742ede VM |
3 | * |
4 | * This file is part of libgit2, distributed under the GNU GPL v2 with | |
5 | * a Linking Exception. For full terms see the included COPYING file. | |
6 | */ | |
529c3715 JG |
7 | #ifndef INCLUDE_posix__unix_h__ |
8 | #define INCLUDE_posix__unix_h__ | |
f79026b4 | 9 | |
6fb1c0b4 | 10 | #include <stdio.h> |
e40f1c2d | 11 | #include <sys/param.h> |
6fb1c0b4 | 12 | |
2f795d8f JG |
13 | typedef int GIT_SOCKET; |
14 | #define INVALID_SOCKET -1 | |
15 | ||
16 | #define p_strcasecmp(s1, s2) strcasecmp(s1, s2) | |
17 | #define p_strncasecmp(s1, s2, c) strncasecmp(s1, s2, c) | |
18 | ||
19 | #define p_lseek(f,n,w) lseek(f, n, w) | |
20 | #define p_fstat(f,b) fstat(f, b) | |
f79026b4 | 21 | #define p_lstat(p,b) lstat(p,b) |
2f795d8f | 22 | |
f79026b4 | 23 | #define p_readlink(a, b, c) readlink(a, b, c) |
ca1b6e54 | 24 | #define p_symlink(o,n) symlink(o, n) |
f79026b4 VM |
25 | #define p_link(o,n) link(o, n) |
26 | #define p_unlink(p) unlink(p) | |
27 | #define p_mkdir(p,m) mkdir(p, m) | |
28 | #define p_fsync(fd) fsync(fd) | |
662f90e6 | 29 | extern char *p_realpath(const char *, char *); |
67fcac56 | 30 | |
2f795d8f JG |
31 | #define p_recv(s,b,l,f) recv(s,b,l,f) |
32 | #define p_send(s,b,l,f) send(s,b,l,f) | |
33 | #define p_inet_pton(a, b, c) inet_pton(a, b, c) | |
34 | ||
2fc78e70 | 35 | #define p_vsnprintf(b, c, f, a) vsnprintf(b, c, f, a) |
84dd3820 | 36 | #define p_snprintf(b, c, f, ...) snprintf(b, c, f, __VA_ARGS__) |
f978b748 | 37 | #define p_mkstemp(p) mkstemp(p) |
2f795d8f JG |
38 | #define p_stat(p,b) stat(p, b) |
39 | #define p_chdir(p) chdir(p) | |
40 | #define p_chmod(p,m) chmod(p, m) | |
41 | #define p_rmdir(p) rmdir(p) | |
42 | #define p_access(p,m) access(p,m) | |
43 | #define p_ftruncate(fd, sz) ftruncate(fd, sz) | |
f79026b4 | 44 | |
cccacac5 RB |
45 | /* see win32/posix.h for explanation about why this exists */ |
46 | #define p_lstat_posixly(p,b) lstat(p,b) | |
47 | ||
2f795d8f JG |
48 | #define p_localtime_r(c, r) localtime_r(c, r) |
49 | #define p_gmtime_r(c, r) gmtime_r(c, r) | |
50 | ||
f79026b4 | 51 | #endif |