working named pipe and pipe simple with c and golang

This commit is contained in:
talksik
2023-11-21 09:11:47 -08:00
commit 61a43bd732
10 changed files with 178 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main() {
printf("starting C program!\n");
char buffer[100];
ssize_t bytesRead = read(STDIN_FILENO, buffer, sizeof(buffer));
if (bytesRead < 0) {
perror("Error reading from pipe");
return 1;
}
printf("C Program received: %.*s\n", (int)bytesRead, buffer);
return 0;
}