src/platform_posix.c
changeset 1176 367c1f9a996c
parent 1173 77b2df665bd1
child 1199 fc5cec340d26
equal deleted inserted replaced
1174:f1779b4948bd 1176:367c1f9a996c
   360     BAIL_IF_MACRO(fstat(fd, &statbuf) == -1, strerror(errno), -1);
   360     BAIL_IF_MACRO(fstat(fd, &statbuf) == -1, strerror(errno), -1);
   361     return ((PHYSFS_sint64) statbuf.st_size);
   361     return ((PHYSFS_sint64) statbuf.st_size);
   362 } /* __PHYSFS_platformFileLength */
   362 } /* __PHYSFS_platformFileLength */
   363 
   363 
   364 
   364 
   365 int __PHYSFS_platformEOF(void *opaque)
       
   366 {
       
   367     const PHYSFS_sint64 pos = __PHYSFS_platformTell(opaque);
       
   368     const PHYSFS_sint64 len = __PHYSFS_platformFileLength(opaque);
       
   369     return (pos >= len);
       
   370 } /* __PHYSFS_platformEOF */
       
   371 
       
   372 
       
   373 int __PHYSFS_platformFlush(void *opaque)
   365 int __PHYSFS_platformFlush(void *opaque)
   374 {
   366 {
   375     const int fd = *((int *) opaque);
   367     const int fd = *((int *) opaque);
   376     BAIL_IF_MACRO(fsync(fd) == -1, strerror(errno), 0);
   368     BAIL_IF_MACRO(fsync(fd) == -1, strerror(errno), 0);
   377     return 1;
   369     return 1;