From 18988b5f94ba3447167befad84b42ab23358ea38 Mon Sep 17 00:00:00 2001 From: Dave Voutila Date: Thu, 27 Mar 2025 10:36:40 -0400 Subject: [PATCH] Fix use of errno on OpenBSD. --- base/runtime/os_specific_bsd.odin | 2 +- core/os/os_openbsd.odin | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/base/runtime/os_specific_bsd.odin b/base/runtime/os_specific_bsd.odin index 5d198484b..466001ada 100644 --- a/base/runtime/os_specific_bsd.odin +++ b/base/runtime/os_specific_bsd.odin @@ -9,7 +9,7 @@ foreign libc { @(link_name="write") _unix_write :: proc(fd: i32, buf: rawptr, size: int) -> int --- - when ODIN_OS == .NetBSD { + when ODIN_OS == .NetBSD || ODIN_OS == .OpenBSD { @(link_name="__errno") __error :: proc() -> ^i32 --- } else { __error :: proc() -> ^i32 --- diff --git a/core/os/os_openbsd.odin b/core/os/os_openbsd.odin index 3c377968c..6548a57dc 100644 --- a/core/os/os_openbsd.odin +++ b/core/os/os_openbsd.odin @@ -343,7 +343,7 @@ AT_REMOVEDIR :: 0x08 @(default_calling_convention="c") foreign libc { - @(link_name="__error") __error :: proc() -> ^c.int --- + @(link_name="__errno") __error :: proc() -> ^c.int --- @(link_name="fork") _unix_fork :: proc() -> pid_t --- @(link_name="getthrid") _unix_getthrid :: proc() -> int ---