Skip to content

Commit

Permalink
lib/posix-tty: Remove posix-fdtab dependency
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
andreittr committed Sep 24, 2024
1 parent 5ab057d commit 3eeabed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion lib/posix-tty/Config.uk
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
menuconfig LIBPOSIX_TTY
bool "posix-tty: Support for stdin/out/err"
select LIBPOSIX_FDTAB
select LIBPOSIX_FDIO

if LIBPOSIX_TTY
Expand All @@ -9,7 +8,12 @@ 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
Expand All @@ -25,6 +29,7 @@ if LIBPOSIX_TTY
endchoice

choice LIBPOSIX_TTY_STDOUT
depends on LIBPOSIX_TTY_STDIO
prompt "stdout/err:"

config LIBPOSIX_TTY_STDOUT_SERIAL
Expand Down
2 changes: 1 addition & 1 deletion lib/posix-tty/Makefile.uk
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ CINCLUDES-$(CONFIG_LIBPOSIX_TTY) += -I$(LIBPOSIX_TTY_BASE)/include
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

0 comments on commit 3eeabed

Please sign in to comment.