#include #include #include #include #include #define PIPE_MINOR 0 int pipe_fd; int main (int argc, char *argv[]) { char devname[32], buf[32]; sprintf(devname, "/dev/rtp%d", PIPE_MINOR); pipe_fd = open(devname, O_RDWR); if (pipe_fd < 0) { printf("cannot open pipe %s\n", devname); exit(1); } read(pipe_fd, buf, sizeof(buf)); printf("read from pipe: %s\n", buf); read(pipe_fd, buf, sizeof(buf)); printf("read from pipe: %s\n", buf); write(pipe_fd, "World", sizeof("World")); printf("written string 'World' - see kernel log\n"); close(pipe_fd); }