-- -------------------------------------------------------------------- | Massimo Ianigro | E-write at : Massimo.Ianigro_at_ba.cnr.it | | C . N . R . | URL: http://www.ba.cnr.it/~massimo | | Via Amendola, 166/5 | Phone: 39 80 5482176/80/30/00 | | 70126 BARI ITALY | Fax : 39 80 5484467 | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | Humility is the ability to act embarressed | | while telling others how great you are | -------------------------------------------------------------------- *** autonice.c Fri May 05 20:45:51 1995 --- new-autonice.c Fri May 05 20:42:27 1995 *************** *** 5,10 **** --- 5,17 ---- * (C) R.P.Bellis 1993 * * $Log: autonice.c,v $ + * + * Revision 0.3.something 1995/05/05 20:26 Massimo Ianigro massimo_at_ba.cnr.it + * Adjusted the detection of OSF/1. Now check also for versions greater than + * 3.0 + * Messages in syslog show also the name of executable reniced + * + * * Revision 0.3 1994/11/22 12:51:01 rpb * Opened /proc entry read-only instead of read/write * Adjusted time to cope with millisecond timings under DEC OSF/1 V3.0 *************** *** 61,66 **** --- 68,74 ---- struct utsname uts; int osf1; int millisec_time; + float os_release; DIR *dirp; /* Read system type */ *************** *** 69,77 **** return EXIT_FAILURE; } ! /* Detect OSF/1 v3.0 */ osf1 = !strcmp(uts.sysname, "OSF1"); ! millisec_time = osf1 && !strncmp(&uts.release[1], "3.0", 3); /* Fork as a daemon */ if (daemon(0, 0) == -1) { --- 77,86 ---- return EXIT_FAILURE; } ! /* Detect OSF/1 v3.0 (or more... -Massimo Ianigro: massimo_at_ba.cnr.it- */ osf1 = !strcmp(uts.sysname, "OSF1"); ! os_release = atof( &uts.release[1]) ; ! millisec_time = osf1 && (os_release >= 3.0); /* Fork as a daemon */ if (daemon(0, 0) == -1) { *************** *** 163,168 **** --- 172,178 ---- /* Is the priority already correct */ if (p >= np) continue; + /* Actually change the priority and report on success */ if (setpriority(PRIO_PROCESS, ps.pr_pid, np) == -1) { syslog(LOG_ERR, *************** *** 170,177 **** ps.pr_pid); } else { syslog(LOG_INFO, ! "setting priority for PID %d to %d", ! ps.pr_pid, np); } } --- 180,187 ---- ps.pr_pid); } else { syslog(LOG_INFO, ! "setting priority for PID %d(%s) to %d", ! ps.pr_pid, ps.pr_fname, np); } }Received on Fri May 05 1995 - 15:11:02 NZST
This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:45 NZDT