authorgravatar for michael.dusan@gmail.comMichael Dusan <michael.dusan@gmail.com> 2023-08-15 17:20:05-04:00
committergravatar for michael.dusan@gmail.comMichael Dusan <michael.dusan@gmail.com> 2023-08-15 17:29:35-04:00
loge1216686f3b481eda5e0e6dd025711e0f1f1f2d0
treec17a5c480365f9c69bef3c875dfcf5f824267d80
parent4532ff278096dce71f5726a8aff051f834855d54
signaturelock-open Commit is signed but in an unrecognized format.

dragonfly: std.c: more decls

- add ucontext_t, mcontext_t - add pthread_rwlock_t

1 files changed, 54 insertions(+), 0 deletions(-)

lib/std/c/dragonfly.zig+54
...@@ -34,6 +34,10 @@ pub const pthread_attr_t = extern struct { // copied from freebsd...@@ -34,6 +34,10 @@ pub const pthread_attr_t = extern struct { // copied from freebsd
34 __align: c_long,34 __align: c_long,
35};35};
3636
37pub const pthread_rwlock_t = extern struct {
38 ptr: ?*anyopaque = null,
39};
40
37pub const sem_t = ?*opaque {};41pub const sem_t = ?*opaque {};
3842
39pub extern "c" fn pthread_setname_np(thread: std.c.pthread_t, name: [*:0]const u8) E;43pub extern "c" fn pthread_setname_np(thread: std.c.pthread_t, name: [*:0]const u8) E;
...@@ -55,6 +59,56 @@ pub const gid_t = u32;...@@ -55,6 +59,56 @@ pub const gid_t = u32;
55pub const time_t = isize;59pub const time_t = isize;
56pub const suseconds_t = c_long;60pub const suseconds_t = c_long;
5761
62pub const ucontext_t = extern struct {
63 sigmask: sigset_t,
64 mcontext: mcontext_t,
65 link: ?*ucontext_t,
66 stack: stack_t,
67 cofunc: ?*fn (?*ucontext_t, ?*anyopaque) void,
68 arg: ?*void,
69 _spare: [4]c_int,
70};
71
72pub const mcontext_t = extern struct {
73 onstack: register_t, // XXX - sigcontext compat.
74 rdi: register_t,
75 rsi: register_t,
76 rdx: register_t,
77 rcx: register_t,
78 r8: register_t,
79 r9: register_t,
80 rax: register_t,
81 rbx: register_t,
82 rbp: register_t,
83 r10: register_t,
84 r11: register_t,
85 r12: register_t,
86 r13: register_t,
87 r14: register_t,
88 r15: register_t,
89 xflags: register_t,
90 trapno: register_t,
91 addr: register_t,
92 flags: register_t,
93 err: register_t,
94 rip: register_t,
95 cs: register_t,
96 rflags: register_t,
97 rsp: register_t, // machine state
98 ss: register_t,
99
100 len: c_uint, // sizeof(mcontext_t)
101 fpformat: c_uint,
102 ownedfp: c_uint,
103 reserved: c_uint,
104 unused: [8]c_uint,
105
106 // NOTE! 64-byte aligned as of here. Also must match savefpu structure.
107 fpregs: [256]c_int align(64),
108};
109
110pub const register_t = isize;
111
58pub const E = enum(u16) {112pub const E = enum(u16) {
59 /// No error occurred.113 /// No error occurred.
60 SUCCESS = 0,114 SUCCESS = 0,