|
85 | 85 | import com.oracle.graal.python.runtime.PosixSupportLibrary.Inet4SockAddr; |
86 | 86 | import com.oracle.graal.python.runtime.PosixSupportLibrary.Inet6SockAddr; |
87 | 87 | import com.oracle.graal.python.runtime.PosixSupportLibrary.InvalidAddressException; |
| 88 | +import com.oracle.graal.python.runtime.PosixSupportLibrary.OpenPtyResult; |
88 | 89 | import com.oracle.graal.python.runtime.PosixSupportLibrary.PosixException; |
89 | 90 | import com.oracle.graal.python.runtime.PosixSupportLibrary.PwdResult; |
90 | 91 | import com.oracle.graal.python.runtime.PosixSupportLibrary.RecvfromResult; |
@@ -216,6 +217,7 @@ private enum PosixNativeFunction { |
216 | 217 | call_getpgrp("():sint64"), |
217 | 218 | call_getsid("(sint64):sint64"), |
218 | 219 | call_setsid("():sint64"), |
| 220 | + call_openpty("([sint32]):sint32"), |
219 | 221 | call_ctermid("([sint8]):sint32"), |
220 | 222 | call_setenv("([sint8], [sint8], sint32):sint32"), |
221 | 223 | call_unsetenv("([sint8]):sint32"), |
@@ -1167,6 +1169,16 @@ public long setsid( |
1167 | 1169 | return res; |
1168 | 1170 | } |
1169 | 1171 |
|
| 1172 | + @ExportMessage |
| 1173 | + public OpenPtyResult openpty(@Shared("invoke") @Cached InvokeNativeFunction invokeNode) throws PosixException { |
| 1174 | + int[] outvars = new int[2]; |
| 1175 | + int res = invokeNode.callInt(this, PosixNativeFunction.call_openpty, wrap(outvars)); |
| 1176 | + if (res == -1) { |
| 1177 | + throw getErrnoAndThrowPosixException(invokeNode); |
| 1178 | + } |
| 1179 | + return new OpenPtyResult(outvars[0], outvars[1]); |
| 1180 | + } |
| 1181 | + |
1170 | 1182 | @ExportMessage |
1171 | 1183 | public TruffleString ctermid(@Shared("invoke") @Cached InvokeNativeFunction invokeNode, |
1172 | 1184 | @Shared("tsFromBytes") @Cached TruffleString.FromByteArrayNode fromByteArrayNode, |
|
0 commit comments