We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fff07bd commit a1cf086Copy full SHA for a1cf086
os/os/__init__.py
@@ -47,6 +47,7 @@ def errno_(val=None):
47
getpid_ = libc.func("i", "getpid", "")
48
waitpid_ = libc.func("i", "waitpid", "ipi")
49
system_ = libc.func("i", "system", "s")
50
+execvp_ = libc.func("i", "execvp", "PP")
51
getenv_ = libc.func("s", "getenv", "P")
52
53
R_OK = const(4)
@@ -211,6 +212,16 @@ def pipe():
211
212
def _exit(n):
213
_exit_(n)
214
215
+def execvp(f, args):
216
+ import uctypes
217
+ args_ = array.array("P", [0] * (len(args) + 1))
218
+ i = 0
219
+ for a in args:
220
+ args_[i] = uctypes.addressof(a)
221
+ i += 1
222
+ r = execvp_(f, uctypes.addressof(args_))
223
+ check_error(r)
224
+
225
def getpid():
226
return getpid_()
227
0 commit comments