#include #include #include int main() { int fd = open("dev", O_RDWR); const char buf[] = "Some string"; printf("wrote %d bytes\n", write(fd, buf, sizeof(buf))); char retbuf[256]; int bytes_read = read(fd, retbuf, sizeof(retbuf)); printf("read %d bytes\n", bytes_read); retbuf[bytes_read] = 0; printf("ret: '%s'\n", retbuf); return 0; }