aboutsummaryrefslogtreecommitdiff
path: root/extmod/vfs_posix_file.c
AgeCommit message (Collapse)Author
2021-02-11extmod/vfs_posix_file: Allow closing an already closed file.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-04-05all: Use MP_ERROR_TEXT for all error messages.Jim Mussared
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-03-25extmod/vfs_posix_file: Include unistd.h to get STD{IN,OUT,ERR}_FILENO.David Lechner
2020-03-18unix: Remove custom file implementation to use extmod's VFS POSIX one.Damien George
The implementation in extmod/vfs_posix_file.c is now equivalent to that in ports/unix/file.c, so remove the latter and use the former instead.
2020-03-18extmod/vfs_posix_file: Lock GIL when writing and allow stdio flush.Damien George
Also support MP_STREAM_GET_FILENO ioctl. The stdio flush change was done previously for the unix port in 3e0b46b9af8b7a6934b7ac68671ef8f55be2b848. These changes make this POSIX file implementation equivalent to the unix file implementation.
2020-03-18all: Convert exceptions to use mp_raise_XXX helpers in remaining places.Damien George
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-12-27py: Introduce MP_ROM_NONE macro for ROM to refer to None object.Damien George
This helps to prevent mistakes, and allows easily changing the ROM value of None if needed.
2019-11-05all: Convert nlr_raise(mp_obj_new_exception_msg(x)) to mp_raise_msg(x).Damien George
This helper function was added a while ago and these are the remaining cases to convert, to save a bit of code size.
2019-08-20extmod: Give vars/funcs unique names so STATIC can be set to nothing.Damien George
Fixes issue #5018.
2019-02-12extmod: Convert legacy uppercase macro names to lowercase.Damien George
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.