146 Commits

Author SHA1 Message Date
Michael Dusan
d7cf25f5ca
bsd: debitrot std.c
- follow-up to f4bf061d8a8
- updated std.fs.Dir to use properly named symbols
2024-03-15 02:28:50 -04:00
Tristan Ross
9d70d614ae
std.builtin: make link mode fields lowercase 2024-03-11 07:09:10 -07:00
Andrew Kelley
a280ff2767 std.os.termios: add type safety to lflag field
This creates `tc_cflag_t` even though such a type is not defined by
libc.

I also collected the missing flag bits from all the operating systems.
2024-02-12 21:21:45 -07:00
Andrew Kelley
e97fa8b038 std.os.termios: add type safety to cflag field
This creates `tc_cflag_t` even though such a type is not defined by
libc.

I also collected the missing flag bits from all the operating systems.
2024-02-12 18:24:07 -07:00
Andrew Kelley
20abc0caee std.os.termios: add type safety to oflag field
This creates `tc_oflag_t` even though such a type is not defined by
libc.

I also collected the missing flag bits from all the operating systems.
2024-02-12 17:28:09 -07:00
Andrew Kelley
47643cc5cc std.os.termios: add type safety to iflag field
This creates `tc_iflag_t` even though such a type is not defined by
libc.

I also collected the missing flag bits from all the operating systems.
2024-02-12 16:43:51 -07:00
Andrew Kelley
0c88f927f1 std.os.termios: consolidate and correct 2024-02-12 16:21:21 -07:00
Andrew Kelley
9a64318554 std.c.NCSS: consolidate and correct 2024-02-12 15:52:13 -07:00
Andrew Kelley
5258c3caad std: add type safety to cc_t 2024-02-12 15:41:38 -07:00
Andrew Kelley
7680c5330c some API work on std.c, std.os, std.os.wasi
* std.c: consolidate some definitions, making them share code. For
  example, freebsd, dragonfly, and openbsd can all share the same
  `pthread_mutex_t` definition.
* add type safety to std.c.O
  - this caught a bug where mode flags were incorrectly passed as the
    open flags.
* 3 fewer uses of usingnamespace keyword
* as per convention, remove purposeless field prefixes from struct field
  names even if they have those prefixes in the corresponding C code.
* fix incorrect wasi libc Stat definition
* remove C definitions from incorrectly being in std.os.wasi
* make std.os.wasi definitions type safe
* go through wasi native APIs even when linking libc because the libc
  APIs are problematic and wasteful
* don't expose WASI definitions in std.posix
* remove std.os.wasi.rights_t.ALL: this is a footgun. should it be all
  future rights too? or only all current rights known? both are
  the wrong answer.
2024-02-11 13:38:55 -07:00
Andrew Kelley
a60f219660 std.c.MAP: use a packed struct
Same as previous commit, but for the libc interface.
2024-02-06 22:06:01 -07:00
xdBronch
c9c3ee704c correctly detect apple a15 and a16 chips 2023-10-03 00:36:59 -07:00
Andrew Kelley
c7f2a7ea82 Revert "std: add a subset of the macOs's libproc api."
This reverts commit 7b0e015eb42272d84396f44fc904ab79f38dd696.
2023-07-31 11:20:57 -07:00
Andrew Kelley
1f9161a9c6 Revert "std.c: add mincore api to darwin."
This reverts commit 05f9608115a48fb7312ebf38c1240ae10b770c88.
2023-07-31 11:17:57 -07:00
Andrew Kelley
a397952932 Revert "std.c: add os_proc_available_memory for darwin"
This reverts commit 012f9a97eb74c63921ce7f3a036c71816fb59a24.
2023-07-31 11:13:40 -07:00
Andrew Kelley
a92be49851 Revert "Merge pull request #15317 from devnexen/darwin_rand_nativegen"
This reverts commit a11113097730693fb915114cec79df9cb4adcc93, reversing
changes made to 9f3f9fb40f605de2f2bdcd0ce7a396e06b8b8c0d.
2023-07-31 11:13:27 -07:00
Andrew Kelley
421022929a Revert "std.c: adding cpu affinity api for macOs (mainly x86_64)"
This reverts commit 4bfd37ddb48af4dbfd2e892aec7a90a822c8cbe7.
2023-07-31 11:12:19 -07:00
Andrew Kelley
614ae886db Revert "std.c: darwin add host_info based data."
This reverts commit ff59c4584041517a2ee07cccf923ef5460032d68.
2023-07-31 11:11:05 -07:00
Andrew Kelley
f3fa47a984 Revert "std.c: darwin adding more host_info api data"
This reverts commit 20cc69318f4661795aaacdc55bcaabb5f2e6484e.
2023-07-31 11:04:37 -07:00
Andrew Kelley
942848de58 Revert "std.c: adding basic darwin's host_statistics data."
This reverts commit 6547d233125199b16644c0f7504793490af67926.
2023-07-31 11:04:04 -07:00
Andrew Kelley
0043cdbeca Revert "std.c: further darwin's host statistics data"
This reverts commit cceadf52baff2590c1b38c469b1177918183dfe8.
2023-07-31 11:03:52 -07:00
Andrew Kelley
faa6daef99 Revert "std.c: darwin's *copyfile api update."
This reverts commit 40e8c2243c139dc499298645a2b387e30ae09cba.
2023-07-31 10:57:06 -07:00
Andrew Kelley
1b9ffa0824 Revert "std.Thread: refining stack size from platform minimum, changes more targetted towards platform like Linux/musl (#15791)"
This reverts commit 41502c6aa53a3da31b276c23c4db74db7d04796b.
2023-07-31 10:54:35 -07:00
Andrew Kelley
ba3b352891 Revert "std.os: fix uname usage."
This reverts commit 138f1253deb48434af707ec5e9124e889520be08.
2023-07-31 10:52:12 -07:00
Andrew Kelley
004711310a Revert "std.c: fix host_basic_info definition for darwin."
This reverts commit ea1d64dae4bb34d62e9cfddf7e3da493ed8063e9.
2023-07-31 10:50:22 -07:00
Lauri Tirkkonen
972e70b794 darwin: drop underscore from SIG._{BLOCK,UNBLOCK,SETMASK}
this makes them match decls in other OSes
2023-07-25 13:49:08 -07:00
kcbanner
576ffaa329 darwin: update mcontext_t definition for aarch64 to add neon state 2023-07-20 22:58:14 -04:00
kcbanner
412cd789bf debug: fixup base address calculations for macho
dwarf: fixup x86 register mapping logic
dwarf: change the register context update to update in-place instead of copying
debug: always print the unwind error type
2023-07-20 22:58:14 -04:00
mlugg
f26dda2117 all: migrate code to new cast builtin syntax
Most of this migration was performed automatically with `zig fmt`. There
were a few exceptions which I had to manually fix:

* `@alignCast` and `@addrSpaceCast` cannot be automatically rewritten
* `@truncate`'s fixup is incorrect for vectors
* Test cases are not formatted, and their error locations change
2023-06-24 16:56:39 -07:00
David CARLIER
ea1d64dae4 std.c: fix host_basic_info definition for darwin.
follow-up on ff59c45.

ref: a5e15eced0/lib/libc/include/any-macos-any/mach/host_info.h (L116)
2023-06-24 13:00:14 -07:00
Eric Joldasov
50339f595a all: zig fmt and rename "@XToY" to "@YFromX"
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-19 12:34:42 -07:00
David CARLIER
138f1253de std.os: fix uname usage.
close #15839.
2023-05-29 22:08:43 +03:00
David CARLIER
41502c6aa5
std.Thread: refining stack size from platform minimum, changes more targetted towards platform like Linux/musl (#15791) 2023-05-25 14:32:17 -05:00
David CARLIER
40e8c2243c std.c: darwin's *copyfile api update. 2023-05-17 06:06:41 +03:00
David CARLIER
cceadf52ba std.c: further darwin's host statistics data 2023-05-13 11:55:43 +03:00
David CARLIER
6547d23312 std.c: adding basic darwin's host_statistics data. 2023-05-12 20:20:31 +03:00
Veikka Tuominen
d761e6cc7d fix formatting in darwin.zig 2023-05-11 14:59:19 +03:00
David CARLIER
20cc69318f std.c: darwin adding more host_info api data 2023-05-11 11:21:07 +03:00
David CARLIER
ff59c45840 std.c: darwin add host_info based data. 2023-05-07 17:05:03 +03:00
David CARLIER
4bfd37ddb4 std.c: adding cpu affinity api for macOs (mainly x86_64) 2023-05-06 00:55:20 +03:00
Veikka Tuominen
a111130977
Merge pull request #15317 from devnexen/darwin_rand_nativegen
std: add CCRandomGenerateBytes macOs native api.
2023-05-05 19:52:05 +03:00
David CARLIER
012f9a97eb std.c: add os_proc_available_memory for darwin 2023-05-04 10:13:11 +03:00
Linus Groh
94e30a756e std: fix a bunch of typos
The majority of these are in comments, some in doc comments which might
affect the generated documentation, and a few in parameter names -
nothing that should be breaking, however.
2023-04-30 18:16:04 -07:00
David CARLIER
05f9608115 std.c: add mincore api to darwin. 2023-04-29 14:25:37 +03:00
Andrew Kelley
a5c910adb6 change semantics of @memcpy and @memset
Now they use slices or array pointers with any element type instead of
requiring byte pointers.

This is a breaking enhancement to the language.

The safety check for overlapping pointers will be implemented in a
future commit.

closes #14040
2023-04-25 11:23:40 -07:00
David CARLIER
7b0e015eb4 std: add a subset of the macOs's libproc api. 2023-04-23 19:45:46 +03:00
David CARLIER
c579a23c5d std: add CCRandomGenerateBytes macOs native api. 2023-04-22 21:01:12 +01:00
David CARLIER
3e467c778a std: add os_log/signpost api (sort of linux's perf event equivalent)
subset.
2023-04-06 07:31:06 +03:00
David CARLIER
f86f531e9c std: add a subset of the apple's QOS api 2023-04-05 09:01:35 +02:00
David CARLIER
1de64dba23 std: add the VM_MAKE_TAG macro for darwin. 2023-03-26 23:56:27 +02:00