Files
2024-05-01 16:26:49 +05:30

26 lines
488 B
C

#include <stdio.h>
#include <string.h>
extern int
read_from_shared_memory(char* mmap_key,
char* buffer,
unsigned int buff_size,
unsigned int bytes_to_read);
int
main(int argc, char* argv[]) {
char* key = "/introduction";
char read_buffer[128];
memset(read_buffer, 0, 128);
int rc = read_from_shared_memory(key, read_buffer, 128, 128);
if (rc < 0) {
printf("Error reading from shared memory\n");
return -1;
}
printf("Data read = %s\n", (char*)read_buffer);
return 0;
}