diff options
Diffstat (limited to 'libsbutil/src/file.c')
-rw-r--r-- | libsbutil/src/file.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/libsbutil/src/file.c b/libsbutil/src/file.c index a1a4a0e..5a361f4 100644 --- a/libsbutil/src/file.c +++ b/libsbutil/src/file.c @@ -21,13 +21,13 @@ rc_file_exists (const char *pathname) bool rc_is_file (const char *pathname, bool follow_link) { - struct stat buf; + struct stat64 buf; int retval; if (!check_str (pathname)) return false; - retval = follow_link ? stat (pathname, &buf) : lstat (pathname, &buf); + retval = follow_link ? stat64 (pathname, &buf) : lstat64 (pathname, &buf); if ((-1 != retval) && (S_ISREG (buf.st_mode))) retval = true; else @@ -39,13 +39,13 @@ rc_is_file (const char *pathname, bool follow_link) bool rc_is_dir (const char *pathname, bool follow_link) { - struct stat buf; + struct stat64 buf; int retval; if (!check_str (pathname)) return false; - retval = follow_link ? stat (pathname, &buf) : lstat (pathname, &buf); + retval = follow_link ? stat64 (pathname, &buf) : lstat64 (pathname, &buf); if ((-1 != retval) && (S_ISDIR (buf.st_mode))) retval = true; else @@ -54,16 +54,16 @@ rc_is_dir (const char *pathname, bool follow_link) return retval; } -off_t +off64_t rc_get_size (const char *pathname, bool follow_link) { - struct stat buf; + struct stat64 buf; int retval; if (!check_str (pathname)) return 0; - retval = follow_link ? stat (pathname, &buf) : lstat (pathname, &buf); + retval = follow_link ? stat64 (pathname, &buf) : lstat64 (pathname, &buf); if (-1 != retval) retval = buf.st_size; else @@ -76,7 +76,7 @@ char ** rc_ls_dir (const char *pathname, bool hidden, bool sort) { DIR *dp; - struct dirent *dir_entry; + struct dirent64 *dir_entry; char **dirlist = NULL; if (!check_arg_str (pathname)) @@ -102,7 +102,7 @@ rc_ls_dir (const char *pathname, bool hidden, bool sort) { /* Clear errno to distinguish between EOF and error */ errno = 0; - dir_entry = readdir (dp); + dir_entry = readdir64 (dp); /* Only an error if 'errno' != 0, else EOF */ if ((NULL == dir_entry) && (0 != errno)) { @@ -184,10 +184,10 @@ error: int rc_file_map (const char *filename, char **buf, size_t * bufsize) { - struct stat stats; + struct stat64 stats; int fd; - fd = open (filename, O_RDONLY); + fd = open64 (filename, O_RDONLY); if (fd < 0) { rc_errno_set (errno); @@ -195,7 +195,7 @@ rc_file_map (const char *filename, char **buf, size_t * bufsize) return -1; } - if (fstat (fd, &stats) < 0) + if (fstat64 (fd, &stats) < 0) { rc_errno_set (errno); DBG_MSG ("Failed to stat file!\n"); |