Skip to content

Commit 739a2a6

Browse files
author
Franziska Geiger
committed
Changed os.getuid method to use Unixsystem.getUid for linux environment
1 parent dac3195 commit 739a2a6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/PosixModuleBuiltins.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,10 @@ int getPid() {
334334
public abstract static class GetUidNode extends PythonBuiltinNode {
335335
@Specialization
336336
int getPid() {
337-
// TODO: this needs to be implemented properly at some point (consider managed execution
338-
// as well)
337+
String osName = System.getProperty("os.name");
338+
if (osName.contains("Linux")) {
339+
return (int) new com.sun.security.auth.module.UnixSystem().getUid();
340+
}
339341
return 1000;
340342
}
341343
}

0 commit comments

Comments
 (0)