summaryrefslogtreecommitdiff
path: root/win32/win32.c
AgeCommit message (Collapse)Author
2021-06-23Add parentheses to avoid pointless conditionJeremy Evans
Pointed out by xtkoba (Tee KOBAYASHI). Fixes [Bug #17946] Notes: Merged: https://github.com/ruby/ruby/pull/4575
2021-05-04`_MSC_VER` may not be definedxtkoba
Notes: Merged: https://github.com/ruby/ruby/pull/4453
2021-03-08Increment global variables atomicallyNobuyoshi Nakada
2021-03-08Make vm_exit_handler installation MT-safeNobuyoshi Nakada
2021-03-08Make uenvarea thread exclusiveNobuyoshi Nakada
2021-03-08Make the flag in thread_exclusive uniqueNobuyoshi Nakada
2021-03-08Enclose crtitical sections in `thread_exclusive` blockNobuyoshi Nakada
2021-02-24Revert "Enclose crtitical sections in `thread_exclusive` block"Nobuyoshi Nakada
19cc24b34b0490b7c2779eec521fe0089e05f183 and fixups.
2021-02-23Use the system getenv in setup_debug_logNobuyoshi Nakada
As ruby_set_debug_option() is called before ruby_sysinit(), CRITICAL_SECTIONs are not initialized yet.
2021-02-23Fixed commit miss at 41eb4fbf86e7ae9c9ff993e07a19fa44eb74be9bNobuyoshi Nakada
2021-02-23Make uenvarea thread exclusiveNobuyoshi Nakada
2021-02-23Fixed commit miss at 19cc24b34b0490b7c2779eec521fe0089e05f183Nobuyoshi Nakada
2021-02-23Constified possible dataNobuyoshi Nakada
2021-02-23Enclose crtitical sections in `thread_exclusive` blockNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4214
2021-02-23added mutexes for socket and connection lists on win32Andrew Aladjev
Notes: Merged: https://github.com/ruby/ruby/pull/4212
2021-02-22Expand final path name buffer for namespace prefixNobuyoshi Nakada
As final path name includes the namespace prefix, so expand room for it in path name buffer. Notes: Merged: https://github.com/ruby/ruby/pull/4210
2021-02-20Fixed fallback ENABLE_VIRTUAL_TERMINAL_PROCESSING value [Bug #17639]YO4 (Yoshinao Muramatsu)
2021-02-14Fixed codepage for utime [Bug #17626]xtkoba (Tee KOBAYASHI)
Should use the given codepage argument. Co-Authored-By: Nobuyoshi Nakada <nobu@ruby-lang.org>
2021-01-27win32/win32.c:getcwd_value: delete OBJ_TAINT卜部昌平
Makes no sense any longer. Notes: Merged: https://github.com/ruby/ruby/pull/4100
2020-12-27win32: Removed never used/worked functionsNobuyoshi Nakada
Almost certainly, these have never been used in external extension libraries. If any had, these would have had to be declared in headers.
2020-12-27win32: Declared wait and fixed the return typeNobuyoshi Nakada
2020-12-21Enable escape sequence on Windows10 consoleU.Nakamura
* win32/win32.c (init_stdhandle): enable escape sequence on Windows10 console to show `ruby --help` colors correctly.
2020-12-20win32: Deprecate file CP version functionsNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3948
2020-12-20win32: Added rb_w32_ureaddir only for UTF-8 [Feature #12654]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3948
2020-12-20win32: Use UTF-8 as filesystem encoding [Feature #12654]Nobuyoshi Nakada
Co-Authored-By: Dāvis Mosāns <davispuh@gmail.com> Notes: Merged: https://github.com/ruby/ruby/pull/3948
2020-12-20Revived the getenv macro for dln_find.cNobuyoshi Nakada
This partially reverts commit "Windows: Improve readablity of getenv() encoding" 14453a256d58b11b06d432e2a4388d95aac298d6. The `getenv` macro defined here is to also substitute the function in dln_find.c, not only in this file.
2020-12-08Windows: Read ENV names and values as UTF-8 encoded Strings (#3818)Lars Kanis
* Windows: Read ENV names and values as UTF-8 encoded Strings Implements issue #12650: fix https://bugs.ruby-lang.org/issues/12650 This also removes the special encoding for ENV['PATH'] and some complexity in the code that is unnecessary now. * Windows: Improve readablity of getenv() encoding getenv() did use the expected codepage as an implicit parameter of the macro. This is mis-leading since include/ruby/win32.h has a different definition. Using the "cp" variable explicit (like the other function calls) makes it more readable and consistent. * Windows: Change external C-API macros getenv() and execv() to use UTF-8 They used to process and return strings with locale encoding, but since all ruby-internal spawn and environment functions use UTF-8, it makes sense to change the C-API equally. Notes: Merged-By: nurse <naruse@airemix.jp>
2020-11-28Revived the getenv macro for dln_find.cNobuyoshi Nakada
This partially reverts commit "Windows: Improve readablity of getenv() encoding" 14453a256d58b11b06d432e2a4388d95aac298d6. The `getenv` macro defined here is to also substitute the function in dln_find.c, not only in this file.
2020-11-28Windows: Improve readablity of getenv() encodingLars Kanis
getenv() did use the expected codepage as an implicit parameter of the macro. This is mis-leading since include/ruby/win32.h has a different definition. Using the "cp" variable explicit (like the other function calls) makes it more readable and consistent.
2020-05-11sed -i 's|ruby/impl|ruby/internal|'卜部昌平
To fix build failures. Notes: Merged: https://github.com/ruby/ruby/pull/3079
2020-05-11sed -i s|ruby/3|ruby/impl|g卜部昌平
This shall fix compile errors. Notes: Merged: https://github.com/ruby/ruby/pull/3079
2020-04-08Merge pull request #2991 from shyouhei/ruby.h卜部昌平
Split ruby.h Notes: Merged-By: shyouhei <shyouhei@ruby-lang.org>
2020-03-04[win32] suppress false warning by mingw gccNobuyoshi Nakada
2019-12-26decouple internal.h headers卜部昌平
Saves comitters' daily life by avoid #include-ing everything from internal.h to make each file do so instead. This would significantly speed up incremental builds. We take the following inclusion order in this changeset: 1. "ruby/config.h", where _GNU_SOURCE is defined (must be the very first thing among everything). 2. RUBY_EXTCONF_H if any. 3. Standard C headers, sorted alphabetically. 4. Other system headers, maybe guarded by #ifdef 5. Everything else, sorted alphabetically. Exceptions are those win32-related headers, which tend not be self- containing (headers have inclusion order dependencies). Notes: Merged: https://github.com/ruby/ruby/pull/2711
2019-10-11win32.c: Remove unused calls to StartSockets (#2312)Gabriel Nagy
NtSocketsInitialized behavior changed in e33b1690, requiring a call to rb_w32_sysinit for starting Windows Sockets. This commit removes NtSocketsInitialized entirely to avoid confusion. Signed-off-by: Gabriel Nagy <gabriel.nagy@puppet.com>
2019-09-27Adjusted spaces [ci skip]Nobuyoshi Nakada
2019-08-29drop-in type check for rb_define_method卜部昌平
The rb_define_method function takes a pointer to ANYARGS-ed functions, which in fact varies 18 different prototypes. We still need to preserve ANYARGS for storages but why not check the consistencies if possible. Q&As: Q: Where did the magic number "18" came from in the description above? A: Count the case branch of vm_method.c:call_cfunc_invoker_func(). Note also that the 18 branches has lasted for at least 25 years. See also 200e0ee2fd3c1c006c528874a88f684447215524. Q: What is this __weakref__ thing? A: That is a kind of function overloading mechanism that GCC provides. In this case for instance rb_define_method0 is an alias of rb_define_method, with a strong type. Q: What is this __transparent_union__ thing? A: That is another kind of function overloading mechanism that GCC provides. In this case the attributed function pointer is either VALUE(*)(int,VALUE*,VALUE) or VALUE(*)(int,const VALUE*,VALUE). This is better than void* or ANYARGS because we can reject all other possibilities than the two. Q: What does this rb_define_method macro mean? A: It selects appropriate alias of the rb_define_method function, depending on the arity. Q: Why the prototype change of rb_f_notimplement? A: Function pointer to rb_f_notimplement is special cased in vm_method.c:rb_add_method_cfunc(). That should be handled by the __builtin_choose_expr chain inside of rb_define_method macro expansion. In order to do so, comparison like (func == rb_f_notimplement) is inappropriate for __builtin_choose_expr's expression (which must be a compile-time integer constant but the address of rb_f_notimplement is not fixed until the linker). So instead we are using __builtin_types_compatible_p, and in doing so we need to distinguish rb_f_notimplement from others, by type.
2019-08-27Added license comment [Bug #12230] [ci skip]Nobuyoshi Nakada
2019-08-19* expand tabs. [ci skip]git
2019-08-19Set flag to allow unprivileged users to create symlinks (#2381)Nobuyoshi Nakada
* [Win32] set flag to allow unprivileged users to create symlinks Notes: Merged-By: nobu <nobu@ruby-lang.org>
2019-07-25Fix errno at seeking socket/pipe on WindowsNobuyoshi Nakada
[Bug #12230]
2019-04-30Forgotten to removeNAKAMURA Usaku
2019-04-30Revert previous commit; it was meaninglessNAKAMURA Usaku
2019-04-30* expand tabs.git
2019-04-30Use CreateToolhelp32Snapshot instead of NtQueryInformationProcess to get ↵NAKAMURA Usaku
ppid on Windows Try to get rid of a spec error.
2018-11-22io + socket: make pipes and sockets nonblocking by defaultnormal
All normal Ruby IO methods (IO#read, IO#gets, IO#write, ...) are all capable of appearing to be "blocking" when presented with a file description with the O_NONBLOCK flag set; so there is little risk of incompatibility within Ruby-using programs. The biggest compatibility risk is when spawning external programs. As a result, stdin, stdout, and stderr are now always made blocking before exec-family calls. This change will make an event-oriented MJIT usable if it is waiting on pipes on POSIX_like platforms. It is ALSO necessary to take advantage of (proposed lightweight concurrency (aka "auto-Fiber") or any similar proposal for network concurrency: https://bugs.ruby-lang.org/issues/13618 Named-pipe (FIFO) are NOT yet non-blocking by default since they are rarely-used and may introduce compatibility problems and extra syscall overhead for a common path. Please revert this commit if there are problems and if I am afk since I am afk a lot, lately. [ruby-core:89950] [Bug #14968] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-13win32/win32.c: fix typo in comment [ci skip]k0kubun
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65051 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-13win32/win32.c: I meant FindFreeChildSlot [ci skip]k0kubun
which was formerly used in CreateChild. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-13win32/win32.c: don't call FindChildSlot in MJITk0kubun
worker. It's very likely to be thread-unsafe and so it's better to avoid using in MJIT worker to prevent surprises by race condition. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-12* expand tabs.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e