diff options
author | Lars Kanis <kanis@comcard.de> | 2022-11-17 10:57:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-17 01:57:52 -0800 |
commit | 7b1d23fd295fe8275b313f31ea545f7f6b3f2e62 (patch) | |
tree | 6da8827ada67a79daee059f1228df11eaeb94a5b /file.c | |
parent | 71e668e63383030adc06893d0b16a16e9abdabce (diff) | |
download | ruby-7b1d23fd295fe8275b313f31ea545f7f6b3f2e62.tar.gz |
Windows: Readlink improvements (#6745)
* Windows: Use readlink emulation for File.readlink
This fixes readlink emulation for the ERROR_MORE_DATA case and general error reporting.
It now releases GVL while readlink IO operation.
The dedicated rb_readlink was introduced in commit 2ffb87995a33cdc7ba609a4b867f03f18da0c3b3
in order to improve encoding and buffer allocation.
However the encoding issues are solved since ruby-3.0 switched to UTF-8
and the buffer allocation will be improved in a later commit.
* Windows: Increase the default buffer size for reparse point info
So far nearly all queries of reparse points needed two attempts to get enough buffer.
* Windows: Remove declaration of rb_w32_wreadlink
It was removed in commit 2f6fdd3aebdee2ce04d003b206f6da78120e8235
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -115,6 +115,8 @@ int flock(int, int); # define link(f, t) rb_w32_ulink((f), (t)) # undef unlink # define unlink(p) rb_w32_uunlink(p) +# undef readlink +# define readlink(f, t, l) rb_w32_ureadlink((f), (t), (l)) # undef rename # define rename(f, t) rb_w32_urename((f), (t)) # undef symlink @@ -3152,7 +3154,6 @@ rb_file_s_readlink(VALUE klass, VALUE path) return rb_readlink(path, rb_filesystem_encoding()); } -#ifndef _WIN32 struct readlink_arg { const char *path; char *buf; @@ -3208,7 +3209,6 @@ rb_readlink(VALUE path, rb_encoding *enc) return v; } -#endif #else #define rb_file_s_readlink rb_f_notimplement #endif |