1# Copyright (c) 2024 Tenstorrent AI ULC
2#
3# SPDX-License-Identifier: Apache-2.0
4
5menu "POSIX device I/O"
6
7config POSIX_DEVICE_IO
8	bool "POSIX device I/O"
9	select REQUIRES_FULL_LIBC
10	select ZVFS
11	select ZVFS_POLL
12	select ZVFS_SELECT
13	help
14	  Select 'y' here and Zephyr will provide an implementation of the POSIX_DEVICE_IO Option
15	  Group such as FD_CLR(), FD_ISSET(), FD_SET(), FD_ZERO(), close(), fdopen(), fileno(), open(),
16	  poll(), pread(), pselect(), pwrite(), read(), select(), and write().
17
18	  For more information, please see
19	  https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_subprofiles.html
20
21if POSIX_DEVICE_IO
22
23# These options are intended to be used for compatibility with external POSIX
24# implementations such as those in Newlib or Picolibc.
25
26config POSIX_DEVICE_IO_ALIAS_CLOSE
27	bool
28	help
29	  When selected via Kconfig, Zephyr will provide an alias for close() as _close().
30
31config POSIX_DEVICE_IO_ALIAS_OPEN
32	bool
33	help
34	  When selected via Kconfig, Zephyr will provide an alias for open() as _open().
35
36config POSIX_DEVICE_IO_ALIAS_READ
37	bool
38	help
39	  When selected via Kconfig, Zephyr will provide an alias for read() as _read().
40
41config POSIX_DEVICE_IO_ALIAS_WRITE
42	bool
43	help
44	  When selected via Kconfig, Zephyr will provide an alias for write() as _write().
45
46endif # POSIX_DEVICE_IO
47
48config POSIX_OPEN_MAX
49	int
50	default ZVFS_OPEN_MAX
51	help
52	  The maximum number of files that a process can have open at one time. This option is not
53	  directly user-configurable but can be adjusted via CONFIG_ZVFS_OPEN_MAX.
54
55	  For more information, please see
56	  https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html
57
58endmenu
59