sysdep1_s.c

来自「Linux Minicom Serial program」· C语言 代码 · 共 60 行

C
60
字号
/* * sysdep1_s.c	system dependant routines. * 		sysdep1.c has a dependeny to function not needed * 		for runscript so put m_flush (the only needed sysdep * 		function by runscript) into a separate object. * *		m_flush		- flush * *		If it's possible, Posix termios are preferred. * *		This file is part of the minicom communications package, *		Copyright 1991-1995 Miquel van Smoorenburg. * *		This program is free software; you can redistribute it and/or *		modify it under the terms of the GNU General Public License *		as published by the Free Software Foundation; either version *		2 of the License, or (at your option) any later version. * *  You should have received a copy of the GNU General Public License along *  with this program; if not, write to the Free Software Foundation, Inc., *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */#ifdef HAVE_CONFIG_H#include <config.h>#endif#include "rcsid.h"RCSID("$Id: sysdep1_s.c,v 1.3 2007-10-10 20:18:20 al-guest Exp $")#include "sysdep.h"#include "minicom.h"#ifdef USE_SOCKETint portfd_is_socket;int portfd_is_connected;struct sockaddr_un portfd_sock_addr;#endif/* * Flush the buffers */void m_flush(int fd){#ifdef USE_SOCKET  if (portfd_is_socket)    return;#endif/* Should I Posixify this, or not? */#ifdef TCFLSH  ioctl(fd, TCFLSH, 2);#endif#ifdef TIOCFLUSH  {    int out = 0;    ioctl(fd, TIOCFLUSH, &out);  }#endif}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?