Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.package
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kasra Jamshidi
slapos.package
Commits
bffefc84
Commit
bffefc84
authored
Apr 30, 2013
by
Jondy Zhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch psutil for cygwin
parent
a53a068c
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
552 additions
and
10 deletions
+552
-10
windows/psutil/psutil.egg-info/PKG-INFO
windows/psutil/psutil.egg-info/PKG-INFO
+3
-3
windows/psutil/psutil.egg-info/SOURCES.txt
windows/psutil/psutil.egg-info/SOURCES.txt
+2
-0
windows/psutil/psutil.egg-info/top_level.txt
windows/psutil/psutil.egg-info/top_level.txt
+1
-2
windows/psutil/psutil/__init__.py
windows/psutil/psutil/__init__.py
+10
-1
windows/psutil/psutil/_psutil_mswindows.c
windows/psutil/psutil/_psutil_mswindows.c
+15
-2
windows/psutil/psutil/arch/mswindows/security.c
windows/psutil/psutil/arch/mswindows/security.c
+2
-0
windows/psutil/psutil/arch/mswindows/security.h
windows/psutil/psutil/arch/mswindows/security.h
+6
-2
windows/psutil/psutil/tchar.h
windows/psutil/psutil/tchar.h
+488
-0
windows/psutil/setup.py
windows/psutil/setup.py
+25
-0
No files found.
windows/psutil/psutil.egg-info/PKG-INFO
View file @
bffefc84
Metadata-Version: 1.
1
Metadata-Version: 1.
0
Name: psutil
Name: psutil
Version: 0.6.1
Version: 0.6.
0
1
Summary: A process and system utilities module for Python
Summary: A process and system utilities module for Python
Home-page: http://code.google.com/p/psutil/
Home-page: http://code.google.com/p/psutil/
Author: Giampaolo Rodola
Author: Giampaolo Rodola
Author-email: g.rodola <at> gmail <dot> com
Author-email: g.rodola <at> gmail <dot> com
License: License :: OSI Approved :: BSD License
License: License :: OSI Approved :: BSD License
Download-URL: http://psutil.googlecode.com/files/psutil-0.6.1.tar.gz
Download-URL: http://psutil.googlecode.com/files/psutil-0.6.
0
1.tar.gz
Description: ===========
Description: ===========
Quick links
Quick links
===========
===========
...
...
windows/psutil/psutil.egg-info/SOURCES.txt
View file @
bffefc84
...
@@ -4,6 +4,7 @@ INSTALL
...
@@ -4,6 +4,7 @@ INSTALL
LICENSE
LICENSE
MANIFEST.in
MANIFEST.in
README
README
setup.cfg
setup.py
setup.py
examples/disk_usage.py
examples/disk_usage.py
examples/free.py
examples/free.py
...
@@ -37,6 +38,7 @@ psutil/_psutil_osx.h
...
@@ -37,6 +38,7 @@ psutil/_psutil_osx.h
psutil/_psutil_posix.c
psutil/_psutil_posix.c
psutil/_psutil_posix.h
psutil/_psutil_posix.h
psutil/error.py
psutil/error.py
psutil/tchar.h
psutil.egg-info/PKG-INFO
psutil.egg-info/PKG-INFO
psutil.egg-info/SOURCES.txt
psutil.egg-info/SOURCES.txt
psutil.egg-info/dependency_links.txt
psutil.egg-info/dependency_links.txt
...
...
windows/psutil/psutil.egg-info/top_level.txt
View file @
bffefc84
psutil
psutil
_psutil_linux
_psutil_mswindows
_psutil_posix
windows/psutil/psutil/__init__.py
View file @
bffefc84
...
@@ -14,7 +14,7 @@ Python.
...
@@ -14,7 +14,7 @@ Python.
from
__future__
import
division
from
__future__
import
division
__version__
=
"0.6.1"
__version__
=
"0.6.
0
1"
version_info
=
tuple
([
int
(
num
)
for
num
in
__version__
.
split
(
'.'
)])
version_info
=
tuple
([
int
(
num
)
for
num
in
__version__
.
split
(
'.'
)])
__all__
=
[
__all__
=
[
...
@@ -90,6 +90,15 @@ elif sys.platform.startswith("cygwin"):
...
@@ -90,6 +90,15 @@ elif sys.platform.startswith("cygwin"):
NORMAL_PRIORITY_CLASS
,
NORMAL_PRIORITY_CLASS
,
REALTIME_PRIORITY_CLASS
)
REALTIME_PRIORITY_CLASS
)
elif
sys
.
platform
.
startswith
(
"cygwin"
):
import
psutil._psmswindows
as
_psplatform
from
psutil._psmswindows
import
(
ABOVE_NORMAL_PRIORITY_CLASS
,
BELOW_NORMAL_PRIORITY_CLASS
,
HIGH_PRIORITY_CLASS
,
IDLE_PRIORITY_CLASS
,
NORMAL_PRIORITY_CLASS
,
REALTIME_PRIORITY_CLASS
)
elif
sys
.
platform
.
startswith
(
"darwin"
):
elif
sys
.
platform
.
startswith
(
"darwin"
):
import
psutil._psosx
as
_psplatform
import
psutil._psosx
as
_psplatform
...
...
windows/psutil/psutil/_psutil_mswindows.c
View file @
bffefc84
...
@@ -17,14 +17,22 @@
...
@@ -17,14 +17,22 @@
#include <time.h>
#include <time.h>
#include <lm.h>
#include <lm.h>
#include <WinIoCtl.h>
#include <WinIoCtl.h>
#if defined(__CYGWIN__)
#include "tchar.h"
#else
#include <tchar.h>
#include <tchar.h>
#endif
#include <tlhelp32.h>
#include <tlhelp32.h>
#include <winsock2.h>
#include <winsock2.h>
#include <iphlpapi.h>
#include <iphlpapi.h>
#include <wtsapi32.h>
#include <wtsapi32.h>
// Link with Iphlpapi.lib
// Link with Iphlpapi.lib
#if !defined(__CYGWIN__)
#pragma comment(lib, "IPHLPAPI.lib")
#pragma comment(lib, "IPHLPAPI.lib")
#endif
#include "_psutil_mswindows.h"
#include "_psutil_mswindows.h"
#include "_psutil_common.h"
#include "_psutil_common.h"
...
@@ -552,7 +560,11 @@ static PyObject*
...
@@ -552,7 +560,11 @@ static PyObject*
get_process_exe
(
PyObject
*
self
,
PyObject
*
args
)
{
get_process_exe
(
PyObject
*
self
,
PyObject
*
args
)
{
long
pid
;
long
pid
;
HANDLE
hProcess
;
HANDLE
hProcess
;
#if defined(_UNICODE)
wchar_t
exe
[
MAX_PATH
];
wchar_t
exe
[
MAX_PATH
];
#else
char
exe
[
MAX_PATH
];
#endif
DWORD
nSize
=
MAX_PATH
;
DWORD
nSize
=
MAX_PATH
;
if
(
!
PyArg_ParseTuple
(
args
,
"l"
,
&
pid
))
{
if
(
!
PyArg_ParseTuple
(
args
,
"l"
,
&
pid
))
{
...
@@ -1379,7 +1391,7 @@ static char *state_to_string(ULONG state)
...
@@ -1379,7 +1391,7 @@ static char *state_to_string(ULONG state)
}
}
/* mingw support */
/* mingw support */
#if
ndef _IPRTRMIB_H
#if
!defined(_IPRTRMIB_H) && !defined(__CYGWIN__)
typedef
struct
_MIB_TCP6ROW_OWNER_PID
typedef
struct
_MIB_TCP6ROW_OWNER_PID
{
{
UCHAR
ucLocalAddr
[
16
];
UCHAR
ucLocalAddr
[
16
];
...
@@ -1429,6 +1441,7 @@ typedef struct _MIB_UDPTABLE_OWNER_PID
...
@@ -1429,6 +1441,7 @@ typedef struct _MIB_UDPTABLE_OWNER_PID
#endif
#endif
/* end of mingw support */
/* end of mingw support */
#if ! defined(__CYGWIN__)
typedef
struct
_MIB_UDP6ROW_OWNER_PID
{
typedef
struct
_MIB_UDP6ROW_OWNER_PID
{
UCHAR
ucLocalAddr
[
16
];
UCHAR
ucLocalAddr
[
16
];
DWORD
dwLocalScopeId
;
DWORD
dwLocalScopeId
;
...
@@ -1441,7 +1454,7 @@ typedef struct _MIB_UDP6TABLE_OWNER_PID
...
@@ -1441,7 +1454,7 @@ typedef struct _MIB_UDP6TABLE_OWNER_PID
DWORD
dwNumEntries
;
DWORD
dwNumEntries
;
MIB_UDP6ROW_OWNER_PID
table
[
ANY_SIZE
];
MIB_UDP6ROW_OWNER_PID
table
[
ANY_SIZE
];
}
MIB_UDP6TABLE_OWNER_PID
,
*
PMIB_UDP6TABLE_OWNER_PID
;
}
MIB_UDP6TABLE_OWNER_PID
,
*
PMIB_UDP6TABLE_OWNER_PID
;
#endif
#define ConnDecrefPyObjs() Py_DECREF(_AF_INET); \
#define ConnDecrefPyObjs() Py_DECREF(_AF_INET); \
Py_DECREF(_AF_INET6);\
Py_DECREF(_AF_INET6);\
...
...
windows/psutil/psutil/arch/mswindows/security.c
View file @
bffefc84
...
@@ -12,6 +12,8 @@
...
@@ -12,6 +12,8 @@
#include <windows.h>
#include <windows.h>
#include <Python.h>
#include <Python.h>
#include "security.h"
/*
/*
* Convert a process handle to a process token handle.
* Convert a process handle to a process token handle.
*/
*/
...
...
windows/psutil/psutil/arch/mswindows/security.h
View file @
bffefc84
...
@@ -11,10 +11,14 @@
...
@@ -11,10 +11,14 @@
#include <windows.h>
#include <windows.h>
#if defined(__CYGWIN__)
#define PyErr_SetFromWindowsErr(n) \
PyErr_Format(PyExc_RuntimeError, "Windoows Error: %d\n", n)
#endif
BOOL
SetPrivilege
(
HANDLE
hToken
,
LPCTSTR
Privilege
,
BOOL
bEnablePrivilege
);
BOOL
SetPrivilege
(
HANDLE
hToken
,
LPCTSTR
Privilege
,
BOOL
bEnablePrivilege
);
int
SetSeDebug
();
int
SetSeDebug
(
void
);
int
UnsetSeDebug
();
int
UnsetSeDebug
(
void
);
HANDLE
token_from_handle
(
HANDLE
hProcess
);
HANDLE
token_from_handle
(
HANDLE
hProcess
);
int
HasSystemPrivilege
(
HANDLE
hProcess
);
int
HasSystemPrivilege
(
HANDLE
hProcess
);
windows/psutil/psutil/tchar.h
0 → 100644
View file @
bffefc84
This diff is collapsed.
Click to expand it.
windows/psutil/setup.py
View file @
bffefc84
...
@@ -67,6 +67,31 @@ if sys.platform.startswith("win32"):
...
@@ -67,6 +67,31 @@ if sys.platform.startswith("win32"):
#extra_compile_args=["/Z7"],
#extra_compile_args=["/Z7"],
#extra_link_args=["/DEBUG"]
#extra_link_args=["/DEBUG"]
)]
)]
elif
sys
.
platform
.
startswith
(
"cygwin"
):
def
get_winver
():
return
'0x0503'
maj
,
min
=
sys
.
getwindowsversion
()[
0
:
2
]
return
'0x0%s'
%
((
maj
*
100
)
+
min
)
extensions
=
[
Extension
(
'_psutil_mswindows'
,
sources
=
[
'psutil/_psutil_mswindows.c'
,
'psutil/_psutil_common.c'
,
'psutil/arch/mswindows/process_info.c'
,
'psutil/arch/mswindows/process_handles.c'
,
'psutil/arch/mswindows/security.c'
],
define_macros
=
[(
'_WIN32_WINNT'
,
get_winver
()),
(
'_AVAIL_WINVER_'
,
get_winver
()),
# ('_UNICODE', 1),
(
'USE_SYS_TYPES_FD_SET'
,
1
),
(
'__USE_W32_SOCKETS'
,
1
)],
libraries
=
[
"psapi"
,
"kernel32"
,
"advapi32"
,
"shell32"
,
"netapi32"
,
"iphlpapi"
,
"wtsapi32"
],
#extra_compile_args=["/Z7"],
#extra_link_args=["/DEBUG"]
)]
# OS X
# OS X
elif
sys
.
platform
.
startswith
(
"darwin"
):
elif
sys
.
platform
.
startswith
(
"darwin"
):
extensions
=
[
Extension
(
'_psutil_osx'
,
extensions
=
[
Extension
(
'_psutil_osx'
,
...
...
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