*** empty log message ***

svn path=/trunk/boinc/; revision=3980
This commit is contained in:
Daniel Hsu 2004-08-04 21:14:34 +00:00
parent 8fb3ed751b
commit 4b06dd0e3a
7 changed files with 84 additions and 3 deletions

2
aclocal.m4 vendored
View File

@ -1106,7 +1106,7 @@ AC_DEFUN([SAH_HEADER_STDCXX],[
#
# Revision Log:
# $Log$
# Revision 1.132 2004/08/04 13:11:14 davea
# Revision 1.133 2004/08/04 21:14:22 dhsu
# *** empty log message ***
#
# Revision 1.1 2003/12/11 18:38:24 korpela

View File

@ -635,7 +635,7 @@ static int mem_usage(unsigned long& vm_kb, unsigned long& rs_kb) {
FILE* f;
#if defined(HAVE_PROCFS_H)
#if defined(HAVE_PROCFS_H) && defined(HAVE__PROC_SELF_PSINFO)
// guess that this is solaris
// need psinfo_t from procfs.h
@ -655,6 +655,7 @@ static int mem_usage(unsigned long& vm_kb, unsigned long& rs_kb) {
}
#endif
#if defined(HAVE__PROC_SELF_STAT)
// guess that this is linux
//
if ((f = fopen("/proc/self/stat", "r")) != 0) {
@ -692,6 +693,7 @@ static int mem_usage(unsigned long& vm_kb, unsigned long& rs_kb) {
fclose(f);
return 0;
}
#endif
return ERR_NOT_IMPLEMENTED;
#endif

View File

@ -15803,7 +15803,7 @@ David 3 Aug 2004
util.inc
xml.inc (new)
Daniel 2004-08-3
Daniel 2004-08-03
- Fixed "prefs and venue" issue. Before: host venue assignment always
comes from the project that is contacted. Now: host venue assignment
comes from the project with the newer global prefs.
@ -15847,3 +15847,17 @@ David 4 Aug 2004
host.inc
sched/
handle_request.C
Daniel 2004-08-04
- autoconf: added HAVE__PROC_* macros
- client: added m_swap checking for Linux (via /proc/meminfo)
aclocal.m4
config.h.in
configure
configure.ac
api/
boinc_api.C
client/
hostinfo_unix.C

View File

@ -328,6 +328,7 @@ int HOST_INFO::get_host_info() {
#endif
#if defined(HAVE_SYS_SWAP_H) && defined(SC_GETNSWP)
// Solaris, ...
char buf[256];
swaptbl_t* s;
int i, n;
@ -341,6 +342,22 @@ int HOST_INFO::get_host_info() {
for (i=0; i<n; i++) {
m_swap += 512.*(double)s->swt_ent[i].ste_length;
}
#elif defined(HAVE__PROC_MEMINFO)
// Linux
FILE *fp;
if ((fp = fopen("/proc/meminfo", "r")) != 0) {
char minfo_buf[1024];
int n;
if ((n = fread(minfo_buf, sizeof(char), sizeof(minfo_buf)-1, fp))) {
char *p;
minfo_buf[n] = '\0';
if ((p = strstr(minfo_buf, "SwapTotal:"))) {
p += 10; // move past "SwapTotal:"
m_swap = (double) strtoul(p, NULL, 10);
}
}
fclose(fp);
}
#elif defined(HAVE_SYS_SYSCTL_H) && defined(CTL_VM) && defined(VM_METER)
// TODO: figure this out
/*vmtotal vm_info;

View File

@ -314,6 +314,15 @@
/* Define to 1 if /dev/tty1 exists */
#undef HAVE__DEV_TTY1
/* Define to 1 if /proc/meminfo exists */
#undef HAVE__PROC_MEMINFO
/* Define to 1 if /proc/self/psinfo exists */
#undef HAVE__PROC_SELF_PSINFO
/* Define to 1 if /proc/self/stat exists */
#undef HAVE__PROC_SELF_STAT
/* Host for this compilation */
#undef HOSTTYPE

24
configure vendored
View File

@ -7886,6 +7886,30 @@ cat >>confdefs.h <<\_ACEOF
#define HAVE__DEV_TTY1 1
_ACEOF
fi
if test -e "/proc/self/psinfo"; then
cat >>confdefs.h <<\_ACEOF
#define HAVE__PROC_SELF_PSINFO 1
_ACEOF
fi
if test -e "/proc/self/stat"; then
cat >>confdefs.h <<\_ACEOF
#define HAVE__PROC_SELF_STAT 1
_ACEOF
fi
if test -e "/proc/meminfo"; then
cat >>confdefs.h <<\_ACEOF
#define HAVE__PROC_MEMINFO 1
_ACEOF
fi

View File

@ -185,6 +185,21 @@ if test -e "/dev/tty1"; then
AC_DEFINE(HAVE__DEV_TTY1, 1, [Define to 1 if /dev/tty1 exists])
fi
dnl Check for /proc/self/psinfo (Solaris)
if test -e "/proc/self/psinfo"; then
AC_DEFINE(HAVE__PROC_SELF_PSINFO, 1, [Define to 1 if /proc/self/psinfo exists])
fi
dnl Check for /proc/self/stat (Linux)
if test -e "/proc/self/stat"; then
AC_DEFINE(HAVE__PROC_SELF_STAT, 1, [Define to 1 if /proc/self/stat exists])
fi
dnl Check for /proc/meminfo (Linux)
if test -e "/proc/meminfo"; then
AC_DEFINE(HAVE__PROC_MEMINFO, 1, [Define to 1 if /proc/meminfo exists])
fi
dnl by default, create static binaries on linux.
dnl [if [ "$target_os" = "linux-gnu" ]; then
dnl STATIC_FLAGS="-static"