POSIX compatible ftruncate() for Windows

This commit is contained in:
Markus Armbruster 2008-02-26 20:05:36 +01:00
parent adbcdf4335
commit 3c5fa553bb
2 changed files with 10 additions and 0 deletions

View file

@ -412,6 +412,15 @@ posix_fsync(int fd)
FILE_FUNCTION(FDMAP_IO_FILE, _commit(handle))
}
/*
* POSIX ftruncate()
*/
int
ftruncate(int fd, off_t length)
{
FILE_FUNCTION(FDMAP_IO_FILE, _chsize(handle, length))
}
/*
* POSIX equivalent for fstat().
* fstat() is used instead of _fstat(),