Commit 0c9608cf authored by Guido van Rossum's avatar Guido van Rossum

Portability fix for [f]statvfs() return tuple: no longer return the

f_fsid field, since it's not a scalar on all systems supporting this
call (in particular, it's a tuple of two longs on AIX).  Since it's
not particularly useful, just nuke it.  Adapted the doc strings too.
parent c256ece8
...@@ -527,7 +527,7 @@ from a \ctype{stat} structure. ...@@ -527,7 +527,7 @@ from a \ctype{stat} structure.
\begin{funcdesc}{statvfs}{path} \begin{funcdesc}{statvfs}{path}
Perform a \cfunction{statvfs()} system call on the given path. The Perform a \cfunction{statvfs()} system call on the given path. The
return value is a tuple of 11 integers giving the most common return value is a tuple of 10 integers giving the most common
members of the \ctype{statvfs} structure, in the order members of the \ctype{statvfs} structure, in the order
\code{f_bsize}, \code{f_bsize},
\code{f_frsize}, \code{f_frsize},
...@@ -537,7 +537,6 @@ members of the \ctype{statvfs} structure, in the order ...@@ -537,7 +537,6 @@ members of the \ctype{statvfs} structure, in the order
\code{f_files}, \code{f_files},
\code{f_ffree}, \code{f_ffree},
\code{f_favail}, \code{f_favail},
\code{f_fsid},
\code{f_flag}, \code{f_flag},
\code{f_namemax}. \code{f_namemax}.
Availability: \UNIX{}. Availability: \UNIX{}.
......
...@@ -3025,8 +3025,8 @@ posix_WSTOPSIG(self, args) ...@@ -3025,8 +3025,8 @@ posix_WSTOPSIG(self, args)
#include <sys/statvfs.h> #include <sys/statvfs.h>
static char posix_fstatvfs__doc__[] = static char posix_fstatvfs__doc__[] =
"fstatvfs(fd) -> \ "fstatvfs(fd) -> \n\
(bsize,frsize,blocks,bfree,bavail,files,ffree,favail,fsid,flag, namemax)\n\ (bsize, frsize, blocks, bfree, bavail, files, ffree, favail, flag, namemax)\n\
Perform an fstatvfs system call on the given fd."; Perform an fstatvfs system call on the given fd.";
static PyObject * static PyObject *
...@@ -3044,7 +3044,7 @@ posix_fstatvfs(self, args) ...@@ -3044,7 +3044,7 @@ posix_fstatvfs(self, args)
if (res != 0) if (res != 0)
return posix_error(); return posix_error();
#if !defined(HAVE_LARGEFILE_SUPPORT) #if !defined(HAVE_LARGEFILE_SUPPORT)
return Py_BuildValue("(lllllllllll)", return Py_BuildValue("(llllllllll)",
(long) st.f_bsize, (long) st.f_bsize,
(long) st.f_frsize, (long) st.f_frsize,
(long) st.f_blocks, (long) st.f_blocks,
...@@ -3053,11 +3053,10 @@ posix_fstatvfs(self, args) ...@@ -3053,11 +3053,10 @@ posix_fstatvfs(self, args)
(long) st.f_files, (long) st.f_files,
(long) st.f_ffree, (long) st.f_ffree,
(long) st.f_favail, (long) st.f_favail,
(long) st.f_fsid,
(long) st.f_flag, (long) st.f_flag,
(long) st.f_namemax); (long) st.f_namemax);
#else #else
return Py_BuildValue("(llLLLLLLlll)", return Py_BuildValue("(llLLLLLLll)",
(long) st.f_bsize, (long) st.f_bsize,
(long) st.f_frsize, (long) st.f_frsize,
(LONG_LONG) st.f_blocks, (LONG_LONG) st.f_blocks,
...@@ -3066,7 +3065,6 @@ posix_fstatvfs(self, args) ...@@ -3066,7 +3065,6 @@ posix_fstatvfs(self, args)
(LONG_LONG) st.f_files, (LONG_LONG) st.f_files,
(LONG_LONG) st.f_ffree, (LONG_LONG) st.f_ffree,
(LONG_LONG) st.f_favail, (LONG_LONG) st.f_favail,
(long) st.f_fsid,
(long) st.f_flag, (long) st.f_flag,
(long) st.f_namemax); (long) st.f_namemax);
#endif #endif
...@@ -3078,8 +3076,8 @@ posix_fstatvfs(self, args) ...@@ -3078,8 +3076,8 @@ posix_fstatvfs(self, args)
#include <sys/statvfs.h> #include <sys/statvfs.h>
static char posix_statvfs__doc__[] = static char posix_statvfs__doc__[] =
"statvfs(path) -> \ "statvfs(path) -> \n\
(bsize,frsize,blocks,bfree,bavail,files,ffree,favail,fsid,flag, namemax)\n\ (bsize, frsize, blocks, bfree, bavail, files, ffree, favail, flag, namemax)\n\
Perform a statvfs system call on the given path."; Perform a statvfs system call on the given path.";
static PyObject * static PyObject *
...@@ -3098,7 +3096,7 @@ posix_statvfs(self, args) ...@@ -3098,7 +3096,7 @@ posix_statvfs(self, args)
if (res != 0) if (res != 0)
return posix_error_with_filename(path); return posix_error_with_filename(path);
#if !defined(HAVE_LARGEFILE_SUPPORT) #if !defined(HAVE_LARGEFILE_SUPPORT)
return Py_BuildValue("(lllllllllll)", return Py_BuildValue("(llllllllll)",
(long) st.f_bsize, (long) st.f_bsize,
(long) st.f_frsize, (long) st.f_frsize,
(long) st.f_blocks, (long) st.f_blocks,
...@@ -3107,11 +3105,10 @@ posix_statvfs(self, args) ...@@ -3107,11 +3105,10 @@ posix_statvfs(self, args)
(long) st.f_files, (long) st.f_files,
(long) st.f_ffree, (long) st.f_ffree,
(long) st.f_favail, (long) st.f_favail,
(long) st.f_fsid,
(long) st.f_flag, (long) st.f_flag,
(long) st.f_namemax); (long) st.f_namemax);
#else /* HAVE_LARGEFILE_SUPPORT */ #else /* HAVE_LARGEFILE_SUPPORT */
return Py_BuildValue("(llLLLLLLlll)", return Py_BuildValue("(llLLLLLLll)",
(long) st.f_bsize, (long) st.f_bsize,
(long) st.f_frsize, (long) st.f_frsize,
(LONG_LONG) st.f_blocks, (LONG_LONG) st.f_blocks,
...@@ -3120,7 +3117,6 @@ posix_statvfs(self, args) ...@@ -3120,7 +3117,6 @@ posix_statvfs(self, args)
(LONG_LONG) st.f_files, (LONG_LONG) st.f_files,
(LONG_LONG) st.f_ffree, (LONG_LONG) st.f_ffree,
(LONG_LONG) st.f_favail, (LONG_LONG) st.f_favail,
(long) st.f_fsid,
(long) st.f_flag, (long) st.f_flag,
(long) st.f_namemax); (long) st.f_namemax);
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment