[montez@localhost pystatgrab-0.3]$ ./setup.py install running install running build running build_py running build_ext building '_statgrab' extension gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -fomit-frame-pointer -pipe -march=i586 -mcpu=pentiumpro -g -fPIC -I/usr/include/python2.3 -c _statgrab.c -o build/temp.linux-i686-2.3/_statgrab.o _statgrab.c: In function `__pyx_f_9_statgrab_py_sg_set_error': _statgrab.c:341: error: `sg_error' undeclared (first use in this function) _statgrab.c:341: error: (Each undeclared identifier is reported only once _statgrab.c:341: error: for each function it appears in.) _statgrab.c:341: error: parse error before "__pyx_1" _statgrab.c:349: error: `__pyx_1' undeclared (first use in this function) _statgrab.c: In function `__pyx_f_9_statgrab_py_sg_set_error_with_errno': _statgrab.c:370: error: `sg_error' undeclared (first use in this function) _statgrab.c:370: error: parse error before "__pyx_1" _statgrab.c:378: error: `__pyx_1' undeclared (first use in this function) _statgrab.c: In function `__pyx_f_9_statgrab_py_sg_get_error': _statgrab.c:396: error: `sg_error' undeclared (first use in this function) _statgrab.c:396: error: parse error before "__pyx_v_s" _statgrab.c:403: error: `__pyx_v_s' undeclared (first use in this function) _statgrab.c: In function `__pyx_f_9_statgrab_py_sg_get_error_arg': _statgrab.c:432: warning: passing arg 1 of `PyString_FromString' makes pointer from integer without a cast _statgrab.c: In function `__pyx_f_9_statgrab_py_sg_str_error': _statgrab.c:491: error: `sg_error' undeclared (first use in this function) _statgrab.c:491: error: parse error before "__pyx_1" _statgrab.c:499: error: `__pyx_1' undeclared (first use in this function) _statgrab.c:500: warning: passing arg 1 of `PyString_FromString' makes pointer from integer without a cast _statgrab.c: In function `__pyx_f_9_statgrab_py_sg_get_host_info': _statgrab.c:532: error: `__pyx_v_s' undeclared (first use in this function) _statgrab.c: In function `__pyx_f_9_statgrab_py_sg_get_cpu_stats': _statgrab.c:628: error: `__pyx_v_s' undeclared (first use in this function) _statgrab.c: In function `__pyx_f_9_statgrab_py_sg_get_cpu_stats_diff': _statgrab.c:734: error: `__pyx_v_s' undeclared (first use in this function) _statgrab.c: In function `__pyx_f_9_statgrab_py_sg_get_cpu_percents': _statgrab.c:839: error: `__pyx_v_s' undeclared (first use in this function) _statgrab.c: In function `__pyx_f_9_statgrab_py_sg_get_mem_stats': _statgrab.c:936: error: `__pyx_v_s' undeclared (first use in this function) _statgrab.c: In function `__pyx_f_9_statgrab_py_sg_get_load_stats': _statgrab.c:1017: error: `__pyx_v_s' undeclared (first use in this function) _statgrab.c: In function `__pyx_f_9_statgrab_py_sg_get_user_stats': _statgrab.c:1092: error: `__pyx_v_s' undeclared (first use in this function) _statgrab.c: In function `__pyx_f_9_statgrab_py_sg_get_swap_stats': _statgrab.c:1163: error: `__pyx_v_s' undeclared (first use in this function) _statgrab.c: In function `__pyx_f_9_statgrab_py_sg_get_fs_stats': _statgrab.c:1245: error: `__pyx_v_s' undeclared (first use in this function) _statgrab.c: In function `__pyx_f_9_statgrab_py_sg_get_disk_io_stats': _statgrab.c:1391: error: `__pyx_v_s' undeclared (first use in this function) _statgrab.c: In function `__pyx_f_9_statgrab_py_sg_get_disk_io_stats_diff': _statgrab.c:1512: error: `__pyx_v_s' undeclared (first use in this function) _statgrab.c: In function `__pyx_f_9_statgrab_py_sg_get_network_io_stats': _statgrab.c:1638: error: `__pyx_v_s' undeclared (first use in this function) _statgrab.c: In function `__pyx_f_9_statgrab_py_sg_get_network_io_stats_diff': _statgrab.c:1789: error: `__pyx_v_s' undeclared (first use in this function) _statgrab.c: In function `__pyx_f_9_statgrab_py_sg_get_network_iface_stats': _statgrab.c:1935: error: `__pyx_v_s' undeclared (first use in this function) _statgrab.c: In function `__pyx_f_9_statgrab_py_sg_get_page_stats': _statgrab.c:2054: error: `__pyx_v_s' undeclared (first use in this function) _statgrab.c: In function `__pyx_f_9_statgrab_py_sg_get_page_stats_diff': _statgrab.c:2124: error: `__pyx_v_s' undeclared (first use in this function) _statgrab.c: In function `__pyx_f_9_statgrab_py_sg_get_process_stats': _statgrab.c:2209: error: `__pyx_v_s' undeclared (first use in this function) _statgrab.c: In function `__pyx_f_9_statgrab_py_sg_get_process_count': _statgrab.c:2406: error: `__pyx_v_s' undeclared (first use in this function) _statgrab.c: In function `init_statgrab': _statgrab.c:2526: error: `SG_ERROR_NONE' undeclared (first use in this function)_statgrab.c:2531: error: `SG_ERROR_ASPRINTF' undeclared (first use in this function) _statgrab.c:2536: error: `SG_ERROR_DEVSTAT_GETDEVS' undeclared (first use in this function) _statgrab.c:2541: error: `SG_ERROR_DEVSTAT_SELECTDEVS' undeclared (first use in this function) _statgrab.c:2546: error: `SG_ERROR_ENOENT' undeclared (first use in this function) _statgrab.c:2551: error: `SG_ERROR_GETIFADDRS' undeclared (first use in this function) _statgrab.c:2556: error: `SG_ERROR_GETMNTINFO' undeclared (first use in this function) _statgrab.c:2561: error: `SG_ERROR_GETPAGESIZE' undeclared (first use in this function) _statgrab.c:2566: error: `SG_ERROR_KSTAT_DATA_LOOKUP' undeclared (first use in this function) _statgrab.c:2571: error: `SG_ERROR_KSTAT_LOOKUP' undeclared (first use in this function) _statgrab.c:2576: error: `SG_ERROR_KSTAT_OPEN' undeclared (first use in this function) _statgrab.c:2581: error: `SG_ERROR_KSTAT_READ' undeclared (first use in this function) _statgrab.c:2586: error: `SG_ERROR_KVM_GETSWAPINFO' undeclared (first use in this function) _statgrab.c:2591: error: `SG_ERROR_KVM_OPENFILES' undeclared (first use in this function) _statgrab.c:2596: error: `SG_ERROR_MALLOC' undeclared (first use in this function) _statgrab.c:2601: error: `SG_ERROR_OPEN' undeclared (first use in this function)_statgrab.c:2606: error: `SG_ERROR_OPENDIR' undeclared (first use in this function) _statgrab.c:2611: error: `SG_ERROR_PARSE' undeclared (first use in this function) _statgrab.c:2616: error: `SG_ERROR_SETEGID' undeclared (first use in this function) _statgrab.c:2621: error: `SG_ERROR_SETEUID' undeclared (first use in this function) _statgrab.c:2626: error: `SG_ERROR_SETMNTENT' undeclared (first use in this function) _statgrab.c:2631: error: `SG_ERROR_SOCKET' undeclared (first use in this function) _statgrab.c:2636: error: `SG_ERROR_SWAPCTL' undeclared (first use in this function) _statgrab.c:2641: error: `SG_ERROR_SYSCONF' undeclared (first use in this function) _statgrab.c:2646: error: `SG_ERROR_SYSCTL' undeclared (first use in this function) _statgrab.c:2651: error: `SG_ERROR_SYSCTLBYNAME' undeclared (first use in this function) _statgrab.c:2656: error: `SG_ERROR_SYSCTLNAMETOMIB' undeclared (first use in this function) _statgrab.c:2661: error: `SG_ERROR_UNAME' undeclared (first use in this function) _statgrab.c:2666: error: `SG_ERROR_UNSUPPORTED' undeclared (first use in this function) _statgrab.c:2671: error: `SG_ERROR_XSW_VER_MISMATCH' undeclared (first use in this function) _statgrab.c:2676: error: `SG_IFACE_DUPLEX_FULL' undeclared (first use in this function) _statgrab.c:2681: error: `SG_IFACE_DUPLEX_HALF' undeclared (first use in this function) _statgrab.c:2686: error: `SG_IFACE_DUPLEX_UNKNOWN' undeclared (first use in this function) _statgrab.c:2691: error: `SG_PROCESS_STATE_RUNNING' undeclared (first use in this function) _statgrab.c:2696: error: `SG_PROCESS_STATE_SLEEPING' undeclared (first use in this function) _statgrab.c:2701: error: `SG_PROCESS_STATE_STOPPED' undeclared (first use in this function) _statgrab.c:2706: error: `SG_PROCESS_STATE_ZOMBIE' undeclared (first use in this function) _statgrab.c:2711: error: `SG_PROCESS_STATE_UNKNOWN' undeclared (first use in this function) error: command 'gcc' failed with exit status 1
_statgrab.c:341: error: `sg_error' undeclared (first use in this function)
$ find /usr -name 'statgrab.h' -exec grep -H -c sg_error \{\} ';'
/usr/include/statgrab.h:5
gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -fomit-frame-pointer -pipe -march=i586 -mcpu=pentiumpro -g -fPIC -I/usr/include/python2.3 -c _statgrab.c -E | tee out
gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -fomit-frame-pointer -pipe -march=i586 -mcpu=pentiumpro -g -fPIC -I/usr/include/python2.3 -c _statgrab.c -E | tee out
[root@localhost include]# gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -fomit-frame-pointer -pipe -march=i586 -mcpu=pentiumpro -g -fPIC -I/usr/include/python2.3 -c _statgrab.c -E | tee out gcc: _statgrab.c: No such file or directory gcc: no input files [root@localhost include]#
Couldn't get mail server response codes DEBUG MODE Line : 200 File : smtp.php
[montez@localhost pystatgrab-0.3]$ ./setup.py install running install running build running build_py running build_ext running install_lib [montez@localhost pystatgrab-0.3]$
[montez@localhost torsmotoy-0.0.2]$ ./torsmotoy.py &
[1] 11336
[montez@localhost torsmotoy-0.0.2]$ Traceback (most recent call last):
File "./torsmotoy.py", line 16, in ?
import statgrab
File "/usr/lib/python2.3/site-packages/statgrab.py", line 23, in ?
import _statgrab
ImportError: dynamic module does not define init function (init_statgrab)
[1]+ Exit 1 ./torsmotoy.py
[montez@localhost torsmotoy-0.0.2]$
diff -u /usr/{,local}/include/statgrab.h
-#ifndef STATGRAB_H
-#define STATGRAB_H
-
#include <sys/types.h>
+#ifdef NETBSD
+#include <limits.h>
+#endif
+#ifdef CYGWIN
+#include <sys/unistd.h>
+#endif
-/* FIXME typedefs for 32/64-bit types */
-/* FIXME maybe tidy up field names? */
-/* FIXME comments for less obvious fields */
-
-int sg_init(void);
-int sg_drop_privileges(void);
-
-typedef enum {
- SG_ERROR_NONE = 0,
- SG_ERROR_ASPRINTF,
- SG_ERROR_DEVSTAT_GETDEVS,
- SG_ERROR_DEVSTAT_SELECTDEVS,
- SG_ERROR_ENOENT,
- SG_ERROR_GETIFADDRS,
- SG_ERROR_GETMNTINFO,
- SG_ERROR_GETPAGESIZE,
- SG_ERROR_KSTAT_DATA_LOOKUP,
- SG_ERROR_KSTAT_LOOKUP,
- SG_ERROR_KSTAT_OPEN,
- SG_ERROR_KSTAT_READ,
- SG_ERROR_KVM_GETSWAPINFO,
- SG_ERROR_KVM_OPENFILES,
- SG_ERROR_MALLOC,
- SG_ERROR_OPEN,
- SG_ERROR_OPENDIR,
- SG_ERROR_PARSE,
- SG_ERROR_SETEGID,
- SG_ERROR_SETEUID,
- SG_ERROR_SETMNTENT,
- SG_ERROR_SOCKET,
- SG_ERROR_SWAPCTL,
- SG_ERROR_SYSCONF,
- SG_ERROR_SYSCTL,
- SG_ERROR_SYSCTLBYNAME,
- SG_ERROR_SYSCTLNAMETOMIB,
- SG_ERROR_UNAME,
- SG_ERROR_UNSUPPORTED,
- SG_ERROR_XSW_VER_MISMATCH,
- SG_ERROR_PSTAT
-} sg_error;
-
[root@localhost pystatgrab-0.3]# ./setup.py install running install running build running build_py creating build creating build/lib.linux-i686-2.3 copying statgrab.py -> build/lib.linux-i686-2.3 running build_ext building '_statgrab' extension creating build/temp.linux-i686-2.3 gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -fomit-frame-pointer -pipe -march=i586 -mcpu=pentiumpro -g -fPIC -I/usr/include/python2.3 -c _statgrab.c -o build/temp.linux-i686-2.3/_statgrab.o gcc -pthread -shared build/temp.linux-i686-2.3/_statgrab.o -o build/lib.linux-i686-2.3/_statgrab.so -lstatgrab running install_lib copying build/lib.linux-i686-2.3/_statgrab.so -> /usr/lib/python2.3/site-packages [root@localhost pystatgrab-0.3]#