1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-01 17:39:21 +03:00

Addresses #1531 Ported stat/fstat. toku_stat, toku_fstat (struct is toku_struct_stat), poisoned the use of the functions

git-svn-id: file:///svn/toku/tokudb@10491 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
Yoni Fogel
2013-04-16 23:57:45 -04:00
parent cd11b163cd
commit c191b67324
28 changed files with 231 additions and 94 deletions

View File

@@ -49,7 +49,7 @@ toku_os_get_phys_memory_size(void) {
int
toku_os_get_file_size(int fildes, int64_t *fsize) {
struct stat sbuf;
toku_struct_stat sbuf;
int r = fstat(fildes, &sbuf);
if (r==0) {
*fsize = sbuf.st_size;
@@ -59,7 +59,7 @@ toku_os_get_file_size(int fildes, int64_t *fsize) {
int
toku_os_get_unique_file_id(int fildes, struct fileid *id) {
struct stat statbuf;
toku_struct_stat statbuf;
memset(id, 0, sizeof(*id));
int r=fstat(fildes, &statbuf);
if (r==0) {
@@ -190,3 +190,16 @@ toku_os_get_max_process_data_size(uint64_t *maxdata) {
r = errno;
return r;
}
int
toku_stat(const char *name, toku_struct_stat *buf) {
int r = stat(name, buf);
return r;
}
int
toku_stat(int fd, toku_struct_fstat *buf) {
int r = fstat(fd, buf);
return r;
}