当前位置: 首页>>代码示例>>C++>>正文


C++ writefifo函数代码示例

本文整理汇总了C++中writefifo函数的典型用法代码示例。如果您正苦于以下问题:C++ writefifo函数的具体用法?C++ writefifo怎么用?C++ writefifo使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了writefifo函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: WriteISACfifo_IPAC

static void
WriteISACfifo_IPAC(struct IsdnCardState *cs, u_char *data, int size)
{
	writefifo(cs->hw.diva.isac_adr, cs->hw.diva.isac, 0x80, data, size);
}
开发者ID:asmalldev,项目名称:linux,代码行数:5,代码来源:diva.c

示例2: WriteISACfifo

static void
WriteISACfifo(struct IsdnCardState *cs, u_char * data, int size)
{
	writefifo(cs->hw.ix1.isac_ale, cs->hw.ix1.isac, 0, data, size);
}
开发者ID:ManiacTwister,项目名称:linux-hnd,代码行数:5,代码来源:ix1_micro.c

示例3: WriteISACfifo

static void
WriteISACfifo(struct IsdnCardState *cs, u_char * data, int size)
{
	writefifo(cs->hw.ax.base, cs->hw.ax.data_adr, 0x80, data, size);
}
开发者ID:johnny,项目名称:CobraDroidBeta,代码行数:5,代码来源:bkm_a8.c

示例4: WriteISACfifo

static void
WriteISACfifo(struct IsdnCardState *cs, u_char * data, int size)
{
    cs->hw.hfc.cip = 0;
    writefifo(cs->hw.hfc.addr | 1, cs->hw.hfc.addr, 0, data, size);
}
开发者ID:274914765,项目名称:C,代码行数:6,代码来源:teleint.c

示例5: main

int main(int argc, char *argv[])
{
	const char *action = NULL;
	struct sigaction sa;

	ARGBEGIN {
	case 'l':
	case 'r':
	case 's':
		if (writefifo(fifofile, ARGC()) == -1)
			die("cannot write to fifo\n");
		exit(EXIT_SUCCESS);
	default:
		usage();
	} ARGEND;
	
	if (argc > 1)
		usage();

	if (getuid() != 0)
		die("only root can run this program\n");
	if (getlock(pidfile) == -1)
		die("cannot get exclusive lock\n");
	if (createfifo(fifofile, 0666) == -1)
		die("cannot create fifo\n");

	sa.sa_flags = SA_NOCLDSTOP;
	sa.sa_handler = catchsignal;
	sigemptyset(&sa.sa_mask);
	sigaction(SIGCHLD, &sa, NULL);

	signal(SIGINT, catchsignal);
	signal(SIGHUP, catchsignal);
	signal(SIGQUIT, catchsignal);
	signal(SIGTERM, catchsignal);
	signal(SIGKILL, catchsignal);
	signal(SIGPIPE, catchsignal);

	startserver(server, display);
	do {
		const char *user, *pass;
		char c;

		if (autologin && authenticate(autologin, NULL)) {
			autologin = NULL;
			goto login;
		}

		creategui();
		do {
			rungui(&user, &pass);
			if (!strcmp(user, "reboot"))
				action = rebootcmd;
			else if (!strcmp(user, "shutdown"))
				action = shutdowncmd;
		} while (!action && !authenticate(user, pass));
		destroygui();

		if (action)
			break;

login:		childpid = startsession(child, env);

		c = readfifo(fifofile);
		if (c == 'r')
			action = rebootcmd;
		else if (c == 's')
			action = shutdowncmd;
		else if (!c)
			while (childpid)
				sleep(10);

		stopsession();
	} while (!action);
	signal(SIGINT, SIG_IGN);
	signal(SIGHUP, SIG_IGN);
	signal(SIGQUIT, SIG_IGN);
	signal(SIGTERM, SIG_DFL);
	signal(SIGKILL, SIG_DFL);
	signal(SIGCHLD, SIG_DFL);
	signal(SIGPIPE, SIG_IGN);
	stopserver();

	removefifo(fifofile);
	removelock(pidfile);

	return system(action);
}
开发者ID:SteelTermite,项目名称:ddm,代码行数:88,代码来源:ddm.c

示例6: isac_write_fifo

static void
isac_write_fifo(struct IsdnCardState *cs, u8 * data, int size)
{
	writefifo(cs, cs->hw.saphir.isac, 0, data, size);
}
开发者ID:xricson,项目名称:knoppix,代码行数:5,代码来源:saphir.c

示例7: hscx_write_fifo

static void
hscx_write_fifo(struct IsdnCardState *cs, int hscx, u8 *data, int size)
{
	writefifo(cs, cs->hw.saphir.hscx, hscx ? 0x40 : 0, data, size);
}
开发者ID:xricson,项目名称:knoppix,代码行数:5,代码来源:saphir.c

示例8: ipac_writefifo

static inline void
ipac_writefifo(struct IsdnCardState *cs, u8 offset, u8 *data, int size)
{
	writefifo(cs, cs->hw.elsa.isac, offset, data, size);
}
开发者ID:sarnobat,项目名称:knoppix,代码行数:5,代码来源:elsa.c

示例9: hscx_read_fifo

static void
hscx_read_fifo(struct IsdnCardState *cs, int hscx, u8 *data, int size)
{
	writefifo(cs, cs->hw.elsa.hscx, hscx ? 0x40 : 0, data, size);
}
开发者ID:sarnobat,项目名称:knoppix,代码行数:5,代码来源:elsa.c


注:本文中的writefifo函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。