summaryrefslogtreecommitdiff
path: root/extmod/vfs_posix.c
AgeCommit message (Collapse)Author
2020-09-01extmod/vfs: Support larger integer range in VFS stat time fields.Damien George
On ports like unix where the Epoch is 1970/1/1 and atime/mtime/ctime are in seconds since the Epoch, this value will overflow a small-int on 32-bit systems. So far this is only an issue on 32-bit unix builds that use the VFS layer (eg dev and coverage unix variants) but the fix (using mp_obj_new_int_from_uint instead of MP_OBJ_NEW_SMALL_INT) is there for all ports so as to not complicate the code, and because they will need the range one day. Also apply a similar fix to other fields in VfsPosix.stat because they may also be large. Signed-off-by: Damien George <damien@micropython.org>
2020-03-27unix: Implement PEP 475 to retry syscalls failing with EINTR.David Lechner
https://www.python.org/dev/peps/pep-0475/ This implements something similar to PEP 475 on the unix port, and for the VfsPosix class. There are a few differences from the CPython implementation: - Since we call mp_handle_pending() between any ENITR's, additional functions could be called if MICROPY_ENABLE_SCHEDULER is enabled, not just signal handlers. - CPython only handles signal on the main thread, so other threads will raise InterruptedError instead of retrying. On MicroPython, mp_handle_pending() will currently raise exceptions on any thread. A new macro MP_HAL_RETRY_SYSCALL is introduced to reduce duplicated code and ensure that all instances behave the same. This will also allow other ports that use POSIX-like system calls (and use, eg, VfsPosix) to provide their own implementation if needed.
2020-02-28all: Reformat C and Python source code with tools/codeformat.py.Damien George
This is run with uncrustify 0.70.1, and black 19.10b0.
2020-01-26extmod/vfs_posix: Release GIL during system calls.David Lechner
This releases the GIL during syscalls that could block.
2019-09-23extmod/vfs_posix: Include stdio.h for declaration of function 'rename'.Bob Fanger
2019-02-12extmod: Convert legacy uppercase macro names to lowercase.Damien George
2018-07-11extmod/vfs_posix: Use DTTOIF if available to convert type in ilistdir.Damien George
2018-07-10extmod/vfs_posix: Support ilistdir with no (or empty) argument.Damien George
2018-06-06extmod/vfs: Introduce a C-level VFS protocol, with fast import_stat.Damien George
Following other C-level protocols, this VFS protocol is added to help abstract away implementation details of the underlying VFS in an efficient way. As a starting point, the import_stat function is put into this protocol so that the VFS sub-system does not need to know about every VFS implementation in order to do an efficient stat for importing files. In the future it might be worth adding other functions to this protocol.
2018-06-06extmod: Add VfsPosix filesystem component.Damien George
This VFS component allows to mount a host POSIX filesystem within the uPy VFS sub-system. All traditional POSIX file access then goes through the VFS, allowing to sandbox a uPy process to a certain sub-dir of the host system, as well as mount other filesystem types alongside the host filesystem.