mirror of
https://github.com/restic/restic.git
synced 2025-03-30 00:00:14 +01:00

The implementations are 90% copy&paste from the go standard library as the existing code does not offer any way to read the symlink target based on a filehandle. Fall back to a standard readlink on platforms other than Linux and Windows as those either don't even provide the necessary syscall or in case of macOS are not yet available in Go.
9 lines
202 B
Go
9 lines
202 B
Go
package fs
|
|
|
|
import "os"
|
|
|
|
// TODO macOS versions >= 13 support freadlink. Use that instead of the fallback codepath
|
|
|
|
func Freadlink(fd uintptr, name string) (string, error) {
|
|
return os.Readlink(name)
|
|
}
|