Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
40bd7706
Commit
40bd7706
authored
Feb 20, 1998
by
Jack Jansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add fstat() if using GUSI
parent
c2952bcb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
24 deletions
+29
-24
Mac/Modules/macmodule.c
Mac/Modules/macmodule.c
+29
-24
No files found.
Mac/Modules/macmodule.c
View file @
40bd7706
...
...
@@ -72,6 +72,9 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#if defined(MPW) || defined(USE_GUSI)
#define WEHAVE_DUP
#endif
#if defined(USE_GUSI)
#define WEHAVE_FSTAT
#endif
#include "macdefs.h"
#ifdef USE_GUSI
...
...
@@ -449,7 +452,6 @@ mac_stat(self, args)
Py_END_ALLOW_THREADS
if
(
res
!=
0
)
return
mac_error
();
#if 1
return
Py_BuildValue
(
"(lllllllddd)"
,
(
long
)
st
.
st_mode
,
(
long
)
st
.
st_ino
,
...
...
@@ -461,8 +463,25 @@ mac_stat(self, args)
(
double
)
st
.
st_atime
,
(
double
)
st
.
st_mtime
,
(
double
)
st
.
st_ctime
);
#else
return
Py_BuildValue
(
"(llllllllll)"
,
}
#ifdef WEHAVE_FSTAT
static
PyObject
*
mac_fstat
(
self
,
args
)
PyObject
*
self
;
PyObject
*
args
;
{
struct
stat
st
;
long
fd
;
int
res
;
if
(
!
PyArg_Parse
(
args
,
"l"
,
&
fd
))
return
NULL
;
Py_BEGIN_ALLOW_THREADS
res
=
fstat
((
int
)
fd
,
&
st
);
Py_END_ALLOW_THREADS
if
(
res
!=
0
)
return
mac_error
();
return
Py_BuildValue
(
"(lllllllddd)"
,
(
long
)
st
.
st_mode
,
(
long
)
st
.
st_ino
,
(
long
)
st
.
st_dev
,
...
...
@@ -470,11 +489,11 @@ mac_stat(self, args)
(
long
)
st
.
st_uid
,
(
long
)
st
.
st_gid
,
(
long
)
st
.
st_size
,
(
long
)
st
.
st_atime
,
(
long
)
st
.
st_mtime
,
(
long
)
st
.
st_ctime
);
#endif
(
double
)
st
.
st_atime
,
(
double
)
st
.
st_mtime
,
(
double
)
st
.
st_ctime
);
}
#endif
/* WEHAVE_FSTAT */
static
PyObject
*
mac_xstat
(
self
,
args
)
...
...
@@ -502,7 +521,6 @@ mac_xstat(self, args)
Py_END_ALLOW_THREADS
if
(
res
!=
0
)
return
mac_error
();
#if 1
return
Py_BuildValue
(
"(llllllldddls#s#)"
,
(
long
)
st
.
st_mode
,
(
long
)
st
.
st_ino
,
...
...
@@ -517,22 +535,6 @@ mac_xstat(self, args)
(
long
)
mst
.
st_rsize
,
mst
.
st_creator
,
4
,
mst
.
st_type
,
4
);
#else
return
Py_BuildValue
(
"(llllllllllls#s#)"
,
(
long
)
st
.
st_mode
,
(
long
)
st
.
st_ino
,
(
long
)
st
.
st_dev
,
(
long
)
st
.
st_nlink
,
(
long
)
st
.
st_uid
,
(
long
)
st
.
st_gid
,
(
long
)
st
.
st_size
,
(
long
)
st
.
st_atime
,
(
long
)
st
.
st_mtime
,
(
long
)
st
.
st_ctime
,
(
long
)
mst
.
st_rsize
,
mst
.
st_creator
,
4
,
mst
.
st_type
,
4
);
#endif
}
static
PyObject
*
...
...
@@ -597,6 +599,9 @@ static struct PyMethodDef mac_methods[] = {
#endif
#ifdef WEHAVE_FDOPEN
{
"fdopen"
,
mac_fdopen
},
#endif
#ifdef WEHAVE_FSTAT
{
"fstat"
,
mac_fstat
},
#endif
{
"getbootvol"
,
mac_getbootvol
},
/* non-standard */
{
"getcwd"
,
mac_getcwd
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment