Une collection de notes diverses sur des trucs et astuces pour faire des choses avec un ordinateur...
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
570 B

/*** named pipe --- receiver ***/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/stat.h> /* for mkfifo */
#include <fcntl.h>
#include "my-fifo.h"
int main(int argc, char *argv[])
int fifo;
Message message;
double localTS;
if (argc!=2) {
fprintf(stderr, "%s need a fifo name\n", argv[0]);
fifo = mkfifo(argv[1], O_RDONLY|O_CREAT);
if (-1==fifo) {
perror("mkfifo fail");
read(fifo, &message, sizeof(Message));
localTS = dtime();
printf("%f %f\n", localTS, message.timestamp);
return 0;