mirror of
https://github.com/micropython/micropython.git
synced 2025-08-29 05:50:40 +02:00
py/mpconfig.h: Add MICROPY_STREAMS_POSIX_API setting.
To filter out even prototypes of mp_stream_posix_*() functions, which require POSIX types like ssize_t & off_t, which may be not available in some ports.
This commit is contained in:
@@ -84,11 +84,13 @@ mp_uint_t mp_stream_rw(mp_obj_t stream, void *buf, mp_uint_t size, int *errcode,
|
||||
|
||||
void mp_stream_write_adaptor(void *self, const char *buf, size_t len);
|
||||
|
||||
#if MICROPY_STREAMS_POSIX_API
|
||||
// Functions with POSIX-compatible signatures
|
||||
ssize_t mp_stream_posix_write(mp_obj_t stream, const void *buf, size_t len);
|
||||
ssize_t mp_stream_posix_read(mp_obj_t stream, void *buf, size_t len);
|
||||
off_t mp_stream_posix_lseek(mp_obj_t stream, off_t offset, int whence);
|
||||
int mp_stream_posix_fsync(mp_obj_t stream);
|
||||
#endif
|
||||
|
||||
#if MICROPY_STREAMS_NON_BLOCK
|
||||
#define mp_is_nonblocking_error(errno) ((errno) == EAGAIN || (errno) == EWOULDBLOCK)
|
||||
|
Reference in New Issue
Block a user