Idris2/support/c/idris_system.c
2021-12-25 21:50:56 -08:00

17 lines
289 B
C

#include <stdlib.h>
#ifndef _WIN32
#include <sys/wait.h>
#endif
#include "idris_system.h"
int idris2_system(const char* command) {
int status = system(command);
#ifdef _WIN32
return status;
#else
return WIFEXITED(status) ? WEXITSTATUS(status) : -1;
#endif
}