Archived
3
0
This repository has been archived on 2024-06-18. You can view files and clone it, but cannot push or open issues or pull requests.
libipc-old/drop/open-write-close-fifo.c
Philippe PITTOLI b44407bc23 drop
2016-12-14 23:21:36 +01:00

33 lines
556 B
C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
int main(int argc, char * argv[])
{
(void) argc;
(void) argv;
char *fifopathin = "/tmp/123000-1-in";
size_t msize;
FILE *out = fopen (fifopathin, "wb");
printf ("opened\n");
char *buf = "coucou";
printf ("write %s\n", buf);
if ((msize = fread (buf, 6, 1, out))) {
printf ("error read %ld\n", msize);
return EXIT_FAILURE;
}
sleep (10);
printf ("write end\n");
fclose (out);
return EXIT_SUCCESS;
}