Skip to content

Commit 3de1406

Browse files
author
Paul Sokolovsky
committed
os: Don't use legacy getwd() libc function, not available in all libc's.
For example, not available in uclibc.
1 parent 38448bb commit 3de1406

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

os/metadata.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
srctype = micropython-lib
22
type = package
3-
version = 0.1.6
3+
version = 0.1.7
44
author = Paul Sokolovsky
55
depends = libc, errno, stat

os/os/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
rename_ = libc.func("i", "rename", "ss")
1919
unlink_ = libc.func("i", "unlink", "s")
2020
rmdir_ = libc.func("i", "rmdir", "s")
21-
getwd_ = libc.func("s", "getwd", "s")
21+
getcwd_ = libc.func("s", "getcwd", "si")
2222
opendir_ = libc.func("P", "opendir", "s")
2323
readdir_ = libc.func("P", "readdir", "P")
2424
read_ = libc.func("i", "read", "ipi")
@@ -56,7 +56,7 @@ def raise_error():
5656

5757
def getcwd():
5858
buf = bytearray(512)
59-
return getwd_(buf)
59+
return getcwd_(buf, 512)
6060

6161
def mkdir(name, mode=0o777):
6262
e = mkdir_(name, mode)

os/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77

88
setup(name='micropython-os',
9-
version='0.1.6',
9+
version='0.1.7',
1010
description='os module for MicroPython',
1111
long_description="This is a module reimplemented specifically for MicroPython standard library,\nwith efficient and lean design in mind. Note that this module is likely work\nin progress and likely supports just a subset of CPython's corresponding\nmodule. Please help with the development if you are interested in this\nmodule.",
1212
url='https://github.com/micropython/micropython/issues/405',

0 commit comments

Comments
 (0)