From b355c72d8178eff81f8f9cc7a3da20c68beb550b Mon Sep 17 00:00:00 2001 From: Ben McClelland Date: Wed, 4 Mar 2020 13:41:26 -0800 Subject: [PATCH] rename constants for private use --- syscall.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/syscall.go b/syscall.go index b9a28b1..138dd02 100644 --- a/syscall.go +++ b/syscall.go @@ -7,10 +7,10 @@ import ( ) const ( - // SYS_OPENBYHANDLEAT linux system call - SYS_OPENBYHANDLEAT = 304 - // FILEID_SCOUTFS for scoutfs file handle - FILEID_SCOUTFS = 0x81 + // sysOpenByHandleAt linux system call + sysOpenByHandleAt = 304 + // fileIDScoutfs for scoutfs file handle + fileIDScoutfs = 0x81 ) type fileID struct { @@ -31,14 +31,14 @@ type fileHandle struct { func OpenByHandle(dirfd *os.File, ino uint64, flags int) (uintptr, error) { h := &fileHandle{ FidSize: uint32(unsafe.Sizeof(fileID{})), - HandleType: FILEID_SCOUTFS, + HandleType: fileIDScoutfs, FID: fileID{Ino: ino}, } return openbyhandleat(dirfd.Fd(), h, flags) } func openbyhandleat(dirfd uintptr, handle *fileHandle, flags int) (uintptr, error) { - fd, _, e1 := syscall.Syscall6(SYS_OPENBYHANDLEAT, dirfd, uintptr(unsafe.Pointer(handle)), uintptr(flags), 0, 0, 0) + fd, _, e1 := syscall.Syscall6(sysOpenByHandleAt, dirfd, uintptr(unsafe.Pointer(handle)), uintptr(flags), 0, 0, 0) var err error if e1 != 0 { err = errnoErr(e1)