#include #include #include #include #include #include #include "../include/chardev.h" // basic write int main(int argc, char **argv) { int fd; if (argc != 3) { printf("usage: prog device-file-path message\n"); return EXIT_FAILURE; } fd = open(argv[1], O_RDWR); if (fd < 0) { printf("[ERROR]: Could not open device!\n"); } write(fd, argv[2], strlen(argv[2])); if (close(fd) < 0) { printf("[ERROR]: Could not close!\n"); } return 0; }