/* Attempt to connect a terminal emulator to the slave side of the pty If -attach_uart_cmd=<cmd> is provided as a command line option, <cmd> will be used. Otherwise, the default command, CONFIG_NATIVE_UART_AUTOATTACH_DEFAULT_CMD, will be used instead  */
static void attach_to_tty(const char *slave_tty, const char *auto_attach_cmd)
/* Attempt to connect a terminal emulator to the slave side of the pty If -attach_uart_cmd=<cmd> is provided as a command line option, <cmd> will be used. Otherwise, the default command, CONFIG_NATIVE_UART_AUTOATTACH_DEFAULT_CMD, will be used instead  */
static void attach_to_tty(const char *slave_tty, const char *auto_attach_cmd)
{
	char command[strlen(auto_attach_cmd) + strlen(slave_tty) + 1];
	sprintf(command, auto_attach_cmd, slave_tty);
	int ret = system(command);
	if (ret != 0) {
		WARN("Could not attach to the UART with \"%s\"\n", command);
		WARN("The command returned %i\n", WEXITSTATUS(ret));
	}
}