mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
os.Errno -> os.Error
This commit is contained in:
@@ -227,7 +227,7 @@ _buffer_end :: proc "contextless" (ctx: ^Context, buffer: ^Buffer) #no_bounds_ch
|
||||
}
|
||||
|
||||
@(no_instrumentation)
|
||||
write :: proc "contextless" (fd: os.Handle, buf: []byte) -> (n: int, err: os.Errno) {
|
||||
write :: proc "contextless" (fd: os.Handle, buf: []byte) -> (n: int, err: os.Error) {
|
||||
return _write(fd, buf)
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import "core:sys/linux"
|
||||
MAX_RW :: 0x7fffffff
|
||||
|
||||
@(no_instrumentation)
|
||||
_write :: proc "contextless" (fd: os.Handle, data: []byte) -> (n: int, err: os.Errno) #no_bounds_check /* bounds check would segfault instrumentation */ {
|
||||
_write :: proc "contextless" (fd: os.Handle, data: []byte) -> (n: int, err: os.Error) #no_bounds_check /* bounds check would segfault instrumentation */ {
|
||||
if len(data) == 0 {
|
||||
return 0, os.ERROR_NONE
|
||||
}
|
||||
@@ -19,7 +19,7 @@ _write :: proc "contextless" (fd: os.Handle, data: []byte) -> (n: int, err: os.E
|
||||
chunk := data[:min(len(data), MAX_RW)]
|
||||
written, errno := linux.write(linux.Fd(fd), chunk)
|
||||
if errno != .NONE {
|
||||
return n, os.Errno(errno)
|
||||
return n, os.Error(errno)
|
||||
}
|
||||
n += written
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ get_last_error :: proc "contextless" () -> os.Platform_Error {
|
||||
MAX_RW :: 0x7fffffff
|
||||
|
||||
@(no_instrumentation)
|
||||
_write :: proc "contextless" (fd: os.Handle, data: []byte) -> (n: int, err: os.Errno) #no_bounds_check /* bounds check would segfault instrumentation */ {
|
||||
_write :: proc "contextless" (fd: os.Handle, data: []byte) -> (n: int, err: os.Error) #no_bounds_check /* bounds check would segfault instrumentation */ {
|
||||
if len(data) == 0 {
|
||||
return 0, os.ERROR_NONE
|
||||
}
|
||||
@@ -39,7 +39,7 @@ _write :: proc "contextless" (fd: os.Handle, data: []byte) -> (n: int, err: os.E
|
||||
chunk := data[:min(len(data), MAX_RW)]
|
||||
written := _unix_write(fd, raw_data(chunk), len(chunk))
|
||||
if written < 0 {
|
||||
return n, os.Errno(get_last_error())
|
||||
return n, os.Error(get_last_error())
|
||||
}
|
||||
n += written
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import win32 "core:sys/windows"
|
||||
MAX_RW :: 1<<30
|
||||
|
||||
@(no_instrumentation)
|
||||
_write :: proc "contextless" (fd: os.Handle, data: []byte) -> (int, os.Errno) #no_bounds_check /* bounds check would segfault instrumentation */ {
|
||||
_write :: proc "contextless" (fd: os.Handle, data: []byte) -> (int, os.Error) #no_bounds_check /* bounds check would segfault instrumentation */ {
|
||||
if len(data) == 0 {
|
||||
return 0, os.ERROR_NONE
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user