carlos / platform Public

Clone
git clone https://amadan.net/carlos/platform

Plain git — no account needed to clone.

Download

Download this file

1//go:build unix
2
3package archive
4
5import (
6 "io/fs"
7 "syscall"
8)
9
10// openNonblock keeps an open of a FIFO swapped in after the walk from
11// waiting for a writer; a regular file ignores it.
12const openNonblock = syscall.O_NONBLOCK
13
14// linkCount is a file's number of names (st_nlink).
15func linkCount(fi fs.FileInfo) uint64 {
16 if st, ok := fi.Sys().(*syscall.Stat_t); ok {
17 return uint64(st.Nlink)
18 }
19 return 1
20}
21