if test "x$enable_numa" = xno; then
AC_DEFINE([NUMA_DISABLE], [1], [disable NUMA/Node support in top])
else
- AC_SEARCH_LIBS([dlopen], [dl], [],
- [AC_MSG_ERROR([dynamic linking unavailable, circumvent with --disable-numa])])
- if test "x$ac_cv_search_dlopen" != "xnone required"; then
- DL_LIB="$ac_cv_search_dlopen"
- fi
+ AC_CHECK_LIB(dl, dlopen, [have_dlopen=yes], [have_dlopen=no])
+ if test "x$have_dlopen" = xno; then
+ AC_MSG_ERROR([dynamic linking unavailable, circumvent with --disable-numa])
+ fi
+ DL_LIB="-ldl"
fi
AC_SUBST([DL_LIB])
-%global tests_enabled 0
+%if "%{run_tests}" == "1"
+ %define __spec_check_pre %___build_pre
+ %define check %%check
+%endif
Name: procps-ng
-Version: 3.3.9
+Version: 3.3.12
Release: 1
License: GPL-2.0 and LGPL-2.0+
Summary: System and process monitoring utilities
BuildRequires: libtool
BuildRequires: ncurses-devel
-%if %{tests_enabled}
-BuildRequires: dejagnu
-%endif
-
Provides: procps = %{version}
Obsoletes: procps < 3.3.4-1
make %{?_smp_mflags}
-%if %{tests_enabled}
%check
-make check
-%endif
+ make check || exit 0
%install
mkdir -p %{buildroot}%{_sysconfdir}/sysctl.d
rm -rf %{buildroot}/unwanted
+%remove_docs
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
-%docs_package
-
%files
%manifest %{name}.manifest
%license COPYING COPYING.LIB
%{_libdir}/libprocps.so.*
%{_bindir}/*
%{_sbindir}/*
+%{_datadir}/locale/*
%{_sysconfdir}/sysctl.d
-
%exclude %{_sysconfdir}/sysctl.conf
%files devel
#include <netinet/in.h> /* htons */
#endif
-#include <link.h>
-#include <elf.h>
-
long smp_num_cpus; /* number of CPUs */
long page_bytes; /* this architecture's page size */
extern char** environ;
-static unsigned long find_elf_note(unsigned long type)
-{
- ElfW(auxv_t) auxv_struct;
- ElfW(auxv_t) *auxv_temp;
- FILE *fd;
- int i;
- static ElfW(auxv_t) *auxv = NULL;
+/* for ELF executables, notes are pushed before environment and args */
+static unsigned long find_elf_note(unsigned long findme){
unsigned long *ep = (unsigned long *)environ;
- unsigned long ret_val = NOTE_NOT_FOUND;
-
-
- if(!auxv) {
-
- fd = fopen("/proc/self/auxv", "rb");
-
- if(!fd) { // can't open auxv? that could be caused by euid change
- // ... and we need to fall back to the old and unsafe
- // ... method that doesn't work when calling library
- // ... functions with dlopen -> FIXME :(
-
- while(*ep++); // for ELF executables, notes are pushed
- while(*ep){ // ... before environment and args
- if(ep[0]==type) return ep[1];
- ep+=2;
- }
- return NOTE_NOT_FOUND;
- }
-
- auxv = (ElfW(auxv_t) *) malloc(getpagesize());
- if (!auxv) {
- perror("malloc");
- exit(EXIT_FAILURE);
- }
-
- i = 0;
- do {
- fread(&auxv_struct, sizeof(ElfW(auxv_t)), 1, fd);
- auxv[i] = auxv_struct;
- i++;
- } while (auxv_struct.a_type != AT_NULL);
-
- fclose(fd);
-
- }
-
- auxv_temp = auxv;
- i = 0;
- do {
- if(auxv_temp[i].a_type == type) {
- ret_val = (unsigned long)auxv_temp[i].a_un.a_val;
- break;
- }
- i++;
- } while (auxv_temp[i].a_type != AT_NULL);
-
- if (auxv){
- auxv_temp = NULL;
- free(auxv);
- auxv = NULL;
+ while(*ep++);
+ while(*ep){
+ if(ep[0]==findme) return ep[1];
+ ep+=2;
}
- return ret_val;
+ return NOTE_NOT_FOUND;
}
int have_privs;
int negate_selection = -1;
int running_only = -1;
int page_size = -1; // "int" for math reasons?
-unsigned personality = 0xffffffff;
+unsigned _personality = 0xffffffff;
int prefer_bsd_defaults = -1;
int screen_cols = -1;
int screen_rows = -1;
};
const int personality_table_count = sizeof(personality_table)/sizeof(personality_table_struct);
- personality = 0;
+ _personality = 0;
prefer_bsd_defaults = 0;
bsd_j_format = "OL_j";
goto *(found->jump); /* See gcc extension info. :-) */
case_bsd:
- personality = PER_FORCE_BSD | PER_BSD_h | PER_BSD_m;
+ _personality = PER_FORCE_BSD | PER_BSD_h | PER_BSD_m;
prefer_bsd_defaults = 1;
bsd_j_format = "FB_j";
bsd_l_format = "FB_l";
return NULL;
case_old:
- personality = PER_FORCE_BSD | PER_OLD_m;
+ _personality = PER_FORCE_BSD | PER_OLD_m;
prefer_bsd_defaults = 1;
return NULL;
case_debian: /* Toss this? They don't seem to care much. */
case_gnu:
- personality = PER_GOOD_o | PER_OLD_m;
+ _personality = PER_GOOD_o | PER_OLD_m;
prefer_bsd_defaults = 1;
sysv_f_format = "RD_f";
/* sysv_fl_format = "RD_fl"; */ /* old Debian ps can't do this! */
return NULL;
case_linux:
- personality = PER_GOOD_o | PER_ZAP_ADDR | PER_SANE_USER;
+ _personality = PER_GOOD_o | PER_ZAP_ADDR | PER_SANE_USER;
return NULL;
case_default: /* use defaults for ps, ignoring other environment variables */
case_digital:
// no PER_NO_DEFAULT_g even though man page claims it
// Reality: the g is a NOP
- personality = PER_GOOD_o | PER_BSD_h;
+ _personality = PER_GOOD_o | PER_BSD_h;
prefer_bsd_defaults = 1;
sysv_f_format = "F5FMT";
sysv_fl_format = "FL5FMT";
return NULL;
case_sunos4:
- personality = PER_NO_DEFAULT_g;
+ _personality = PER_NO_DEFAULT_g;
prefer_bsd_defaults = 1;
bsd_j_format = "FB_j";
bsd_l_format = "FB_l";
s = getenv("_XPG");
if(s && s[0]>'0' && s[0]<='9')
return NULL;
- personality = PER_IRIX_l;
+ _personality = PER_IRIX_l;
return NULL;
case_os390: /* IBM's OS/390 OpenEdition on the S/390 mainframe */
case_hp:
case_hpux:
- personality = PER_HPUX_x;
+ _personality = PER_HPUX_x;
return NULL;
case_svr4:
case_sysv:
case_sco:
- personality = PER_SVR4_x;
+ _personality = PER_SVR4_x;
return NULL;
case_posix:
fprintf(stderr,
"personality=0x%08x (from \"%s\")\n"
"EUID=%d TTY=%d,%d Hertz=%lld page_size=%d\n",
- personality, saved_personality_text,
+ _personality, saved_personality_text,
cached_euid, (int)major(cached_tty), (int)minor(cached_tty), Hertz,
(int)(page_size)
);
}
/* since FM_y adds RSS anyway, don't do this hack when that is true */
if( (format_flags & FF_Ul) && !(format_modifiers & FM_y) ){
- if(personality & PER_IRIX_l){ /* add "rss" then ':' here */
+ if(_personality & PER_IRIX_l){ /* add "rss" then ':' here */
PUSH("sgi_rss");
fn = malloc(sizeof(format_node));
fn->width = 1;
}
if(format_flags & FF_Ul){
if(format_modifiers & FM_y) PUSH("rss");
- else if(personality & (PER_ZAP_ADDR|PER_IRIX_l)) PUSH("sgi_p");
+ else if(_personality & (PER_ZAP_ADDR|PER_IRIX_l)) PUSH("sgi_p");
else PUSH("addr_1");
}
if(format_modifiers & FM_c){
PUSH("pri"); PUSH("class");
}else if(format_flags & FF_Ul){
PUSH("ni");
- if(personality & PER_IRIX_l) PUSH("priority");
+ if(_personality & PER_IRIX_l) PUSH("priority");
else /* is this good? */ PUSH("opri");
}
if(thread_flags & TF_U_T) PUSH("spid");
PUSH("pid");
if(format_flags & FF_Uf){
- if(personality & PER_SANE_USER) PUSH("user");
+ if(_personality & PER_SANE_USER) PUSH("user");
else PUSH("uid_hack");
}else if(format_flags & FF_Ul){
PUSH("uid");
* Generally, these only get hit when personality overrides unix output.
* That (mostly?) means the Digital and Debian personalities.
*/
- if((personality & PER_ZAP_ADDR) && (format_flags & FF_Ul)){
+ if((_personality & PER_ZAP_ADDR) && (format_flags & FF_Ul)){
fn = do_one_spec("sgi_p", NULL);
if(fmt_add_after("ADDR", fn)) fmt_delete("ADDR");
}
- if((personality & PER_SANE_USER) && (format_flags & FF_Uf)){
+ if((_personality & PER_SANE_USER) && (format_flags & FF_Uf)){
fn = do_one_spec("user", NULL);
if(fmt_add_after("UID", fn)) fmt_delete("UID");
}