Implement missing osd_truncate().

Fixes linking on Unix when SDL is disabled.

Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
This commit is contained in:
Thomas Klausner 2015-07-14 21:50:06 +02:00
parent ee5bdcffe6
commit 923b78aa71

View File

@ -101,6 +101,25 @@ file_error osd_write(osd_file *file, const void *buffer, UINT64 offset, UINT32 l
}
//============================================================
// osd_truncate
//============================================================
file_error osd_truncate(osd_file *file, UINT64 offset)
{
UINT32 result;
if (!file)
return FILERR_FAILURE;
result = ftruncate(fileno((FILE *)file), offset);
if (!result)
return FILERR_FAILURE;
return FILERR_NONE;
}
//============================================================
// osd_rmfile
//============================================================