cursor-off: use pwrite for port access

This commit is contained in:
K. Lange 2024-02-08 16:49:15 +09:00
parent 1e6316122a
commit fb2628d619

View File

@ -19,13 +19,9 @@
int main(int argc, char * argv[]) { int main(int argc, char * argv[]) {
int fd = open("/dev/port", O_RDWR); int fd = open("/dev/port", O_RDWR);
if (fd < 0) return 1; if (fd < 0) return 1;
lseek(fd, 0x3D4, SEEK_SET); pwrite(fd, (unsigned char[]){14}, 1, 0x3D4);
write(fd, (unsigned char[]){14}, 1); pwrite(fd, (unsigned char[]){0xFF}, 1, 0x3D5);
lseek(fd, 0x3D5, SEEK_SET); pwrite(fd, (unsigned char[]){15}, 1, 0x3D4);
write(fd, (unsigned char[]){0xFF}, 1); pwrite(fd, (unsigned char[]){0xFF}, 1, 0x3D5);
lseek(fd, 0x3D4, SEEK_SET);
write(fd, (unsigned char[]){15}, 1);
lseek(fd, 0x3D5, SEEK_SET);
write(fd, (unsigned char[]){0xFF}, 1);
return 0; return 0;
} }