cmd/sharefs: opaque setup state
All checks were successful
Test / Sandbox (push) Successful in 2m26s
Test / Hakurei (push) Successful in 3m28s
Test / ShareFS (push) Successful in 3m31s
Test / Hpkg (push) Successful in 4m26s
Test / Sandbox (race detector) (push) Successful in 4m38s
Test / Hakurei (race detector) (push) Successful in 5m34s
Test / Flake checks (push) Successful in 1m42s
Test / Create distribution (push) Successful in 43s

This allows unrestricted use of the type system and prepares setup code for cross-process initialisation.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-12-27 03:45:09 +09:00
parent 6d3bd27220
commit 2e5362e536
3 changed files with 106 additions and 76 deletions

View File

@@ -13,11 +13,8 @@
/* sharefs_private is populated by sharefs_init and contains process-wide context */
struct sharefs_private {
int dirfd; /* source dirfd opened during sharefs_init */
bool init_failed; /* whether sharefs_init failed */
uintptr_t source_handle; /* cgo handle of pathname to open for dirfd, freed during sharefs_init */
uintptr_t setuid; /* uid to set by sharefs_init when running as root */
uintptr_t setgid; /* gid to set by sharefs_init when running as root */
int dirfd; /* source dirfd opened during sharefs_init */
uintptr_t setup; /* cgo handle of opaque setup state */
};
int sharefs_getattr(const char *pathname, struct stat *statbuf, struct fuse_file_info *fi);