Skip to content

Commit

Permalink
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -615,6 +615,20 @@ public int isATTY(int fd) {

}

@CoreMethod(names = "getppid", isModuleFunction = true)
public abstract static class GetppidNode extends CoreMethodArrayArgumentsNode {

public GetppidNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

@Specialization
public int getppid() {
return posix().getppid();
}

}

@CoreMethod(names = "symlink", isModuleFunction = true, required = 2)
public abstract static class SymlinkNode extends CoreMethodArrayArgumentsNode {

6 changes: 6 additions & 0 deletions truffle/src/main/ruby/core/rubinius/common/process.rb
Original file line number Diff line number Diff line change
@@ -90,6 +90,12 @@ def self.getpgrp
ret
end

def self.ppid
ret = FFI::Platform::POSIX.getppid
Errno.handle if ret == -1
ret
end

def self.uid=(uid)
# the 4 rescue clauses below are needed
# until respond_to? can be used to query the implementation of methods attached via FFI

0 comments on commit 5d9716c

Please sign in to comment.