mirror of
https://github.com/urbit/shrub.git
synced 2025-01-05 02:57:18 +03:00
vere: compat: polyfill link() on windows
This commit is contained in:
parent
45d4c5ef68
commit
baf690c85a
@ -134,6 +134,16 @@ int err_win_to_posix(DWORD winerr)
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int link(const char *path1, const char *path2)
|
||||||
|
{
|
||||||
|
if ( CreateHardLinkA(path2, path1, NULL) ) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
errno = err_win_to_posix(GetLastError());
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
// from msys2 mingw-packages-dev patches
|
// from msys2 mingw-packages-dev patches
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#define mkdir(A, B) mkdir(A)
|
#define mkdir(A, B) mkdir(A)
|
||||||
|
|
||||||
|
int link(const char *path1, const char *path2);
|
||||||
char *realpath(const char *path, char *resolved_path);
|
char *realpath(const char *path, char *resolved_path);
|
||||||
int fdatasync(int fd);
|
int fdatasync(int fd);
|
||||||
int utimes(const char *path, const struct timeval times[2]);
|
int utimes(const char *path, const struct timeval times[2]);
|
||||||
|
Loading…
Reference in New Issue
Block a user