返回 DeepSeek-Reasonix
open_regular_unix.go
根目录 / internal / repair / open_regular_unix.go
1 //go:build !windows && !plan9
2
3 package repair
4
5 import (
6 "os"
7 "syscall"
8 )
9
10 func openRepairRegularRead(path string) (*os.File, error) {
11 fd, err := syscall.Open(path, syscall.O_RDONLY|syscall.O_CLOEXEC|syscall.O_NOFOLLOW, 0)
12 if err != nil {
13 return nil, err
14 }
15 return os.NewFile(uintptr(fd), path), nil
16 }
17
17 lines GO