summaryrefslogtreecommitdiffstats
path: root/drivers/unix/os_unix.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix formatting of dlopen error message on WindowsKamil Brzoskowski2023-07-091-1/+1
| | | | | | And harmonize the format for all platforms. Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
* Remove uses of `vformat()` with no placeholdersHugo Locurcio2023-06-281-1/+1
| | | | This is identical to passing the string directly.
* [OS] Implement and expose to scripting APIs `get_memory_info` method instead ↵bruvzg2023-04-241-1/+204
| | | | of old `get_free_static_memory`.
* OS: Add `unset_environment`, better validate inputRémi Verschelde2023-01-161-6/+13
| | | | | | | | | Instead of returning an undocumented boolean error code, we do the validation checks that should ensure a successful result. Based on: - https://linux.die.net/man/3/setenv - https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-setenvironmentvariable
* Merge pull request #70714 from Calinou/doc-os-stdinRémi Verschelde2023-01-121-7/+3
|\ | | | | Improve documentation for `OS.read_string_from_stdin()`
| * Improve documentation for `OS.read_string_from_stdin()`Hugo Locurcio2023-01-111-7/+3
| | | | | | | | | | | | This makes it clearer that calls to this method are blocking. The unused method parameter was also removed.
* | One Copyright Update to rule them allRémi Verschelde2023-01-051-29/+29
|/ | | | | | | | | | | | | | | | | | | | As many open source projects have started doing it, we're removing the current year from the copyright notice, so that we don't need to bump it every year. It seems like only the first year of publication is technically relevant for copyright notices, and even that seems to be something that many companies stopped listing altogether (in a version controlled codebase, the commits are a much better source of date of publication than a hardcoded copyright statement). We also now list Godot Engine contributors first as we're collectively the current maintainers of the project, and we clarify that the "exclusive" copyright of the co-founders covers the timespan before opensourcing (their further contributions are included as part of Godot Engine contributors). Also fixed "cf." Frenchism - it's meant as "refer to / see".
* Fix reading Unicode from stdio.bruvzg2022-12-211-4/+2
|
* [iOS] Fix getting Unicode executable path, fix "!configured" and ↵bruvzg2022-11-161-1/+1
| | | | "!classes.has(ti.inherits)" error spam on start.
* Unify usage of GLOBAL/EDITOR_GETkobewi2022-10-181-3/+3
|
* Merge pull request #66102 from MJacred/feature/getvideoadapterdriverinfoRémi Verschelde2022-10-111-0/+4
|\ | | | | | | Fetch video adapter driver name and version from OS
| * Fetch video adapter driver name and version from OS on Linux/*BSD and WindowsMJacred2022-10-111-0/+4
| |
* | Merge pull request #64815 from RandomShaper/default_cpu_countRémi Verschelde2022-10-061-4/+0
|\ \ | | | | | | | | | Improve default `OS`'s CPU count getter
| * | Keep a single, portable implementation of `OS::get_processor_count()`Pedro J. Estébanez2022-10-051-4/+0
| | |
* | | Merge pull request #66807 from ↵Rémi Verschelde2022-10-041-2/+1
|\ \ \ | | | | | | | | | | | | | | | | | | | | akien-mga/core-unix-remove-NO_FCNTL-and-NO_STATVFS Unix: Remove now unnecessary I/O defines, cleanup
| * | | Unix: Remove now unnecessary I/O defines, cleanupRémi Verschelde2022-10-031-2/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - `LIBC_FILEIO_ENABLED` wasn't defined anywhere, even in _other platforms_. - `NO_NETWORK` is also never defined. It probably isn't enough anyway to disable network APIs in the current codebase. - `UNIX_SOCKET_UNAVAILABLE` is never defined in this code but used by some other platforms, clarify that. - `NO_STATVFS` can be removed as Android supports it since API level 19, which is our current min SDK level. It's also only used for `DirAccessUnix::get_space_left()` which is anyway overridden by `DirAccessJAndroid::get_space_left()` so it shouldn't make a difference. * Fixed documentation for `DirAccess.get_space_left()`. - `NO_FCNTL` is likely also a remnant of early Android days, in current NDK r23 it seems to be available. Also cleaned up unused `fcntl.h` includes. - `NO_ALLOCA` is never defined, and we use alloca in many places now.
* / / Remove NO_THREADS fallback code, Godot 4 requires thread supportRémi Verschelde2022-10-031-2/+0
|/ / | | | | | | | | This also removes `OS::can_use_threads` from the public API since it's always true.
* / SCons: Cleanup `DEBUG`, `_DEBUG` and `NDEBUG` definesRémi Verschelde2022-09-231-5/+0
|/ | | | | | | | | | | | | | | | - `_DEBUG` is MSVC specific so it didn't make much sense to define for Android and iOS builds. - iOS was the only platform to define `DEBUG`. We don't use it anywhere outside thirdparty code, which we usually don't intend to debug, so it seems better to be consistent with other platforms. - Consistently define `NDEBUG` to disable assert behavior in both `release` and `release_debug` targets. This used to be set for `release` for all platforms, and `release_debug` for Android and iOS only. - Due to the above, I removed the only use we made of `assert()` in Godot code, which was only implemented for Unix anyway, should have been `DEV_ENABLED`, and is in PoolAllocator which we don't actually use. - The denoise and recast modules keep defining `NDEBUG` even for the `debug` target as we don't want OIDN and Embree asserting all over the place.
* Add get_distribution_name() and get_version() to OSMJacred2022-09-161-0/+8
| | | | | | supports: LinuxBSD, Windows, macOS, iOS, Android, UWP Co-authored-by: bruvzg
* Fixes #65377: get_datetime_* functions can return wrong valuesJames2022-09-101-17/+4
|
* Rename String `plus_file` to `path_join`Aaron Franke2022-08-291-5/+5
|
* [Web] Rename JavaScript platform to Web.Fabio Alessandrelli2022-08-291-3/+3
| | | | Also rename export name from "HTML5" to "Web".
* Rename OSX to macOS and iPhoneOS to iOS.bruvzg2022-07-211-1/+1
|
* Allows parsing of invalid UTF-16 surrogates (can be encountered in Windows ↵bruvzg2022-07-071-1/+6
| | | | filenames) and some non-standard UTF-8 variants, makes Unicode parse errors more verbose.
* 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 🎆