From b7dac177c81b1d1414a568c4375b24052045d4e6 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sat, 4 Jan 2025 20:40:00 +0800 Subject: misc: open_file --- misc/openat2.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'misc/openat2.go') diff --git a/misc/openat2.go b/misc/openat2.go index ab9f32d..2b63634 100644 --- a/misc/openat2.go +++ b/misc/openat2.go @@ -22,12 +22,12 @@ const ( ) // See openat2(2) on Linux -func Openat2(dirfd int, path string, open_how *Open_how_t, size int) (fd int, err error) { +func Openat2(dirfd int, path string, open_how *Open_how_t) (fd int, err error) { path_ptr, err := String_to_byte_ptr(path) if err != nil { return } - _fd, _, errno := syscall.Syscall6(SYS_OPENAT2, uintptr(dirfd), uintptr(unsafe.Pointer(path_ptr)), uintptr(unsafe.Pointer(open_how)), uintptr(size), 0, 0) + _fd, _, errno := syscall.Syscall6(SYS_OPENAT2, uintptr(dirfd), uintptr(unsafe.Pointer(path_ptr)), uintptr(unsafe.Pointer(open_how)), uintptr(unsafe.Sizeof(Open_how_t{})), 0, 0) fd = int(_fd) if errno != 0 { err = errno -- cgit v1.2.3