1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright (C) 2022 Sean Anderson <sean.anderson@seco.com>
10 * enum smh_open_mode - Numeric file modes for use with smh_open()
17 * These modes represent the mode string used by fopen(3) in a form which can
18 * be passed to smh_open(). These do NOT correspond directly to %O_RDONLY,
19 * %O_CREAT, etc; see fopen(3) for details. In particular, @MODE_PLUS
20 * effectively results in adding %O_RDWR, and @MODE_WRITE will add %O_TRUNC.
21 * For compatibility, @MODE_BINARY should be added when opening non-text files
32 long smh_open(const char *fname, enum smh_open_mode mode);
33 long smh_read(long fd, void *memp, size_t len);
34 long smh_close(long fd);
35 long smh_flen(long fd);
37 #endif /* _SEMIHOSTING_H */