nuttx/Documentation
Xiang Xiao db9531fe96 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-08-06 17:48:04 +08:00
..
_extensions Documentation: port warnings_filter Sphinx extension from Zephyr 2023-11-28 09:18:29 -08:00
_static docs: reduce main content max width from 1200px to 1000px 2021-03-26 23:41:45 -05:00
_templates
applications Documentation/netutils/dropbear: add Dropbear SSH server documentation 2026-08-05 15:26:28 +02:00
components drivers/serial: add job-control TTY ioctls and libc wrappers 2026-08-06 17:48:04 +08:00
contributing !arch/stm32: move stm32l1 and finalize the directory split 2026-07-03 10:27:27 +08:00
debugging Documentation: Add documentation of SCHED_DUMP_TASKS and SCHED_DUMP_STACK 2026-07-04 13:29:32 -04:00
faq !boards: Remove NSH_ARCHINIT and board_app_initialize 2026-05-02 18:36:46 +08:00
guides Documentation: add STM32 porting guide 2026-07-03 10:27:27 +08:00
implementation !arch/stm32: move stm32l1 and finalize the directory split 2026-07-03 10:27:27 +08:00
introduction WIP: Documentation: replace first person perspectives 2025-05-19 20:21:33 +08:00
logos style: fix typos 2025-04-30 13:45:46 +08:00
platforms Documentation: PBKDF2 login docs, board Kconfig, and CI password 2026-08-05 15:26:28 +02:00
quickstart !arch/stm32: move stm32l1 and finalize the directory split 2026-07-03 10:27:27 +08:00
reference arch/avr/src/avrdx/avrdx_delay: add custom up_udelay function 2026-06-17 17:10:02 +08:00
ReleaseNotes Documentation: add NuttX 13.0.0 release notes 2026-06-25 19:47:40 +08:00
standards Documentation/posix.rst: fix typos 2025-08-22 20:50:13 +08:00
testing docs/testing/citests: Expand CI testing documentation 2026-03-05 18:12:54 +01:00
.gitignore docs/tags: Introduce tagging feature to the documentation. 2025-04-29 09:18:25 +02:00
conf.py Documentation: conf: Ignore .venv 2026-05-29 01:26:21 +08:00
glossary.rst
index.rst docs/security: Add Security section to the documentation. 2026-01-06 02:17:20 +08:00
known-warnings.txt fs: Add VFS docs 2024-02-20 18:28:09 -08:00
legacy_README.md style: Fix "the the" typo across the codebase. 2026-03-23 11:07:49 +01:00
make.bat
Makefile doc: Improve sphinx build time + add autobuild help info. 2026-01-27 09:50:55 +08:00
Pipfile docs/plantuml: Add PlantUML support to Documentation build 2026-02-15 08:47:23 +01:00
Pipfile.lock build(deps): bump idna from 3.11 to 3.15 in /Documentation 2026-05-20 13:13:59 -04:00
security.rst docs/security: Add Security section to the documentation. 2026-01-06 02:17:20 +08:00
substitutions.rst Remove the double blank line from source files 2022-02-20 20:10:14 +01:00