runtime/src/main.cpp
2024-11-10 05:26:16 -05:00

25 lines
541 B
C++

#include "log.h"
#include "pipe/main.h"
#ifdef MCPI_HAS_QEMU
#include "syscall/main.h"
#endif
// Main
int main(int argc, char *argv[]) {
// Check Arguments
if (argc < 2) {
ERR("Invalid Arguments");
}
// Update Arguments
argc--;
argv++;
// Create Implementation
Implementation *impl = new PipeImplementation;
#ifdef MCPI_HAS_QEMU
if (getenv(MCPI_USE_PIPE_TRAMPOLINE_ENV) == nullptr) {
delete impl;
impl = new SyscallImplementation;
}
#endif
return impl->main(argc, argv);
}