sysdep1_s.c

来自「minicom的源码,linux下常用的串口程序.」· C语言 代码 · 共 56 行

C
56
字号
/* * 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. */#ifdef HAVE_CONFIG_H#include <config.h>#endif#include "rcsid.h"RCSID("$Id: sysdep1_s.c,v 1.2 2003/07/26 15:51:13 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 + -
显示快捷键?