Skip to content
This repository was archived by the owner on Jan 25, 2022. It is now read-only.

Commit 111ab2d

Browse files
committed
expose option constants
1 parent b8b2b06 commit 111ab2d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/waitpid.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,13 @@ void Waitpid(const FunctionCallbackInfo<Value>& args) {
4040
}
4141

4242
void init(Local<Object> exports) {
43+
Isolate* isolate = exports->GetIsolate();
44+
4345
NODE_SET_METHOD(exports, "waitpid", Waitpid);
46+
// expose the option constants
47+
exports->Set(String::NewFromUtf8(isolate, "WNOHANG"), Number::New(isolate, WNOHANG));
48+
exports->Set(String::NewFromUtf8(isolate, "WUNTRACED"), Number::New(isolate, WUNTRACED));
49+
exports->Set(String::NewFromUtf8(isolate, "WCONTINUED"), Number::New(isolate, WCONTINUED));
4450
}
4551

4652
NODE_MODULE(waitpid2, init)

0 commit comments

Comments
 (0)