Newsgroups: comp.sources.unix From: jeff@forys.cranbury.nj.us (Jeff Forys) Subject: v28i183: skill - signal or reprioritize specified processes, V3.6, Patch01 Sender: unix-sources-moderator@gw.home.vix.com Approved: vixie@gw.home.vix.com Submitted-By: jeff@forys.cranbury.nj.us (Jeff Forys) Posting-Number: Volume 28, Issue 183 Archive-Name: skill/patch01 Skill Version 3.6, Patch #1 [affects HP-UX w/ANSI C compiler] If you compile skill on an HP using their ANSI C compiler, you will run into the following problem(s): > cc: "getproc.c", line 208: warning 561: > Block scope function declaration for "GetWord" may not be "static". > cc: "getproc.c", line 292: error 1718: Types are not assignment-compatible. > cc: "getproc.c", line 292: warning 563: Argument #2 is not the correct type. > cc: "getproc.c", line 359: warning 562: > Redeclaration for "GetWord"; "static" used. > *** Error code 1 The "regular" C compiler does not complain, of course. At any rate, here is a patch to "machdep/hpux-91.c" (and "main.c" for versioning) to make both HP-UX C compilers happy; thanks to Richard Allen over in Iceland for reporting this. To apply this patch, "cd" to your skill source directory and run: patch -p0 p_stat != 0) { ! if (pstat(PSTAT_PROC, &apst, sizeof(apst), 0, aproc->p_pid) != 1) aproc->p_stat = 0; /* --- 313,320 ---- aproc = procsp++; thisproc--; if (aproc->p_stat != 0) { ! apstun.pst_status = &apst; ! if (pstat(PSTAT_PROC, apstun, sizeof(apst), 0, aproc->p_pid) != 1) aproc->p_stat = 0; /* *************** *** 344,371 **** } return(&procinfo); - } - - #define SKRD(file, src, dst, size) \ - (lseek(file, (off_t)(src), L_SET) == -1) || \ - (read(file, (char *)(dst), (size)) != (size)) - - /* - * GetWord(loc) - * - * Read in word at `loc' from kernel virtual memory. - * If an error occurs, call exit(2) with EX_SERR. - */ - static int - GetWord(loc) - off_t loc; - { - int val; - - if (SKRD(kmem, loc, &val, sizeof(val))) { - fprintf(stderr, "%s: can't read word at %lx in %s\n", - ProgName, (u_long)loc, kmemf); - exit(EX_SERR); - } - return (val); } --- 369,372 ----