]>
git.proxmox.com Git - libgit2.git/blob - src/posix.h
2 * Copyright (C) 2009-2011 the libgit2 contributors
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.
7 #ifndef INCLUDE_posix_h__
8 #define INCLUDE_posix_h__
14 #define S_IFGITLINK 0160000
15 #define S_ISGITLINK(m) (((m) & S_IFMT) == S_IFGITLINK)
17 #if !defined(O_BINARY)
24 * Standard POSIX Methods
26 * All the methods starting with the `p_` prefix are
27 * direct ports of the standard POSIX methods.
29 * Some of the methods are slightly wrapped to provide
30 * saner defaults. Some of these methods are emulated
31 * in Windows platforns.
33 * Use your manpages to check the docs on these.
37 extern int p_read(git_file fd
, void *buf
, size_t cnt
);
38 extern int p_write(git_file fd
, const void *buf
, size_t cnt
);
40 #define p_fstat(f,b) fstat(f, b)
41 #define p_lseek(f,n,w) lseek(f, n, w)
42 #define p_close(fd) close(fd)
43 #define p_umask(m) umask(m)
45 extern int p_open(const char *path
, int flags
);
46 extern int p_creat(const char *path
, mode_t mode
);
47 extern int p_getcwd(char *buffer_out
, size_t size
);
48 extern int p_rename(const char *from
, const char *to
);
52 #define p_stat(p,b) stat(p, b)
53 #define p_chdir(p) chdir(p)
54 #define p_rmdir(p) rmdir(p)
55 #define p_chmod(p,m) chmod(p, m)
56 #define p_access(p,m) access(p,m)
61 * Platform-dependent methods
64 # include "win32/posix.h"
66 # include "unix/posix.h"