Skip to content

system/nxinit: include termios.h for TIOCSCTTY - #4301

Open
JianyuWang0623 wants to merge 1 commit into
apache:masterfrom
JianyuWang0623:nxinit-termios-include
Open

JianyuWang0623 wants to merge 1 commit into
apache:masterfrom
JianyuWang0623:nxinit-termios-include

Conversation

@JianyuWang0623

Copy link
Copy Markdown
Contributor

Summary

Add an explicit #include <termios.h> to system/nxinit/service.c.
TIOCSCTTY is defined in nuttx/serial/tioctl.h, and service.c gets
it today only transitively through sys/ioctl.h. The explicit include
makes the dependency immune to header reorganization.

Impact

No behavior change: the same TIOCSCTTY definition is picked up; the
include is only made explicit.

Testing

Build Host: Ubuntu 22.04 (gcc, the host toolchain for the sim target)

Target: sim:watchdog (CONFIG_SYSTEM_NXINIT=y)

cmake -B build -GNinja -DBOARD_CONFIG=sim:watchdog nuttx
ninja -C build

ninja exits 0 and apps/system/nxinit/CMakeFiles/apps_init.dir/service.c.o
is produced; the sim binary boots to the nsh> prompt (./nuttx, exit 0):

nsh>

TIOCSCTTY is declared in nuttx/serial/tioctl.h and service.c only gets it
transitively through sys/ioctl.h. Include termios.h explicitly so the
dependency does not rely on how fs/ioctl.h is organized.

Co-authored-by: multica-agent <github@multica.ai>
Assisted-by: OpenCode:mimo-v2.6-pro
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
@JianyuWang0623
JianyuWang0623 marked this pull request as ready for review December 6, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants