1
0
silverbullet/plugos/syscall/transport.ts
2022-03-27 11:31:12 +02:00

17 lines
373 B
TypeScript

import { SysCallMapping } from "../system";
export function transportSyscalls(
names: string[],
transportCall: (name: string, ...args: any[]) => Promise<any>
): SysCallMapping {
let syscalls: SysCallMapping = {};
for (let name of names) {
syscalls[name] = (ctx, ...args: any[]) => {
return transportCall(name, ...args);
};
}
return syscalls;
}