This change removes posix-fdtab as a hard dependency to posix-tty,
allowing the use of the latter without a userspace-visible fd table.
The functionality to open file descriptors 0, 1, and 2 at boot remains
dependent on posix-fdtab.
Signed-off-by: Andrei Tatar <andrei@unikraft.io>
Reviewed-by: Sergiu Moga <sergiu@unikraft.io>
Approved-by: Sergiu Moga <sergiu@unikraft.io>
GitHub-Closes: #1437
menuconfig LIBPOSIX_TTY
bool "posix-tty: Support for stdin/out/err"
- select LIBPOSIX_FDTAB
select LIBPOSIX_FDIO
if LIBPOSIX_TTY
bool "Provide file driver for the serial console"
select LIBUKCONSOLE
+ config LIBPOSIX_TTY_STDIO
+ bool "Open standard I/O files at boot (fd 0, 1, 2)"
+ select LIBPOSIX_FDTAB
+
choice LIBPOSIX_TTY_STDIN
+ depends on LIBPOSIX_TTY_STDIO
prompt "stdin:"
config LIBPOSIX_TTY_STDIN_NULL
endchoice
choice LIBPOSIX_TTY_STDOUT
+ depends on LIBPOSIX_TTY_STDIO
prompt "stdout/err:"
config LIBPOSIX_TTY_STDOUT_SERIAL
CXXINCLUDES-$(CONFIG_LIBPOSIX_TTY) += -I$(LIBPOSIX_TTY_BASE)/include
LIBPOSIX_TTY_SRCS-y += $(LIBPOSIX_TTY_BASE)/pseudo.c
-LIBPOSIX_TTY_SRCS-y += $(LIBPOSIX_TTY_BASE)/tty.c
+LIBPOSIX_TTY_SRCS-$(CONFIG_LIBPOSIX_TTY_STDIO) += $(LIBPOSIX_TTY_BASE)/tty.c
LIBPOSIX_TTY_SRCS-$(CONFIG_LIBPOSIX_TTY_SERIAL) += $(LIBPOSIX_TTY_BASE)/serial.c