Skip to content

Commit 26f50ef

Browse files
committed
Merge branch 'js/symlink-windows'
Upstream symbolic link support on Windows from Git-for-Windows. * js/symlink-windows: mingw: special-case index entries for symlinks with buggy size mingw: emulate `stat()` a little more faithfully mingw: try to create symlinks without elevated permissions mingw: add support for symlinks to directories mingw: implement basic `symlink()` functionality (file symlinks only) mingw: implement `readlink()` mingw: allow `mingw_chdir()` to change to symlink-resolved directories mingw: support renaming symlinks mingw: handle symlinks to directories in `mingw_unlink()` mingw: add symlink-specific error codes mingw: change default of `core.symlinks` to false mingw: factor out the retry logic mingw: compute the correct size for symlinks in `mingw_lstat()` mingw: teach dirent about symlinks mingw: let `mingw_lstat()` error early upon problems with reparse points mingw: drop the separate `do_lstat()` function mingw: implement `stat()` with symlink support mingw: don't call `GetFileAttributes()` twice in `mingw_lstat()`
2 parents f2e92f7 + 44af34b commit 26f50ef

5 files changed

Lines changed: 507 additions & 156 deletions

File tree

compat/mingw-posix.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,6 @@ struct utsname {
121121
* trivial stubs
122122
*/
123123

124-
static inline int readlink(const char *path UNUSED, char *buf UNUSED, size_t bufsiz UNUSED)
125-
{ errno = ENOSYS; return -1; }
126-
static inline int symlink(const char *oldpath UNUSED, const char *newpath UNUSED)
127-
{ errno = ENOSYS; return -1; }
128124
static inline int fchmod(int fildes UNUSED, mode_t mode UNUSED)
129125
{ errno = ENOSYS; return -1; }
130126
#ifndef __MINGW64_VERSION_MAJOR
@@ -197,6 +193,8 @@ int setitimer(int type, struct itimerval *in, struct itimerval *out);
197193
int sigaction(int sig, struct sigaction *in, struct sigaction *out);
198194
int link(const char *oldpath, const char *newpath);
199195
int uname(struct utsname *buf);
196+
int symlink(const char *target, const char *link);
197+
int readlink(const char *path, char *buf, size_t bufsiz);
200198

201199
/*
202200
* replacements of existing functions

0 commit comments

Comments
 (0)