summaryrefslogtreecommitdiffstats
path: root/drivers/unix/os_unix.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add OS::is_process_running function.mdavisprog2022-05-031-0/+9
| | | | | | | | Adds the is_process_running function to the native OS class and exposes it to script. This is implemented on Windows and Unix platforms. A stub is provided for other platforms that do not support this function. Documentation is updated to reflect new API function.
* Add GDNativeInterface::get_library_path to GDExtensionEmmanuel Leblond2022-04-291-1/+6
|
* Remove unused GDNative codeRémi Verschelde2022-03-091-2/+2
| | | | | | | | | This has been superseded by GDExtension so this code is no longer useful nor usable. There's still some GDNative-related stuff in platform export code which needs to be adapted for GDExtension (e.g. to include GDExtension libraries in exports).
* Style: Cleanup single-line blocks, semicolons, dead codeRémi Verschelde2022-02-161-4/+5
| | | | | Remove currently unused implementation of TextureBasisU, could be re-added later on if needed and ported.
* [OS/Crypto] Add get_entropy to OS.Fabio Alessandrelli2022-02-141-0/+40
| | | | | | | | | | | | | | | Implemented via `BCryptGenRandom` on Windows. Implemented via `getentropy` syscall when available. Implemented via `/dev/urandom` device as a fallback. The `/dev/urandom` fallback can be disabled via the `NO_URANDOM` build flag. Note: The HTML5 version relies on emscripten file system urandom device which itself uses the Crypto API when available or the plain old not crypto-safe `Math.random()` otherwise. Restore get_entropy.
* Merge pull request #56012 from bruvzg/wt🤎4Rémi Verschelde2022-01-171-2/+2
|\
| * [Windows] Improve console handling and execute/create_process.bruvzg2021-12-181-2/+2
| | | | | | | | | | | | | | | | | | | | Always build with the GUI subsystem. Redirect stdout and stderr output to the parent process console. Use CreateProcessW for blocking `execute` calls with piped stdout and stderr (prevent console windows for popping up when used with the GUI subsystem build, and have more consistent behavior with `create_process`). Add `open_console` argument to the `execute` and `create_process` to open a new console window. Remove `interface/editor/hide_console_window` editor setting. Remove `Toggle System Console` menu option. Remove `set_console_visible` and `is_console_visible` functions.
* | Update copyright statements to 2022Rémi Verschelde2022-01-031-2/+2
|/ | | | Happy new year to the wonderful Godot community!
* Replace String comparisons with "", String() to is_empty()Nathan Franke2021-12-091-3/+3
| | | | | | Also: - Adds two stress tests to test_string.h - Changes to .empty() on std::strings
* Fix data directory of unnamed projectskobewi2021-11-181-1/+1
|
* Update Time documentationAaron Franke2021-10-281-4/+4
|
* Implement toast notifications in the editorGilles Roudière2021-10-141-1/+1
|
* Rename String::is_rel_path to String::is_relative_pathWilson E. Alvarez2021-08-291-1/+1
|
* Move `alert` function from `DisplayServer` to `OS`.bruvzg2021-07-221-4/+0
|
* Add Time singletonAaron Franke2021-06-111-2/+2
|
* Rename `IP_Unix`, `IP_Address` and `TCP_Server` to remove underscoresHugo Locurcio2021-05-061-1/+1
|
* Modernize ThreadPedro J. Estébanez2021-01-291-5/+4
| | | | | | | | | - Based on C++11's `thread` and `thread_local` - No more need to allocate-deallocate or check for null - No pointer anymore, just a member variable - Platform-specific implementations no longer needed (except for the few cases of non-portable functions) - Simpler for `NO_THREADS` - Thread ids are now the same across platforms (main is 1; others follow)
* Modernize RWLockPedro J. Estébanez2021-01-191-3/+0
| | | | | | | | - Based on C++14's `shared_time_mutex` - No more need to allocate-deallocate or check for null - No pointer anymore, just a member variable - Platform-specific implementations no longer needed - Simpler for `NO_THREADS`
* Merge pull request #45157 from madmiraal/fix-44514Rémi Verschelde2021-01-131-2/+4
|\ | | | | Raise SIGKILL instead of CRASH_NOW in child process when fork fails
| * Raise SIGKILL instead of CRASH_NOW in child process when fork failsMarcel Admiraal2021-01-131-2/+4
| |
* | Fix OS::execute() and OS::create_process() command line argument CharStrings ↵bruvzg2021-01-131-6/+16
|/ | | | freed before use.
* Merge pull request #44514 from madmiraal/split-os-executeRémi Verschelde2021-01-121-42/+50
|\ | | | | Split OS::execute into two methods
| * Split OS::execute into two methodsMarcel Admiraal2021-01-091-42/+50
| | | | | | | | | | 1. execute(): Executes a command and returns the results. 2. create_process(): Creates a new process and returns the new process' id.
* | Merge pull request #42740 from lolleko/fix-nanosleep-usageRémi Verschelde2021-01-111-2/+5
|\ \ | |/ |/| Fix nanosleep usage
| * Fix nanosleep usageLorenz Junglas2020-10-121-2/+5
| | | | | | | | | | | | | | | | | | nanosleep returns 0 or -1 not the error code. The error code "EINTR" (if encountered) is placed in errno, in which case nanosleep can be safely recalled with the remaining time. This is required, so that nanosleep continues if the calling thread is interrupted by a signal. See manpage nanosleep(2) for additional details.
* | Update copyright statements to 2021Rémi Verschelde2021-01-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
* | Remove now unused FileAccessBuffered.Fabio Alessandrelli2020-12-061-1/+0
| |
* | Reorganized core/ directory, it was too fatty alreadyreduz2020-11-071-1/+1
| | | | | | | | | | | | -Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
* | Fix wrong exit code being returnedEv1lbl0w2020-10-241-1/+1
|/
* NetBSD: Implement OS_Unix::get_executable_path()Rémi Verschelde2020-09-181-2/+2
| | | | Same implementation as OpenBSD seems to work fine.
* Replace calls to gmtime with gmtime_r and localtime with localtime_r.Marcel Admiraal2020-09-041-17/+18
|
* [macOS] Fix crash on failed `fork`.bruvzg2020-08-111-1/+1
|
* Remove OS.get_system_time_secs/get_system_time_msecs and change ↵Emmanuel Leblond2020-05-311-13/+3
| | | | OS.get_unix_time return type to double
* Style: Enforce braces around if blocks and loopsRémi Verschelde2020-05-141-18/+32
| | | | | Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
* Style: Enforce separation line between function definitionsRémi Verschelde2020-05-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | I couldn't find a tool that enforces it, so I went the manual route: ``` find -name "thirdparty" -prune \ -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \ -o -name "*.glsl" > files perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files) misc/scripts/fix_style.sh -c ``` This adds a newline after all `}` on the first column, unless they are followed by `#` (typically `#endif`). This leads to having lots of places with two lines between function/class definitions, but clang-format then fixes it as we enforce max one line of separation. This doesn't fix potential occurrences of function definitions which are indented (e.g. for a helper class defined in a .cpp), but it's better than nothing. Also can't be made to run easily on CI/hooks so we'll have to be careful with new code. Part of #33027.
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-29/+0
| | | | | | | | | | | | | | Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
* Replace NULL with nullptrlupoDharkael2020-04-021-10/+10
|
* Renaming of servers for coherency.Juan Linietsky2020-03-271-1/+1
| | | | | | | | | | VisualServer -> RenderingServer PhysicsServer -> PhysicsServer3D Physics2DServer -> PhysicsServer2D NavigationServer -> NavigationServer3D Navigation2DServer -> NavigationServer2D Also renamed corresponding files.
* Refactor ScriptDebugger.Fabio Alessandrelli2020-03-081-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | EngineDebugger is the new interface to access the debugger. It tries to be as agnostic as possible on the data that various subsystems can expose. It allows 2 types of interactions: - Profilers: A subsystem can register a profiler, assigning it a unique name. That name can be used to activate the profiler or add data to it. The registered profiler can be composed of up to 3 functions: - Toggle: called when the profiler is activated/deactivated. - Add: called whenever data is added to the debugger (via `EngineDebugger::profiler_add_frame_data`) - Tick: called every frame (during idle), receives frame times. - Captures: (Only relevant in remote debugger for now) A subsystem can register a capture, assigning it a unique name. When receiving a message, the remote debugger will check if it starts with `[prefix]:` and call the associated capture with name `prefix`. Port MultiplayerAPI, Servers, Scripts, Visual, Performance to the new profiler system. Port SceneDebugger and RemoteDebugger to the new capture system. The LocalDebugger also uses the new profiler system for scripts profiling.
* Merge pull request #36752 from RandomShaper/rework_semaphoreRémi Verschelde2020-03-051-5/+0
|\ | | | | Drop old semaphore implementation
| * Drop old semaphore implementationPedro J. Estébanez2020-03-031-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | - Removed platform-specific implementations. - Now all semaphores are in-object, unless they need to be conditionally created. - Similarly to `Mutex`, provided a dummy implementation for when `NO_THREADS` is defined. - Similarly to `Mutex`, methods are made `const` for easy use in such contexts. - Language bindings updated: `wait()` and `post()` are now `void`. - Language bindings updated: `try_wait()` added. Bonus: - Rewritten the `#ifdef` in `mutex.h` to meet the code style.
* | os: execute parse the command output from utf8Mateo Dev .592020-03-031-1/+1
|/
* Reimplement Mutex with C++'s <mutex>Pedro J. Estébanez2020-02-261-3/+0
| | | | | | | | | | | | | | | | Main: - It's now implemented thanks to `<mutex>`. No more platform-specific implementations. - `BinaryMutex` (non-recursive) is added, as an alternative for special cases. - Doesn't need allocation/deallocation anymore. It can live in the stack and be part of other classes. - Because of that, it's methods are now `const` and the inner mutex is `mutable` so it can be easily used in `const` contexts. - A no-op implementation is provided if `NO_THREADS` is defined. No more need to add `#ifdef NO_THREADS` just for this. - `MutexLock` now takes a reference. At this point the cases of null `Mutex`es are rare. If you ever need that, just don't use `MutexLock`. - Thread-safe utilities are therefore simpler now. Misc.: - `ScopedMutexLock` is dropped and replaced by `MutexLock`, because they were pretty much the same. - Every case of lock, do-something, unlock is replaced by `MutexLock` (complex cases where it's not straightfoward are kept as as explicit lock and unlock). - `ShaderRD` contained an `std::mutex`, which has been replaced by `Mutex`.
* Improve the console error logging appearanceHugo Locurcio2020-01-191-13/+13
| | | | | | | This makes secondary information less visually prominent to improve overall readability. Various loggers were also tweaked for consistency.
* Disable colored console output when standard output isn't a TTYHugo Locurcio2020-01-041-8/+24
| | | | | This prevents Godot from writing ANSI escape codes when redirecting stdout and stderr to a file.
* Update copyright statements to 2020Rémi Verschelde2020-01-011-2/+2
| | | | | | | | | | | Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
* Fix compilation warnings in macOS build, enable `warnings=extra werror=yes` ↵bruvzg2019-10-241-0/+2
| | | | for macOS CI.
* Fix casting to uint64_t when returning unix system timeKanabenki2019-10-011-1/+1
|
* Added an exit code to the blocking mode of OS::executeRuslan Mullayanov2019-09-261-1/+1
| | | | | | Updated documentation accordingly. Fixes #31881.
* Added some obvious errors explanationsqarmin2019-09-251-1/+1
|