Commit Graph

275 Commits

Author SHA1 Message Date
Peter DV e58f45bef7 Correct error reporting 2022-06-27 11:26:34 +10:00
Ian Lilley dda2ed290a tidying up Query_Info return value when not in query features 2022-06-01 22:40:39 -04:00
William Roe bb4329711c [os] Darwin: Add os.exists() 2022-05-28 15:21:07 +01:00
William Roe 54a326f046 [os] Darwin,FreeBSD,OpenBSD: Rename os.getenv to os.get_env
Make os.get_env consistent across Unixes

This matches the function name and API from env_windows.odin and os_linux.odin, which should be the same everywhere. Meaning:

* named get_env and not getenv
* return a string (empty if the environment variable is not found)
* accept a default value parameter for the allocator (defaulting to context.allocator)
* calls lookup_env which returns an extra found boolean value

This is so that you don't have to write platform/OS conditionals when getting environment variable values from the stdlib os.get_env/getenv function.
2022-05-23 13:48:55 +01:00
gingerBill 5609221831 Merge pull request #1792 from jasonKercher/os2_linux
Os2 linux
2022-05-22 17:18:28 +01:00
Jeroen van Rijn db8d119cad Fix Windows os.make_directory. 2022-05-20 19:15:13 +02:00
Tetralux 57167be2a6 [os] Linux: os.unset_env() 2022-05-18 07:12:30 +00:00
jason 5a6836ab99 match user.odin and env.odin to master 2022-05-16 15:28:56 -04:00
jason d1499f3f78 make -vet happy 2022-05-16 13:57:12 -04:00
jason fff23e2bbb merge from upstream and convert to ^File types 2022-05-16 13:49:57 -04:00
gingerBill 33895b6d92 Convert all uses of *_from_slice to *_from_bytes where appropriate 2022-05-16 01:43:43 +01:00
gingerBill ed60ed3bae Merge pull request #1789 from Tetralux/os-patch
[os] Linux: Add os.exists(), os.get_env(), os.lookup_env(), os.set_env()
2022-05-15 20:49:55 +01:00
Tetralux b5b329378f [os] Linux: Add os.exists(), os.get_env(), os.lookup_env(), os.set_env()
exists() does the access() syscall.

Renames getenv() to get_env() to match Windows.
2022-05-14 20:14:10 +00:00
gingerBill dd56c85e55 Merge pull request #1784 from yay/os-darwin-fixes
os_darwin.odin fixes
2022-05-13 10:10:05 +01:00
Vitaly Kravchenko 9e2a847ebc Typo fix 2022-05-13 09:32:04 +01:00
Vitaly Kravchenko daef39a206 os_darwin.odin fixes 2022-05-13 09:27:15 +01:00
gingerBill f002857edc Clean up core:time to be consistent across all platforms 2022-05-12 15:47:24 +01:00
gingerBill eef44b11f3 Make the utf16 conversion procedures in core:sys/windows safer by checking for memory leaks 2022-05-12 13:17:58 +01:00
gingerBill bb4f108487 Update error handling for os2 on windows 2022-05-12 12:54:27 +01:00
gingerBill 8b4b81fdeb Fill in most of os2/file_windows.odin 2022-05-12 11:33:01 +01:00
gingerBill 96ab17ecfc Begin mocking os2 for windows out more 2022-05-05 18:01:44 +01:00
gingerBill 18bde22b26 Go to a File based approach over Handle based 2022-05-05 16:15:03 +01:00
gingerBill 5d190b15d7 Minor improvements to io and os 2022-05-05 15:30:07 +01:00
jason 97d1a67871 make vet happy, thread_local heap 2022-05-04 18:45:39 -04:00
jason bac96cf2ad fix mmap_to_region 2022-05-04 18:32:14 -04:00
jason 7e0cc0af25 heap_linux.odin 2022-05-04 17:55:15 -04:00
CiD- 56737c1431 merge upstream/master 2022-04-08 13:50:06 -04:00
CiD- 9ae566adcc commit before fetching upstream/master 2022-04-08 13:45:19 -04:00
CiD- aadb4db211 avoid temp_allocator on stupidly long paths 2022-04-06 10:53:46 -04:00
gingerBill a4d2ff05a9 Merge pull request #1688 from bkrypt/fix_file_windows_open_create_append_order
os/file_windows: Fix "create or append" file open behavior
2022-04-05 12:29:20 +01:00
gingerBill 48012ec73c Merge pull request #1679 from Tetralux/fix-std-handle
Have get_std_handle() no longer make the handles uninheritable
2022-04-05 12:15:14 +01:00
bkrypt e80bee6867 Change order of O_CREATE & O_APPEND checks 2022-04-02 21:55:01 +02:00
CiD- 88de3a1c06 add _chtimes 2022-04-01 22:41:35 -04:00
Tetralux c686133172 Have get_std_handle() no longer make the handles uninheritable
This caused all handles returned by GetStdHandle() to also not be inheritable,
which prevents you from handing them to child processes that you might create.

This fixes that.
2022-03-31 17:03:12 +00:00
CiD- 6456618891 finish up stat, lstat and fstat 2022-03-30 16:54:29 -04:00
gingerBill 4eb4ae6305 Replace sync with sync2 2022-03-30 17:42:44 +01:00
Jeroen van Rijn df32b5b46c [windows] Fix leak in glob. 2022-03-29 16:13:17 +02:00
CiD- e252d3bedf add os2.name 2022-03-23 11:49:19 -04:00
CiD- 36c22393a4 fix memory leak 2022-03-15 11:47:35 -04:00
CiD- 6d6e840bc2 mkdir_all: WHOOPS 2022-03-14 15:56:41 -04:00
CiD- 4b1822ade8 mkdir_all: close last open file 2022-03-14 15:48:47 -04:00
CiD- b21e7e4518 rewrite mkdir_all 2022-03-14 15:44:34 -04:00
CiD- 1f4e5e919f merge upstream/master 2022-03-14 13:36:22 -04:00
CiD- c293e88f2e commit to merge upstream/master 2022-03-14 13:34:06 -04:00
gingerBill 633157f4f8 Merge pull request #1613 from semarie/linux_arm64
fix Linux arm64 support
2022-03-14 11:37:45 +00:00
gingerBill fc0291d745 Merge pull request #1526 from odin-lang/freestanding_amd64
Freestanding target for amd64
2022-03-14 11:09:52 +00:00
gingerBill a7adb2fb6e Merge branch 'master' into freestanding_amd64 2022-03-14 11:02:59 +00:00
Sébastien Marie 036900da51 fix mode_t on darwin
- fix mkdir() prototype (mode_t is u16)
- remove explicit cast
2022-03-13 12:41:03 +00:00
Sébastien Marie ca67cf032c freebsd_amd64 support 2022-03-13 11:42:42 +00:00
Sébastien Marie 8982ae34e3 fix linux_arm64
- SYS_fork doesn't exist, uses SYS_clone
- properly cast AT_FDCWD to uintptr
2022-03-12 09:19:52 +00:00