lseek_no_lfs.c 447 B

12345678910111213141516171819202122
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <errno.h>
  4. int main(int argc, char *argv[])
  5. {
  6. FILE * f = fopen(argv[0], "rb");
  7. if (!f)
  8. {
  9. printf("Error: Can't open %s, reason: %s\n", argv[0], strerror(errno));
  10. return 1;
  11. }
  12. if (fseek(f, (unsigned)4096, (int)SEEK_SET) == -1)
  13. {
  14. printf("Test failed, fseek return fail code. errno=%u (%s)\n", errno, strerror(errno));
  15. return 1;
  16. }
  17. fclose(f);
  18. return 0;
  19. }