1
0
silverbullet/plugos/syscall/transport.ts

17 lines
373 B
TypeScript
Raw Normal View History

2022-03-25 11:03:06 +00:00
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;
}