#!/bin/sh arm-hisiv300-linux-gcc -D_FILE_OFFSET_BITS=64 main.c -o target gcc -D_FILE_OFFSET_BITS=64 main.c -o target |
#include #include #include #include #include #define FILENAME "test.raw" #define WRITEBUFSIZE (1024*1024) int main() { printf("sizeof(size_t) %d, sizeof(off_t) %d\n", sizeof(size_t), sizeof(off_t)); FILE *stream = fopen(FILENAME, "wb"); if(!stream) { perror("fopen:"); return -1; } int ret = 0; char writebuf[WRITEBUFSIZE]; int i = 0; for(i = 0;i < 6000;i++) { ret = fwrite(writebuf, WRITEBUFSIZE, 1, stream); if(ret != 1) { printf("fwrite error\n"); } } fclose(stream); return 0; } |