338 Appendix D. gdb Remote Serial Protocol• The user presses Ctrl-C. The behaviour is as explained above, the read system call is treated asfinished.• The user presses Enter. This is treated as end of input with a trailing line feed.• The user presses Ctrl-D. This is treated as end of input. No trailing character, especially no Ctrl-Dis appended to the input.If the user has typed more characters as fit in the buffer given to the read call, the trailing charactersare buffered in gdb until either another read(0, ...) is requested by the target or debugging isstopped on users request.D.7.8. The isatty(3) callA special case in this protocol is the library call isatty which is implemented as it’s own call insideof this protocol. It returns 1 to the target if the file descriptor given as parameter is attached to thegdb console, 0 otherwise. Implementing through system calls would require implementing ioctland would be more complex than needed.D.7.9. The system(3) callThe other special case in this protocol is the system call which is implemented as it’s own call,too. gdb is taking over the full task of calling the necessary host calls to perform the system call.The return value of system is simplified before it’s returned to the target. Basically, the only signaltransmitted back is EINTR in case the user pressed Ctrl-C. Otherwise the return value consistsentirely of the exit status of the called command.Due to security concerns, the system call is refused to be called by gdb by default. The user has toallow this call explicitly by enteringset remote system-call-allowed 1Set the call.Disabling the system call is done byset remote system-call-allowed 0Set the call.The current setting is shown by typingshow remote system-call-allowedSet the call.D.7.10. List of supported calls