aboutsummaryrefslogtreecommitdiff
path: root/core/os/os_linux.odin
Commit message (Collapse)AuthorAgeFilesLines
* core:os -> core:os/old && core:os/os2 -> core:osJeroen van Rijn6 days1-1233/+0
|
* core/os: fix lookup_env_buf only working with empty bufferDavid Bader2026-01-301-0/+1
|
* fix: cars i64 instead of intsamwega2025-10-031-1/+1
|
* os_linux.odin was using itoa, changed to use write_int()samwega2025-10-031-1/+1
|
* Require `@(init)` and `@(fini)` to be `proc "contextless" ()`gingerBill2025-08-081-2/+4
|
* Fixed the build check: ('arg' declared but not used) against the ↵WisonYe2025-07-191-1/+1
| | | | '-default-to-nil-allocator' fix for FreeBSD/OpenBSD/NetBSD/Linux.
* Fixed Index 0 is out of range 0..<0' when using '-default-to-nil-allocator' ↵WisonYe2025-07-191-1/+1
| | | | for Linux/OpenBSD/NetBSD.
* Fixed 'Odin/core/os/os_linux.odin(1104:7) Index 0 is out of range 0..<0' ↵WisonYe2025-07-191-2/+2
| | | | when using '-default-to-nil-allocator'.
* Merge branch 'master' into args-leakJeroen van Rijn2025-06-271-7/+35
|\
| * Add bring-your-own-buffer versions of `os.lookup_env` and `os.get_env`Jeroen van Rijn2025-06-161-2/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And make `core:terminal` use it so that `core:log` can be imported with `-default-to-nil-allocator`, in which the actual allocator is set up in `main()`. Windows was tricky because of the utf-8 <> utf-16 conversion, so we use some temporary stack buffers for that purpose, limiting the non-allocating version there to 512 utf-16 characters each for the key and environment value. In general the value is (obviously) limited to the size of the supplied buffer, and a `.Buffer_Full` error is returned if that buffer is insufficient. If the key is not found, the procedure returns `.Env_Var_Not_Found`. TODO: - Factor out buffer-backed utf8 + utf16 conversion to `core:sys/util` to more easily apply this pattern. - Add similar `lookup_env` and `get_env` procedures to `core:os/os2`. Fixes #5336
| * Mark some uninitialized memory as safeFeoramund2025-06-051-4/+4
| | | | | | | | | | Syscalls (but not C functions) are opaque to MemorySanitizer, thus some memory addresses need to be manually marked as safe to access.
| * pass flags down from `os.send` in darwin and linuxSamuel Elgozi2025-01-261-1/+1
| |
* | Make sure we don't leak os.args. Fixes #1633.Christiano Haesbaert2025-01-111-1/+6
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | os.args is never freed, while this is an insignificant leak, it is a bit annoying as it makes valgrind complain: ==234270== Memcheck, a memory error detector ==234270== Copyright (C) 2002-2024, and GNU GPL'd, by Julian Seward et al. ==234270== Using Valgrind-3.24.0 and LibVEX; rerun with -h for copyright info ==234270== Command: ./wc /tmp/mulumulu ==234270== 1 8 58 /tmp/mulumulu ==234270== ==234270== HEAP SUMMARY: ==234270== in use at exit: 47 bytes in 1 blocks ==234270== total heap usage: 5 allocs, 4 frees, 4,195,875 bytes allocated ==234270== ==234270== 47 bytes in 1 blocks are possibly lost in loss record 1 of 1 ==234270== at 0x484BC13: calloc (vg_replace_malloc.c:1675) ==234270== by 0x402E49: runtime._heap_alloc-769 (in /d/learn-odin/wc/wc) ==234270== by 0x40A8D7: runtime.heap_alloc (in /d/learn-odin/wc/wc) ==234270== by 0x436E9D: runtime.heap_allocator_proc.aligned_alloc-0 (in /d/learn-odin/wc/wc) ==234270== by 0x4022DC: runtime.heap_allocator_proc (in /d/learn-odin/wc/wc) ==234270== by 0x4165E0: runtime.make_aligned-22560 (in /d/learn-odin/wc/wc) ==234270== by 0x41F6D0: runtime.make_slice-22340 (in /d/learn-odin/wc/wc) ==234270== by 0x40156B: os._alloc_command_line_arguments-4679 (in /d/learn-odin/wc/wc) ==234270== by 0x4011AF: __$startup_runtime (in /d/learn-odin/wc/wc) ==234270== by 0x406F17: main (in /d/learn-odin/wc/wc) ==234270== ==234270== LEAK SUMMARY: ==234270== definitely lost: 0 bytes in 0 blocks ==234270== indirectly lost: 0 bytes in 0 blocks ==234270== possibly lost: 47 bytes in 1 blocks ==234270== still reachable: 0 bytes in 0 blocks ==234270== suppressed: 0 bytes in 0 blocks ==234270== ==234270== For lists of detected and suppressed errors, rerun with: -s ==234270== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) With the fix the leak is gone, tested on linux only. While here, also make _alloc_command_line_arguments() private.
* Merge pull request #4427 from laytan/posix-additionsgingerBill2024-10-301-1/+1
|\ | | | | Finish sys/posix with Linux and partial Windows support & clean up other packages as a result
| * sys/posix: impl rest of linux, impl some of WindowsLaytan Laats2024-10-281-1/+1
| |
* | Merge pull request #4335 from colrdavidson/datetime_tzJeroen van Rijn2024-10-221-4/+2
|\ \ | |/ |/| Add Timezone Support to Odin
| * tweaks per laytan suggestionsColin Davidson2024-10-101-4/+2
| |
* | Merge pull request #4118 from andradei/posix-linuxLaytan2024-10-131-4/+7
|\ \ | |/ |/| Linux POSIX support
| * Add contants RTLD contants on os_linux and posix (dlfcn).Isaac Andrade2024-08-281-4/+7
| |
| * Use native types on linux POSIX structs.Isaac Andrade2024-08-281-3/+0
| |
| * Merge branch 'master' of github.com:odin-lang/Odin into posix-linuxIsaac Andrade2024-08-271-3/+3
| |\
| * | Add POSIX dirent struct for Linux.Isaac Andrade2024-08-231-0/+3
| | |
* | | Update core/os/os_linux.odinYuriy Grynevych2024-09-191-0/+1
| | | | | | | | | Co-authored-by: Laytan <laytanlaats@hotmail.com>
* | | [core/os] get_current_directory: Add allocator arg to targets where its missingYuriy Grynevych2024-09-181-1/+1
| | |
* | | Report `Invalid_Whence` on some `os` platformsFeoramund2024-08-281-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Move `Seek`-related checks into OS-specific files for granularity. Platforms: - Darwin - FreeBSD - Haiku - Linux - NetBSD - OpenBSD
* | | Add missing `flush` functionality to `os` platformsFeoramund2024-08-281-2/+1
| |/ |/| | | | | | | | | | | | | | | Platforms: - FreeBSD - Haiku - Linux - NetBSD - OpenBSD
* | Fix `-vet-tabs` issuesgingerBill2024-08-241-3/+3
|/
* correct the riscv64 stat structsLaytan2024-08-211-20/+1
|
* add support for linux_riscv64 and freestanding_riscv64Laytan2024-08-201-0/+19
|
* posix: add packageLaytan Laats2024-08-141-3/+3
|
* fix `os.read_dir` closing the given file descriptorLaytan Laats2024-08-121-0/+6
|
* Remove unused import.Jeroen van Rijn2024-08-091-1/+0
|
* Add `@(require_results)`gingerBill2024-08-041-23/+47
|
* Add stubs for `flush` on platforms that didn't have itgingerBill2024-08-041-0/+5
|
* Fix typo; remove unneeded castsgingerBill2024-08-041-7/+7
|
* Begin mapping `os.Error` in the rest of the codebasegingerBill2024-08-041-0/+1
|
* `Errno` -> `Error`gingerBill2024-08-041-54/+54
|
* Try to map to `General_Error` where possiblegingerBill2024-08-041-1/+12
|
* More clean ups of ERROR_NONE and `!= nil` usagegingerBill2024-08-041-45/+39
|
* Clean up error handlinggingerBill2024-08-041-10/+10
|
* Use `union #shared_nil` for `os.Error`gingerBill2024-08-041-3/+3
|
* Begin converting `os.Errno` to be a `nil`-able type as a transition periodgingerBill2024-08-041-132/+132
|
* Check for unneeded `transmute` with `-vet-cast`gingerBill2024-06-291-2/+1
|
* Merge pull request #2998 from laytan/os-improvementsgingerBill2024-02-031-4/+22
|\ | | | | OS improvements
| * implement a max read/write at a time for non-windows (windows already has this)Laytan Laats2023-12-141-4/+22
| |
* | Alias heap calls from `base:runtime` is `core:os`gingerBill2024-01-281-21/+0
| |
* | Replace `core:*` to `base:*` where appropriategingerBill2024-01-281-2/+2
| |
* | clean up field namesLaytan Laats2023-12-081-8/+5
| |
* | fix struct stat layout linux arm64Laytan Laats2023-12-061-20/+45
|/
* Implement new sys/unix packageflysand72023-10-271-1/+12
|