gdb.info: The system call

Go forward to List of supported calls
Go backward to The isatty call
Go up to File-I/O remote protocol extension
Go to the top op gdb

The system(3) call

The 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 signal transmitted back is `EINTR' in case
the user pressed `Ctrl-C'.  Otherwise the return value consists
entirely 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 to allow this call explicitly by
entering
``set remote system-call-allowed 1''
   Disabling the `system' call is done by
``set remote system-call-allowed 0''
   The current setting is shown by typing
``show remote system-call-allowed''