| author | |
| committer | |
| log | 04e08ea883f94d2de7a91daee72ccc9613a18a43 |
| tree | 01d5ca0d0657672a8ac28ef0a2d558f21d79a4f7 |
| parent | 254a3ba9d963bd031d1e536d0da1ad0621121db2 |
| parent | a1777cb5cb378374377fd1c5e37bef9292b90910 |
| signature |
std: fix a few ABI issues in the OS layer7 files changed, 21 insertions(+), 21 deletions(-)
lib/std/Thread.zig+8-8| ... | ... | @@ -75,7 +75,7 @@ pub fn setName(self: Thread, name: []const u8) SetNameError!void { |
| 75 | 75 | } |
| 76 | 76 | } else { |
| 77 | 77 | const err = std.c.pthread_setname_np(self.getHandle(), name_with_terminator.ptr); |
| 78 | switch (err) { | |
| 78 | switch (@as(posix.E, @enumFromInt(err))) { | |
| 79 | 79 | .SUCCESS => return, |
| 80 | 80 | .RANGE => unreachable, |
| 81 | 81 | else => |e| return posix.unexpectedErrno(e), |
| ... | ... | @@ -119,14 +119,14 @@ pub fn setName(self: Thread, name: []const u8) SetNameError!void { |
| 119 | 119 | if (self.getHandle() != std.c.pthread_self()) return error.Unsupported; |
| 120 | 120 | |
| 121 | 121 | const err = std.c.pthread_setname_np(name_with_terminator.ptr); |
| 122 | switch (err) { | |
| 122 | switch (@as(posix.E, @enumFromInt(err))) { | |
| 123 | 123 | .SUCCESS => return, |
| 124 | 124 | else => |e| return posix.unexpectedErrno(e), |
| 125 | 125 | } |
| 126 | 126 | }, |
| 127 | 127 | .netbsd, .solaris, .illumos => if (use_pthreads) { |
| 128 | 128 | const err = std.c.pthread_setname_np(self.getHandle(), name_with_terminator.ptr, null); |
| 129 | switch (err) { | |
| 129 | switch (@as(posix.E, @enumFromInt(err))) { | |
| 130 | 130 | .SUCCESS => return, |
| 131 | 131 | .INVAL => unreachable, |
| 132 | 132 | .SRCH => unreachable, |
| ... | ... | @@ -144,7 +144,7 @@ pub fn setName(self: Thread, name: []const u8) SetNameError!void { |
| 144 | 144 | }, |
| 145 | 145 | .dragonfly => if (use_pthreads) { |
| 146 | 146 | const err = std.c.pthread_setname_np(self.getHandle(), name_with_terminator.ptr); |
| 147 | switch (err) { | |
| 147 | switch (@as(posix.E, @enumFromInt(err))) { | |
| 148 | 148 | .SUCCESS => return, |
| 149 | 149 | .INVAL => unreachable, |
| 150 | 150 | .FAULT => unreachable, |
| ... | ... | @@ -180,7 +180,7 @@ pub fn getName(self: Thread, buffer_ptr: *[max_name_len:0]u8) GetNameError!?[]co |
| 180 | 180 | } |
| 181 | 181 | } else { |
| 182 | 182 | const err = std.c.pthread_getname_np(self.getHandle(), buffer.ptr, max_name_len + 1); |
| 183 | switch (err) { | |
| 183 | switch (@as(posix.E, @enumFromInt(err))) { | |
| 184 | 184 | .SUCCESS => return std.mem.sliceTo(buffer, 0), |
| 185 | 185 | .RANGE => unreachable, |
| 186 | 186 | else => |e| return posix.unexpectedErrno(e), |
| ... | ... | @@ -219,7 +219,7 @@ pub fn getName(self: Thread, buffer_ptr: *[max_name_len:0]u8) GetNameError!?[]co |
| 219 | 219 | }, |
| 220 | 220 | .macos, .ios, .watchos, .tvos, .visionos => if (use_pthreads) { |
| 221 | 221 | const err = std.c.pthread_getname_np(self.getHandle(), buffer.ptr, max_name_len + 1); |
| 222 | switch (err) { | |
| 222 | switch (@as(posix.E, @enumFromInt(err))) { | |
| 223 | 223 | .SUCCESS => return std.mem.sliceTo(buffer, 0), |
| 224 | 224 | .SRCH => unreachable, |
| 225 | 225 | else => |e| return posix.unexpectedErrno(e), |
| ... | ... | @@ -227,7 +227,7 @@ pub fn getName(self: Thread, buffer_ptr: *[max_name_len:0]u8) GetNameError!?[]co |
| 227 | 227 | }, |
| 228 | 228 | .netbsd, .solaris, .illumos => if (use_pthreads) { |
| 229 | 229 | const err = std.c.pthread_getname_np(self.getHandle(), buffer.ptr, max_name_len + 1); |
| 230 | switch (err) { | |
| 230 | switch (@as(posix.E, @enumFromInt(err))) { | |
| 231 | 231 | .SUCCESS => return std.mem.sliceTo(buffer, 0), |
| 232 | 232 | .INVAL => unreachable, |
| 233 | 233 | .SRCH => unreachable, |
| ... | ... | @@ -243,7 +243,7 @@ pub fn getName(self: Thread, buffer_ptr: *[max_name_len:0]u8) GetNameError!?[]co |
| 243 | 243 | }, |
| 244 | 244 | .dragonfly => if (use_pthreads) { |
| 245 | 245 | const err = std.c.pthread_getname_np(self.getHandle(), buffer.ptr, max_name_len + 1); |
| 246 | switch (err) { | |
| 246 | switch (@as(posix.E, @enumFromInt(err))) { | |
| 247 | 247 | .SUCCESS => return std.mem.sliceTo(buffer, 0), |
| 248 | 248 | .INVAL => unreachable, |
| 249 | 249 | .FAULT => unreachable, |
lib/std/c/darwin.zig+2-2| ... | ... | @@ -851,8 +851,8 @@ pub const pthread_attr_t = extern struct { |
| 851 | 851 | }; |
| 852 | 852 | |
| 853 | 853 | pub extern "c" fn pthread_threadid_np(thread: ?std.c.pthread_t, thread_id: *u64) c_int; |
| 854 | pub extern "c" fn pthread_setname_np(name: [*:0]const u8) E; | |
| 855 | pub extern "c" fn pthread_getname_np(thread: std.c.pthread_t, name: [*:0]u8, len: usize) E; | |
| 854 | pub extern "c" fn pthread_setname_np(name: [*:0]const u8) c_int; | |
| 855 | pub extern "c" fn pthread_getname_np(thread: std.c.pthread_t, name: [*:0]u8, len: usize) c_int; | |
| 856 | 856 | pub extern "c" fn pthread_attr_set_qos_class_np(attr: *pthread_attr_t, qos_class: qos_class_t, relative_priority: c_int) c_int; |
| 857 | 857 | pub extern "c" fn pthread_attr_get_qos_class_np(attr: *pthread_attr_t, qos_class: *qos_class_t, relative_priority: *c_int) c_int; |
| 858 | 858 | pub extern "c" fn pthread_set_qos_class_self_np(qos_class: qos_class_t, relative_priority: c_int) c_int; |
lib/std/c/dragonfly.zig+2-2| ... | ... | @@ -29,8 +29,8 @@ pub const pthread_attr_t = extern struct { // copied from freebsd |
| 29 | 29 | |
| 30 | 30 | pub const sem_t = ?*opaque {}; |
| 31 | 31 | |
| 32 | pub extern "c" fn pthread_setname_np(thread: std.c.pthread_t, name: [*:0]const u8) E; | |
| 33 | pub extern "c" fn pthread_getname_np(thread: std.c.pthread_t, name: [*:0]u8, len: usize) E; | |
| 32 | pub extern "c" fn pthread_setname_np(thread: std.c.pthread_t, name: [*:0]const u8) c_int; | |
| 33 | pub extern "c" fn pthread_getname_np(thread: std.c.pthread_t, name: [*:0]u8, len: usize) c_int; | |
| 34 | 34 | |
| 35 | 35 | pub extern "c" fn umtx_sleep(ptr: *const volatile c_int, value: c_int, timeout: c_int) c_int; |
| 36 | 36 | pub extern "c" fn umtx_wakeup(ptr: *const volatile c_int, count: c_int) c_int; |
lib/std/c/emscripten.zig+1-1| ... | ... | @@ -171,7 +171,7 @@ pub const RTLD = struct { |
| 171 | 171 | pub const LOCAL = 0; |
| 172 | 172 | }; |
| 173 | 173 | |
| 174 | pub const dirent = struct { | |
| 174 | pub const dirent = extern struct { | |
| 175 | 175 | ino: c_uint, |
| 176 | 176 | off: c_uint, |
| 177 | 177 | reclen: c_ushort, |
lib/std/c/linux.zig+4-4| ... | ... | @@ -318,8 +318,8 @@ pub const sem_t = extern struct { |
| 318 | 318 | |
| 319 | 319 | const __SIZEOF_SEM_T = 4 * @sizeOf(usize); |
| 320 | 320 | |
| 321 | pub extern "c" fn pthread_setname_np(thread: std.c.pthread_t, name: [*:0]const u8) E; | |
| 322 | pub extern "c" fn pthread_getname_np(thread: std.c.pthread_t, name: [*:0]u8, len: usize) E; | |
| 321 | pub extern "c" fn pthread_setname_np(thread: std.c.pthread_t, name: [*:0]const u8) c_int; | |
| 322 | pub extern "c" fn pthread_getname_np(thread: std.c.pthread_t, name: [*:0]u8, len: usize) c_int; | |
| 323 | 323 | |
| 324 | 324 | pub const RTLD = struct { |
| 325 | 325 | pub const LAZY = 1; |
| ... | ... | @@ -330,14 +330,14 @@ pub const RTLD = struct { |
| 330 | 330 | pub const LOCAL = 0; |
| 331 | 331 | }; |
| 332 | 332 | |
| 333 | pub const dirent = struct { | |
| 333 | pub const dirent = extern struct { | |
| 334 | 334 | ino: c_uint, |
| 335 | 335 | off: c_uint, |
| 336 | 336 | reclen: c_ushort, |
| 337 | 337 | type: u8, |
| 338 | 338 | name: [256]u8, |
| 339 | 339 | }; |
| 340 | pub const dirent64 = struct { | |
| 340 | pub const dirent64 = extern struct { | |
| 341 | 341 | ino: c_ulong, |
| 342 | 342 | off: c_ulong, |
| 343 | 343 | reclen: c_ushort, |
lib/std/c/netbsd.zig+2-2| ... | ... | @@ -51,8 +51,8 @@ pub const pthread_attr_t = extern struct { |
| 51 | 51 | |
| 52 | 52 | pub const sem_t = ?*opaque {}; |
| 53 | 53 | |
| 54 | pub extern "c" fn pthread_setname_np(thread: std.c.pthread_t, name: [*:0]const u8, arg: ?*anyopaque) E; | |
| 55 | pub extern "c" fn pthread_getname_np(thread: std.c.pthread_t, name: [*:0]u8, len: usize) E; | |
| 54 | pub extern "c" fn pthread_setname_np(thread: std.c.pthread_t, name: [*:0]const u8, arg: ?*anyopaque) c_int; | |
| 55 | pub extern "c" fn pthread_getname_np(thread: std.c.pthread_t, name: [*:0]u8, len: usize) c_int; | |
| 56 | 56 | |
| 57 | 57 | pub const blkcnt_t = i64; |
| 58 | 58 | pub const blksize_t = i32; |
lib/std/c/solaris.zig+2-2| ... | ... | @@ -34,8 +34,8 @@ pub const sem_t = extern struct { |
| 34 | 34 | __pad2: [2]u64 = [_]u64{0} ** 2, |
| 35 | 35 | }; |
| 36 | 36 | |
| 37 | pub extern "c" fn pthread_setname_np(thread: std.c.pthread_t, name: [*:0]const u8, arg: ?*anyopaque) E; | |
| 38 | pub extern "c" fn pthread_getname_np(thread: std.c.pthread_t, name: [*:0]u8, len: usize) E; | |
| 37 | pub extern "c" fn pthread_setname_np(thread: std.c.pthread_t, name: [*:0]const u8, arg: ?*anyopaque) c_int; | |
| 38 | pub extern "c" fn pthread_getname_np(thread: std.c.pthread_t, name: [*:0]u8, len: usize) c_int; | |
| 39 | 39 | |
| 40 | 40 | pub const blkcnt_t = i64; |
| 41 | 41 | pub const blksize_t = i32; |