Skip to content

Commit a9ba7b0

Browse files
committed
no pid on wasi
1 parent 22f2c95 commit a9ba7b0

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

source/util/OS.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,9 @@ std::string OS::parseEnvVar(const char*& ptr, const char* end) {
406406
int OS::getpid() {
407407
#if defined(_WIN32)
408408
return ::_getpid();
409+
#elif defined(__wasi__)
410+
// WASI doesn't have a concept of process IDs
411+
return 1;
409412
#else
410413
return ::getpid();
411414
#endif

0 commit comments

Comments
 (0)