mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-08 14:18:26 +02:00
Bloody lazy Crapple
No mknodat. Sigh.
This commit is contained in:
21
tools/utils/file_at_fd_generic.go
Normal file
21
tools/utils/file_at_fd_generic.go
Normal file
@@ -0,0 +1,21 @@
|
||||
//go:build !darwin
|
||||
|
||||
package utils
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
var _ = fmt.Print
|
||||
|
||||
func mknodAt(parent *os.File, name string, mode uint32, dev int) (err error) {
|
||||
for {
|
||||
if err = unix.Mknodat(int(parent.Fd()), name, mode, dev); err != unix.EINTR {
|
||||
break
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user