Skip to content

Commit

Permalink
[Truffle] Add setpgid POSIX node
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Fish committed Sep 8, 2016
1 parent f2ec387 commit f08b629
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
1 change: 0 additions & 1 deletion spec/truffle/tags/core/process/setpgrp_tags.txt
@@ -1,2 +1 @@
fails:Process.setpgrp and Process.getpgrp sets and gets the process group ID of the calling process
fails:Process.setpgrp and Process.getpgrp Process.setpgrp returns zero
Expand Up @@ -423,6 +423,16 @@ public int setgid(int gid) {

}

@CoreMethod(names = "setpgid", isModuleFunction = true, required = 2, lowerFixnum = {1, 2}, unsafe = UnsafeGroup.PROCESSES)
public abstract static class SetpgidNode extends CoreMethodArrayArgumentsNode {

@Specialization
public int setpgid(int pid, int pgid) {
return posix().setpgid(pid, pgid);
}

}

@CoreMethod(names = "setpriority", isModuleFunction = true, required = 3, lowerFixnum = { 1, 2, 3 }, unsafe = UnsafeGroup.PROCESSES)
public abstract static class SetPriorityNode extends CoreMethodArrayArgumentsNode {

Expand Down
Expand Up @@ -122,6 +122,11 @@ public int getpgid(int pid) {
return posix.getpgid(pid);
}

@Override
public int setpgid(int pid, int pgid) {
return posix.setpgid(pid, pgid);
}

@Override
public int getpgrp() {
return posix.getpgrp();
Expand Down
Expand Up @@ -42,6 +42,7 @@ public interface TrufflePosix {
int seteuid(int euid);
int getgid();
int getpgid(int pid);
int setpgid(int pid, int pgid);
int getpgrp();
int getpid();
int getppid();
Expand Down

0 comments on commit f08b629

Please sign in to comment.