Skip to content

Commit

Permalink
cursor-off: use pwrite for port access
Browse files Browse the repository at this point in the history
  • Loading branch information
klange committed Feb 8, 2024
1 parent 1e63161 commit fb2628d
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions apps/cursor-off.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,9 @@
int main(int argc, char * argv[]) {
int fd = open("/dev/port", O_RDWR);
if (fd < 0) return 1;
lseek(fd, 0x3D4, SEEK_SET);
write(fd, (unsigned char[]){14}, 1);
lseek(fd, 0x3D5, SEEK_SET);
write(fd, (unsigned char[]){0xFF}, 1);
lseek(fd, 0x3D4, SEEK_SET);
write(fd, (unsigned char[]){15}, 1);
lseek(fd, 0x3D5, SEEK_SET);
write(fd, (unsigned char[]){0xFF}, 1);
pwrite(fd, (unsigned char[]){14}, 1, 0x3D4);
pwrite(fd, (unsigned char[]){0xFF}, 1, 0x3D5);
pwrite(fd, (unsigned char[]){15}, 1, 0x3D4);
pwrite(fd, (unsigned char[]){0xFF}, 1, 0x3D5);
return 0;
}

0 comments on commit fb2628d

Please sign in to comment.