Files
hakurei/cmd/sharefs/main.go
Ophestra 7bfbd59810
All checks were successful
Test / Create distribution (push) Successful in 46s
Test / Sandbox (push) Successful in 2m40s
Test / Hakurei (push) Successful in 3m41s
Test / Hpkg (push) Successful in 4m42s
Test / Sandbox (race detector) (push) Successful in 4m53s
Test / Hakurei (race detector) (push) Successful in 5m53s
Test / ShareFS (push) Successful in 38m10s
Test / Flake checks (push) Successful in 1m46s
cmd/sharefs: implement shared filesystem
This is for passing files between applications, similar to android /sdcard.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-25 05:13:02 +09:00

32 lines
594 B
Go

package main
import (
"log"
"os"
"path"
"runtime"
"syscall"
)
// executableName is the [path.Base] name of the executable that started the current process.
var executableName = func() string {
if len(os.Args) > 0 {
return path.Base(os.Args[0])
} else if name, err := os.Executable(); err != nil {
return "sharefs"
} else {
return path.Base(name)
}
}()
func main() {
runtime.LockOSThread()
log.SetFlags(0)
log.SetPrefix(executableName + ": ")
// don't mask creation mode, kernel already did that
syscall.Umask(0)
os.Exit(_main(len(os.Args), copyStrings(os.Args...)))
}