summaryrefslogtreecommitdiff
path: root/proto.h
diff options
context:
space:
mode:
authorJan Dubois <jand@activestate.com>2010-10-25 15:50:27 -0700
committerJan Dubois <jand@activestate.com>2010-10-25 15:59:49 -0700
commit60b22aca14742ead2388ca3c7bb4b542a2d9a4b1 (patch)
tree16381f46b798b66e9e1507ba4aff1c54d2488c7d /proto.h
parent0936ef8b60a303fb904c7a44b7e4f55e8191503c (diff)
downloadperl-60b22aca14742ead2388ca3c7bb4b542a2d9a4b1.tar.gz
Implement DIR* cloning on Windows
There doesn't seem to be a mechanism to clone FileFind handles on Windows. Therefore this implementation just reads all remaining entries into a cache buffer and closes the handle. All further readdir() requests will be fulfilled from the cache buffer, in both the original and the new interpreter. This fixes bug 75154 on Windows (all tests in t/op/threads-dirh.t pass). This commit also changes the return value of win32_telldir() to -1 for directory handles that have been read until the end. The previous return value was (NULL - dirp->start), which technically is not valid C code. API change alert: Perl_dirp_dup() gets an additional CLONE_PARAMS parameter in this change (like all the other Perl_*_dup() functions).
Diffstat (limited to 'proto.h')
-rw-r--r--proto.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/proto.h b/proto.h
index 644286b8b2..c7f40cb63e 100644
--- a/proto.h
+++ b/proto.h
@@ -7162,8 +7162,11 @@ PERL_CALLCONV PERL_CONTEXT* Perl_cx_dup(pTHX_ PERL_CONTEXT* cx, I32 ix, I32 max,
#define PERL_ARGS_ASSERT_CX_DUP \
assert(param)
-PERL_CALLCONV DIR* Perl_dirp_dup(pTHX_ DIR *const dp)
- __attribute__warn_unused_result__;
+PERL_CALLCONV DIR* Perl_dirp_dup(pTHX_ DIR *const dp, CLONE_PARAMS *const param)
+ __attribute__warn_unused_result__
+ __attribute__nonnull__(pTHX_2);
+#define PERL_ARGS_ASSERT_DIRP_DUP \
+ assert(param)
PERL_CALLCONV PerlIO* Perl_fp_dup(pTHX_ PerlIO *const fp, const char type, CLONE_PARAMS *const param)
__attribute__nonnull__(pTHX_3);