]> git.proxmox.com Git - libgit2.git/blame - src/util/win32/posix.h
Merge https://salsa.debian.org/debian/libgit2 into proxmox/bullseye
[libgit2.git] / src / util / win32 / posix.h
CommitLineData
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 */
eae0bfdc
PP
7#ifndef INCLUDE_win32_posix_h__
8#define INCLUDE_win32_posix_h__
f79026b4 9
ad5611d8 10#include "git2_util.h"
3948e862 11#include "../posix.h"
35439f59 12#include "win32-compat.h"
cceae9a2 13#include "path_w32.h"
11d51ca6 14#include "utf-conv.h"
345b6307 15#include "dir.h"
f79026b4 16
d5e6ca1e 17extern unsigned long git_win32__createfile_sharemode;
7ece9065 18extern int git_win32__retries;
d5e6ca1e 19
2f795d8f 20typedef SOCKET GIT_SOCKET;
238b7614 21
2f795d8f 22#define p_lseek(f,n,w) _lseeki64(f, n, w)
c4d23928
ET
23
24extern int p_fstat(int fd, struct stat *buf);
2f795d8f 25extern int p_lstat(const char *file_name, struct stat *buf);
c25aa7cd 26extern int p_stat(const char *path, struct stat *buf);
f79026b4 27
35439f59
ET
28extern int p_utimes(const char *filename, const struct p_timeval times[2]);
29extern int p_futimes(int fd, const struct p_timeval times[2]);
121c3171 30
07d03d31
JG
31extern int p_readlink(const char *path, char *buf, size_t bufsiz);
32extern int p_symlink(const char *old, const char *new);
2f795d8f 33extern int p_link(const char *old, const char *new);
f79026b4 34extern int p_unlink(const char *path);
2f795d8f 35extern int p_mkdir(const char *path, mode_t mode);
07d03d31 36extern int p_fsync(int fd);
19ac1ed7 37extern char *p_realpath(const char *orig_path, char *buffer);
07d03d31
JG
38
39extern int p_recv(GIT_SOCKET socket, void *buffer, size_t length, int flags);
40extern int p_send(GIT_SOCKET socket, const void *buffer, size_t length, int flags);
c25aa7cd 41extern int p_inet_pton(int af, const char *src, void* dst);
07d03d31 42
2fc78e70 43extern int p_vsnprintf(char *buffer, size_t count, const char *format, va_list argptr);
84dd3820 44extern int p_snprintf(char *buffer, size_t count, const char *format, ...) GIT_FORMAT_PRINTF(3, 4);
c25aa7cd
PP
45extern int p_chdir(const char *path);
46extern int p_chmod(const char *path, mode_t mode);
47extern int p_rmdir(const char *path);
48extern int p_access(const char *path, mode_t mode);
22a2d3d5 49extern int p_ftruncate(int fd, off64_t size);
2f795d8f 50
cccacac5
RB
51/* p_lstat is almost but not quite POSIX correct. Specifically, the use of
52 * ENOTDIR is wrong, in that it does not mean precisely that a non-directory
53 * entry was encountered. Making it correct is potentially expensive,
54 * however, so this is a separate version of p_lstat to use when correct
55 * POSIX ENOTDIR semantics is required.
56 */
57extern int p_lstat_posixly(const char *filename, struct stat *buf);
58
1920ee4e
W
59extern struct tm * p_localtime_r(const time_t *timer, struct tm *result);
60extern struct tm * p_gmtime_r(const time_t *timer, struct tm *result);
61
f79026b4 62#endif