本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}