diff options
author | Seppo Jaakola <seppo.jaakola@codership.com> | 2012-10-24 23:13:43 +0300 |
---|---|---|
committer | Seppo Jaakola <seppo.jaakola@codership.com> | 2012-10-24 23:13:43 +0300 |
commit | 9b47a442b5452cb6c541e312f78746e7739e9f42 (patch) | |
tree | 29217d146f72f319b52e22820fbaae385e19c15b /storage/xtradb/os | |
parent | ef6f9a8250804efb047ad6f28e476c59d7223e85 (diff) | |
parent | 797082ca712f52437571e24962e26573d0723ad1 (diff) | |
download | mariadb-git-9b47a442b5452cb6c541e312f78746e7739e9f42.tar.gz |
References lp:1066784 - bzr merge lp:maria/5.5 (rev: 3562)
Diffstat (limited to 'storage/xtradb/os')
-rw-r--r-- | storage/xtradb/os/os0file.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/storage/xtradb/os/os0file.c b/storage/xtradb/os/os0file.c index 30b43d43da7..b42c6300ef5 100644 --- a/storage/xtradb/os/os0file.c +++ b/storage/xtradb/os/os0file.c @@ -164,6 +164,7 @@ UNIV_INTERN ibool os_aio_print_debug = FALSE; UNIV_INTERN mysql_pfs_key_t innodb_file_data_key; UNIV_INTERN mysql_pfs_key_t innodb_file_log_key; UNIV_INTERN mysql_pfs_key_t innodb_file_temp_key; +UNIV_INTERN mysql_pfs_key_t innodb_file_bmp_key; #endif /* UNIV_PFS_IO */ /** The asynchronous i/o array slot structure */ @@ -2166,6 +2167,25 @@ os_file_set_eof( #endif /* __WIN__ */ } +/***********************************************************************//** +Truncates a file at the specified position. +@return TRUE if success */ +UNIV_INTERN +ibool +os_file_set_eof_at( + os_file_t file, /*!< in: handle to a file */ + ib_uint64_t new_len)/*!< in: new file length */ +{ +#ifdef __WIN__ + /* TODO: untested! */ + return(!_chsize_s(file, new_len)); +#else + /* TODO: works only with -D_FILE_OFFSET_BITS=64 ? */ + return(!ftruncate(file, new_len)); +#endif +} + + #ifndef __WIN__ /***********************************************************************//** Wrapper to fsync(2) that retries the call on some errors. |