search for: diocgdinfo

Displaying 1 result from an estimated 1 matches for "diocgdinfo".

2003 Sep 06
0
KERNEL BUG: lseek() broken on raw devices
...ror(t); exit(EXIT_FAILURE); } int main(int argc, char **argv) { int bs, fd = open(argc > 1 ? argv[1] : "/dev/rda0s1f", O_RDWR); int want = 0x66, t; struct disklabel dl; char *x; if (fd < 0) barf("open"); if (0 == ioctl(fd, DIOCGDINFO, &dl)) { printf("sector size: %lu\n", (unsigned long)(bs = dl.d_secsize)) ; } else barf("ioctl DIOCGDINFO"); /* this writes bs = blocksize times the byte 0x66 at offset #0 * then seeks to offset #bs/2 then writes bs times the byte 0x...