kopia lustrzana https://github.com/micropython/micropython-lib
os: Implement dup().
rodzic
e840da936f
commit
fff07bd79a
|
@ -39,6 +39,7 @@ open_ = libc.func("i", "open", "sii")
|
||||||
read_ = libc.func("i", "read", "ipi")
|
read_ = libc.func("i", "read", "ipi")
|
||||||
write_ = libc.func("i", "write", "iPi")
|
write_ = libc.func("i", "write", "iPi")
|
||||||
close_ = libc.func("i", "close", "i")
|
close_ = libc.func("i", "close", "i")
|
||||||
|
dup_ = libc.func("i", "dup", "i")
|
||||||
access_ = libc.func("i", "access", "si")
|
access_ = libc.func("i", "access", "si")
|
||||||
fork_ = libc.func("i", "fork", "")
|
fork_ = libc.func("i", "fork", "")
|
||||||
pipe_ = libc.func("i", "pipe", "p")
|
pipe_ = libc.func("i", "pipe", "p")
|
||||||
|
@ -184,6 +185,11 @@ def close(fd):
|
||||||
check_error(r)
|
check_error(r)
|
||||||
return r
|
return r
|
||||||
|
|
||||||
|
def dup(fd):
|
||||||
|
r = dup_(fd)
|
||||||
|
check_error(r)
|
||||||
|
return r
|
||||||
|
|
||||||
def access(path, mode):
|
def access(path, mode):
|
||||||
return access_(path, mode) == 0
|
return access_(path, mode) == 0
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue