nuttx/Documentation/components
Xiang Xiao 95063bde15 drivers/serial: add job-control TTY ioctls and libc wrappers
NuttX has no real session/process-group abstraction, so the TTY layer
collapses the foreground process group onto the single dev->pid field
(pgrp == pid, one member per group).  Extend the controlling-terminal
support so portable software (e.g. dropbear, socat) that relies on
job-control primitives works without losing the existing NuttX-specific
behaviour.

Driver (serial.c, pty.c):
- TIOCSCTTY now accepts a flag: arg > 0 keeps the historical "target
  PID in arg" semantics (NSH registers the foreground command it just
  spawned), while arg == 0 selects the calling task via
  nxsched_getpid(), matching the POSIX flag convention used by
  dropbear/socat/apue.  This preserves all existing callers and makes
  the previously-dead arg==0 path deliver SIGINT correctly.
- Add TIOCGPGRP/TIOCGSID (return dev->pid) and TIOCSPGRP (set it).
- pty.c gains the same handlers against pd_pid and includes
  nuttx/sched.h for nxsched_getpid().

ioctl numbers (tioctl.h): TIOCGPGRP/TIOCSPGRP/TIOCGSID at 0x37-0x39.

libc wrappers:
- termios: tcgetpgrp(), tcsetpgrp(), tcgetsid() over the new ioctls.
- unistd: setsid()/getsid()/setpgid() stubs consistent with the
  existing getpgrp()/getpgid() single-session model (sid == pgid ==
  pid; setpgid only succeeds for pgid == pid).

Declare the new prototypes in unistd.h (tcgetsid was already in
termios.h) and register all sources in the Make.defs/CMakeLists.

Group-broadcast signalling (kill(-pgrp)) remains unsupported, so
tty signals still target the single dev->pid; a real session/process
group model is left as a follow-up.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-06-23 16:26:53 -03:00
..
arch Documentation: update organization.rst 2023-10-30 20:29:54 +08:00
audio Documentation: add dummy pages for missing top directories 2023-10-27 13:21:40 -03:00
concurrency Documentation: Add documentation for seqcount. 2025-12-22 10:22:06 -03:00
drivers drivers/serial: add job-control TTY ioctls and libc wrappers 2026-06-23 16:26:53 -03:00
filesystem fs/littlefs: Enforce open permissions and set create ownership 2026-06-21 10:39:42 +08:00
libs include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
mm mm/iob: add iob_init method to support external buffer init as iob structure 2025-12-25 10:08:49 +08:00
net Documentaiton: net: tcp_network_perf: Add performance tips 2026-05-29 11:42:36 +02:00
nxgraphics !boards/boardctl: Remove BOARDIOC_INIT 2026-05-26 09:57:29 +08:00
tools doc: Contributing tools/checkpatch.sh example update. 2026-04-18 19:06:06 -03:00
binfmt.rst style: fix typos 2025-04-30 13:45:46 +08:00
boards.rst Documentation/components/boards.rst: fix typo 2026-06-04 09:58:42 +08:00
cmake.rst Documentation: initialize cmake doc 2023-10-27 13:21:40 -03:00
crypto.rst crypto/cryptosoft: Add support for PBKDF2 2026-03-29 17:23:03 -03:00
index.rst Documentation: Add documentation for seqcount. 2025-12-22 10:22:06 -03:00
nxflat.rst style: fix typos 2025-04-30 13:45:46 +08:00
openamp.rst Documentation: add dummy pages for missing top directories 2023-10-27 13:21:40 -03:00
paging.rst style: fix typos 2025-04-30 13:45:46 +08:00
syscall.rst Documentation: fix spelling 2025-05-15 11:33:41 +08:00
video.rst Documentation: add dummy pages for missing top directories 2023-10-27 13:21:40 -03:00
wireless.rst Documentation: add dummy pages for missing top directories 2023-10-27 13:21:40 -03:00