How xuantie-rv/newlib works
This is a GNU development-tools source tree, not one application: it combines binary-format and opcode definitions, C library and target syscall support, and the Cygwin POSIX compatibility runtime. A representative Cygwin flow begins with an application’s file or terminal operation, passes through Cygwin’s descriptor and handler layers, and reaches Windows-backed behavior. The tree also includes broader toolchain and debugging support documented by the README. The sampled source is incomplete, so edges are limited to relationships visible in excerpts or the source index.
Main entry points: winsup.h Runtime interface · fhandler.h File handlers · fhandler_console.cc Console I/O · fhandler_tty.cc PTY I/O
Components 19
Cygwin runtime
- Runtime interface
winsup/cygwin/winsup.h - Path resolution
winsup/cygwin/path.h - Descriptor table
winsup/cygwin/dtable.h - File handlers
winsup/cygwin/fhandler.h - Console I/O
winsup/cygwin/fhandler_console.cc - PTY I/O
winsup/cygwin/fhandler_tty.cc - Process state
winsup/cygwin/pinfo.h - Shared runtime state
winsup/cygwin/shared_info.h - Cygserver requests
winsup/cygserver/client.cc
Libraries and targets
- C library
newlib/libc - DNS resolver
newlib/libc/sys/linux/net/res_query.c - Linux threads
newlib/libc/sys/linux/linuxthreads/manager.c - Target syscall support
libgloss
Binary and opcode support
- Object formats
include - Opcode tables
include/opcode
Developer utilities
- Cygwin diagnostics
winsup/utils/cygcheck.cc
Other components
- POSIX application
- Windows OS
- Toolchain users
Connections 18
- POSIX application → Runtime interface: uses POSIX API
README - Runtime interface → Path resolution: resolves paths
- Runtime interface → Descriptor table: uses descriptors
- Descriptor table → File handlers: dispatches I/O
- File handlers → Process state: references process state
winsup/cygwin/fhandler.h - File handlers → PTY I/O: defines PTY handler
winsup/cygwin/fhandler.h - File handlers → Console I/O: defines console handler
winsup/cygwin/fhandler.h - Console I/O → Descriptor table: uses descriptors
winsup/cygwin/fhandler_console.cc - Console I/O → Shared runtime state: uses shared state
winsup/cygwin/fhandler_console.cc - PTY I/O → Shared runtime state: allocates shared TTY
winsup/cygwin/fhandler_tty.cc - PTY I/O → Process state: uses process state
winsup/cygwin/fhandler_tty.cc - Runtime interface → Windows OS: wraps OS facilities
- Toolchain users → Cygwin diagnostics: runs diagnostics
winsup/utils/cygcheck.cc - Toolchain users → Object formats: uses toolchain definitions
README - Toolchain users → Opcode tables: uses instruction definitions
README - C library → DNS resolver: includes resolver
newlib/libc/sys/linux/net/res_query.c - C library → Linux threads: includes thread support
newlib/libc/sys/linux/linuxthreads/manager.c - POSIX application → Target syscall support: uses target services