Набросок примера работы с FIFO
This commit is contained in:
18
code/C/FIFO/writer.c
Normal file
18
code/C/FIFO/writer.c
Normal file
@@ -0,0 +1,18 @@
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#define FIFO_NAME "example_fifo"
|
||||
|
||||
int main() {
|
||||
char message[1024] = "OLOLO MESSAGE";
|
||||
|
||||
mkfifo(FIFO_NAME, 0666);
|
||||
int fd = open(FIFO_NAME, O_WRONLY);
|
||||
write(fd, message, sizeof(message));
|
||||
close(fd);
|
||||
// unlink(FIFO_NAME);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user