Closed Squirre17 closed 1 year ago
int devfd = -1; void write_to_dev(char *buf, i32 sz) { // ACT("write 0x%x byte to dev from buf %p", sz, (void *)buf); int r = write(devfd, buf, sz); if(r != sz) PANIC("write"); } void read_from_dev(char *buf, i32 sz) { // ACT("read 0x%x byte from dev to buf %p", sz, (void *)buf); int r = read(devfd, buf, sz); if(r != sz) PANIC("read"); }
user to comment it is the best way I think