summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2020-10-07 16:31:22 +1100
committerTony Cook <tony@develop-help.com>2020-12-01 15:29:33 +1100
commit680b2c5ee3b53c627074192b3cf14416a24da6ea (patch)
treeeca893a731b7a5530d88b990def603caba525ab8 /pp_sys.c
parent92b3a3ebc05e3ce0e84a1ccff46487ca2200b471 (diff)
downloadperl-680b2c5ee3b53c627074192b3cf14416a24da6ea.tar.gz
Win32: implement symlink() and readlink()
The API used requires Windows Vista or later. The API itself requires either elevated privileges or a sufficiently recent version of Windows 10 running in "Developer Mode", so some tests require updates.
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 5c9f768eaf..8a6445e3e3 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -3774,13 +3774,13 @@ PP(pp_link)
# if defined(HAS_LINK) && defined(HAS_SYMLINK)
/* Both present - need to choose which. */
(op_type == OP_LINK) ?
- PerlLIO_link(tmps, tmps2) : symlink(tmps, tmps2);
+ PerlLIO_link(tmps, tmps2) : PerlLIO_symlink(tmps, tmps2);
# elif defined(HAS_LINK)
/* Only have link, so calls to pp_symlink will have DIE()d above. */
PerlLIO_link(tmps, tmps2);
# elif defined(HAS_SYMLINK)
/* Only have symlink, so calls to pp_link will have DIE()d above. */
- symlink(tmps, tmps2);
+ PerlLIO_symlink(tmps, tmps2);
# endif
}
@@ -3811,7 +3811,7 @@ PP(pp_readlink)
tmps = POPpconstx;
/* NOTE: if the length returned by readlink() is sizeof(buf) - 1,
* it is impossible to know whether the result was truncated. */
- len = readlink(tmps, buf, sizeof(buf) - 1);
+ len = PerlLIO_readlink(tmps, buf, sizeof(buf) - 1);
if (len < 0)
RETPUSHUNDEF;
buf[len] = '\0';