File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
java/org/jruby/truffle/nodes/rubinius
ruby/core/rubinius/common Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -615,6 +615,20 @@ public int isATTY(int fd) {
615
615
616
616
}
617
617
618
+ @ CoreMethod (names = "getppid" , isModuleFunction = true )
619
+ public abstract static class GetppidNode extends CoreMethodArrayArgumentsNode {
620
+
621
+ public GetppidNode (RubyContext context , SourceSection sourceSection ) {
622
+ super (context , sourceSection );
623
+ }
624
+
625
+ @ Specialization
626
+ public int getppid () {
627
+ return posix ().getppid ();
628
+ }
629
+
630
+ }
631
+
618
632
@ CoreMethod (names = "symlink" , isModuleFunction = true , required = 2 )
619
633
public abstract static class SymlinkNode extends CoreMethodArrayArgumentsNode {
620
634
Original file line number Diff line number Diff line change @@ -90,6 +90,12 @@ def self.getpgrp
90
90
ret
91
91
end
92
92
93
+ def self . ppid
94
+ ret = FFI ::Platform ::POSIX . getppid
95
+ Errno . handle if ret == -1
96
+ ret
97
+ end
98
+
93
99
def self . uid = ( uid )
94
100
# the 4 rescue clauses below are needed
95
101
# until respond_to? can be used to query the implementation of methods attached via FFI
You can’t perform that action at this time.
0 commit comments