WithProcfdFile is a very minimal wrapper around [ProcThreadSelfFd]. The caller is responsible for making sure that the provided file handle is actually safe to operate on. NOTE: THIS FUNCTION IS INTERNAL TO RUNC, DO NOT USE IT. TODO: Migrate the mount logic towards a more move_mount(2)-friendly de
(file *os.File, fn func(procfd string) error)
| 154 | // where this is kind of /proc/self/... tomfoolery is only done in a fallback |
| 155 | // path for old kernels. |
| 156 | func WithProcfdFile(file *os.File, fn func(procfd string) error) error { |
| 157 | fdpath, closer := ProcThreadSelfFd(file.Fd()) |
| 158 | defer closer() |
| 159 | |
| 160 | return fn(fdpath) |
| 161 | } |
| 162 | |
| 163 | type ProcThreadSelfCloser func() |
| 164 |
no test coverage detected
searching dependent graphs…