#define _USE_LARGEFILE #define _FILE_OFFSET_BITS 64 #include #include #include #include #include int main(int argc, char **argv) { int f; uint64_t buf[4096/8], ofs, size; f = open(argv[1], O_RDWR | O_CREAT|O_TRUNC, 0666); if (f == -1) exit(1); ofs = atoll(argv[2]) << 20; size = atoll(argv[3]) << 20; if (lseek(f, ofs, SEEK_SET) != ofs) exit(2); for (; ofs