feat: add SMB networking support

This commit is contained in:
daniel committed 2026-11-22 08:43:18 +01:00
1 parent 6665750528
commit 2af2e90606
55 files changed
+7456 -158

No files matched your search

+27
View File
@@ -664,6 +664,33 @@ namespace montauk {
return (int)syscall3(montauk::abi::SYS_FS_GROW, (uint64_t)drive,
(uint64_t)status, apply ? 1 : 0);
}
// ---- Userspace filesystem providers (see Api/Syscall.hpp) ----
// Mount a provider-backed drive served by the calling process. Returns the
// drive number or a negative status.
inline int userfs_mount(const montauk::abi::UserFsMountParams* params) {
return (int)syscall1(montauk::abi::SYS_USERFS_MOUNT, (uint64_t)params);
}
// Wait up to timeoutMs for the next request on `drive`. `data` receives the
// request payload and must hold USERFS_MAX_DATA bytes. Returns 1 with a
// request, 0 on timeout, or a negative status.
inline int userfs_recv(int drive, montauk::abi::UserFsRequest* req, void* data,
uint32_t dataMax, uint64_t timeoutMs) {
return (int)syscall5(montauk::abi::SYS_USERFS_RECV, (uint64_t)drive, (uint64_t)req,
(uint64_t)data, dataMax, timeoutMs);
}
inline int userfs_reply(int drive, uint64_t id, int64_t result,
const void* data = nullptr, uint32_t len = 0) {
return (int)syscall5(montauk::abi::SYS_USERFS_REPLY, (uint64_t)drive, id,
(uint64_t)result, (uint64_t)data, len);
}
// The provider unmounts its drive at once; any other process in the same
// session asks the provider to eject (it sees USERFS_OP_UNMOUNT).
inline int userfs_unmount(int drive) {
return (int)syscall1(montauk::abi::SYS_USERFS_UNMOUNT, (uint64_t)drive);
}
inline int userfs_info(int drive, montauk::abi::UserFsInfo* out) {
return (int)syscall2(montauk::abi::SYS_USERFS_INFO, (uint64_t)drive, (uint64_t)out);
}
inline int fs_format(const montauk::abi::FsFormatParams* params) {
return (int)syscall1(montauk::abi::SYS_FSFORMAT, (uint64_t)params);
}