home *** CD-ROM | disk | FTP | other *** search
/ The AGA Experience 2 / agavol2.iso / software / utilities / wb_tools / executive_v1.30 / sysinfo.lzx / SysInfo.doc < prev   
Text File  |  2007-03-09  |  22KB  |  680 lines

  1. TABLE OF CONTENTS
  2.  
  3. SysInfo.library/--background--
  4. SysInfo.library/AddNotify
  5. SysInfo.library/FreeSysInfo
  6. SysInfo.library/GetCpuUsage
  7. SysInfo.library/GetLoadAverage
  8. SysInfo.library/GetNice
  9. SysInfo.library/GetPgrp
  10. SysInfo.library/GetPid
  11. SysInfo.library/GetPpid
  12. SysInfo.library/GetTaskCpuUsage
  13. SysInfo.library/InitSysInfo
  14. SysInfo.library/RemoveNotify
  15. SysInfo.library/SetNice
  16. SysInfo.library/--background--             SysInfo.library/--background--
  17.  
  18.   PURPOSE
  19.  
  20.     SysInfo.library was developed to bring together all the different
  21.     utility programs that add some new features to Amiga task
  22.     handling, like CPU usage calculation. SysInfo.library was first
  23.     developed for Executive, but it's possible to rewrite it to
  24.     support other similar programs. It's not necessary to support
  25.     all SysInfo.library functions in all implementations.
  26.  
  27.   OVERVIEW
  28.  
  29.     Currently supported features
  30.  
  31.     * CPU usage
  32.  
  33.       SysInfo.library provides several CPU usage indicators, e.g.
  34.       total used CPU time, CPU time used during last second,
  35.       recently used CPU time. Executive will also provide context
  36.       switch counters.
  37.  
  38.     * load averages
  39.  
  40.       Load average is the number of tasks ready or running over various
  41.       periods of time, usually 1, 5 and 15 minutes. A load average 1.0
  42.       means that there has been exactly one task running.
  43.  
  44.     * PID, PPID and PGRP
  45.  
  46.       PID is a process identifier. This is a unique number assigned for
  47.       each task in the system.
  48.  
  49.       PPID is a parent process identifier. It's the PID of the process
  50.       that has created the current process.
  51.  
  52.       PGRP is a process group. Process groups can't be implemented on
  53.       Amiga at the moment, because it's impossible to distinguish
  54.       if a task is a child-task or a totally separate task. In Executive
  55.       process groups mean processes created by a specific task. The
  56.       PGRP number is the PID of the parent task. By referring to a specific
  57.       process group, you refer to all tasks created by the parent task.
  58.  
  59.     * nice-values
  60.  
  61.       Nice-values similar to Amiga priorities, they are used by the
  62.       scheduler when calculating priorities for different tasks.
  63.  
  64.   NOTES
  65.  
  66.     If some function can't be implemented, a valid error-value
  67.     should still be returned.
  68.  
  69.     A `server' in this document means the program calculating all
  70.     this information. SysInfo.library is a standard interface to
  71.     different servers.
  72.  
  73.   AUTHOR
  74.  
  75.     Petri Nordlund <petrin@megabaud.fi>
  76.  
  77.   HISTORY
  78.  
  79.     V1.00  First release
  80.     V1.20  No changes, Executive server modifications required recompilation.
  81.     V1.30  (Thanks to Bernhard Möllemann <zza@rz.uni-karlsruhe.de>)
  82.            - Better names for some structs:
  83.                sysinfo            ->    SysInfo
  84.                loadaverage        ->    SI_LoadAverage
  85.                loadaverage_fixed  ->    SI_LoadAverageFixed
  86.                SysInfo_notify     ->    SI_Notify
  87.                cpu_usage          ->    SI_CpuUsage
  88.                task_cpu_usage     ->    SI_TaskCpuUsage
  89.            - SysInfo was sometimes spelled as sysinfo or Sysinfo. It's now
  90.              always SysInfo.
  91.            - sysinfo.fd is now SysInfo_lib.fd
  92.            - Changed the compiler dependant types:
  93.                int   -> LONG
  94.                short -> WORD
  95.                long  -> LONG
  96.            - Removed LOADAVG_FLOAT.
  97.            - Replaced the `use_messages' parameter in AddNotify() call with `flags'.
  98.            - Some internal changes to support Executive V1.30
  99.  
  100.   FUTURE
  101.  
  102.     Here are some functions which could be included in SysInfo.library:
  103.  
  104.     acct
  105.     getegid
  106.     geteuid
  107.     getgid
  108.     getgroups
  109.     getlogin
  110.     getrlimit
  111.     getrusage
  112.     getuid
  113.     setegid
  114.     seteuid
  115.     setgid
  116.     setgroups
  117.     setlogin
  118.     setpgrp
  119.     setpgid
  120.     setrlimit
  121.     setsid
  122.     setuid
  123. SysInfo.library/AddNotify                  SysInfo.library/AddNotify
  124.  
  125.   NAME
  126.     AddNotify - Add a notification request
  127.  
  128.   SYNOPSIS
  129.     notify = AddNotify(sysinfo,flags,safety_limit);
  130.     D0                 A0      D0    D1
  131.  
  132.     struct SI_Notify *AddNotify(struct SysInfo *, WORD, LONG);
  133.  
  134.   FUNCTION
  135.     Ask the server to notify us after it has updated its information.
  136.     After the notification, new load average, CPU usage and other
  137.     information may be requested and they'll be up-to-date. Notification
  138.     is useful if your application updates its display frequently. You
  139.     don't end up updating just before the server will calculate new
  140.     information. The notification will keep your application in sync
  141.     with the server.
  142.  
  143.     There are two ways to notify your task, by signals or messages.
  144.     Signals are very fast, but they don't queue. The safety_limit
  145.     variable can be used with messages, it's the maximum number of
  146.     notification messages that will be sent to you before you reply
  147.     to them. A good value here is about 10 - 20.
  148.     
  149.     This function returns a SI_Notify structure, which you must not
  150.     modify. If you use messages for notification, it has a pointer
  151.     to a port where the messages will arrive. Just reply to the
  152.     messages you get. There may be some internal information in
  153.     these messages that the server will use so don't modify them.
  154.     If you have ask for signals to be used for notification, there
  155.     will be a signal number in the structure. Just Wait() for that
  156.     signal.
  157.  
  158.     Before requesting notification, make sure that it's implemented.
  159.     The SysInfo->notify_sig_implemented is TRUE if you can use
  160.     signals and the SysInfo->notify_msg_implemented is TRUE if
  161.     notification with messages is available.
  162.  
  163.     A notification happens once every second.
  164.  
  165.   INPUTS
  166.     SysInfo - SysInfo structure returned by InitSysInfo()
  167.     flags - See <libraries/SysInfo.h>
  168.     safety_limit - maximum number of messages sent to you
  169.  
  170.   RESULT
  171.     notify - SI_Notify structure defined in <libraries/SysInfo.h> or
  172.              NULL if there was an error
  173.  
  174.   BUGS
  175.  
  176.   SEE ALSO
  177.     RemoveNotify(), <libraries/SysInfo.h>
  178. SysInfo.library/FreeSysInfo                SysInfo.library/FreeSysInfo
  179.  
  180.   NAME
  181.     FreeSysInfo - Finish using the SysInfo.library
  182.  
  183.   SYNOPSIS
  184.     FreeSysInfo(SysInfo);
  185.                 A0
  186.  
  187.     void FreeSysInfo(struct SysInfo *);
  188.  
  189.   FUNCTION
  190.     Declares that you are finished using the services provided by
  191.     SysInfo.library. The SysInfo structure will be freed.
  192.  
  193.   INPUTS
  194.     SysInfo - structure returned by InitSysInfo()
  195.  
  196.   RESULT
  197.     None
  198.  
  199.   BUGS
  200.  
  201.   SEE ALSO
  202.     InitSysInfo(), <libraries/SysInfo.h>
  203. SysInfo.library/GetCpuUsage                SysInfo.library/GetCpuUsage
  204.  
  205.   NAME
  206.     GetCpuUsage - Get the current CPU usage values
  207.  
  208.   SYNOPSIS
  209.     GetCpuUsage(sysinfo, cpuusage);
  210.                 A0       A1
  211.  
  212.     void GetCpuUsage(struct SysInfo *, struct SI_CpuUsage *);
  213.  
  214.   FUNCTION
  215.     The SI_CpuUsage structure will be filled with current CPU usage
  216.     values.
  217.  
  218.     The SysInfo->cpu_usage_implemented field indicates what values
  219.     are implemented in the SysInfo.library. The corresponding
  220.     bits are defined in <libraries/SysInfo.h>:
  221.  
  222.     CPU_USAGEF_TOTAL_IMPLEMENTED
  223.  
  224.       Total CPU usage. The SI_CpuUsage->total_used_cputime is the CPU time
  225.       used in seconds. The SI_CpuUsage->total_elapsed_time is the used
  226.       CPU time plus idle CPU time, i.e. the elapsed time since CPU time
  227.       calculations began. You can calculate the CPU usage percentage
  228.       in this way:
  229.  
  230.           100 * total_used_cputime / total_elapsed_time
  231.  
  232.     CPU_USAGEF_LASTSEC_IMPLEMENTED
  233.  
  234.       CPU time used by all processes during last second. The
  235.       SI_CpuUsage->used_cputime_lastsec_hz is the number of clock
  236.       ticks during one second. The SI_CpuUsage->used_cputime_lastsec
  237.       is the number of ticks used. To calculate the percentage
  238.       of CPU time used:
  239.  
  240.           100 * used_cputime_lastsec / used_cputime_lastsec_hz
  241.  
  242.     CPU_USAGEF_RECENT_IMPLEMENTED
  243.  
  244.       The SI_CpuUsage->recent_used_cputime is a decaying average of
  245.       recent CPU usage. In Executive this is for the last minute.
  246.       The time in seconds is stored in SI_CpuUsage->recent_seconds.
  247.       You can calculate recent CPU usage percentage in this way:
  248.  
  249.          100 * recent_used_cputime / recent_used_cputime_hz
  250.  
  251.     CPU_USAGEF_IVVOCSW_IMPLEMENTED
  252.  
  253.       Some servers can also keep a count of the number of context
  254.       switches. A context switch happens when one task is switched
  255.       to another. The SI_CpuUsage->involuntary_csw field indicates
  256.       the total number of involuntary context switches and the
  257.       SI_CpuUsage->voluntary_csw field indicates the total number
  258.       of voluntary context switches.
  259.  
  260.       Involuntary context switch happens when the CPU is taken
  261.       away from a task that has not finished using it. This happens
  262.       when a higher priority task becomes ready to run.
  263.  
  264.       Voluntary context switch happens when task calls Wait() and
  265.       a lower priority task gets CPU time.
  266.  
  267.     CPU_USAGEF_TOTALCSW_IMPLEMENTED
  268.  
  269.       In some implementations only the total number of context switches
  270.       is available. The SI_CpuUsage->total_csw is just involuntary context
  271.       switches plus voluntary context switches, if specific information
  272.       is available.
  273.  
  274.     CPU_USAGEF_IVVOCSW_LASTSEC_IMPLEMENTED
  275.     CPU_USAGEF_TOTALCSW_LASTSEC_IMPLEMENTED
  276.  
  277.       Like above, but for the last second.
  278.  
  279.     When using these numbers, do all calculations in 32-bits.
  280.  
  281.   INPUTS
  282.     sysinfo - SysInfo structure returned by InitSysInfo()
  283.     cpuusage - SI_CpuUsage structure defined in <libraries/SysInfo.h>
  284.  
  285.   RESULT
  286.     None
  287.  
  288.   BUGS
  289.  
  290.   SEE ALSO
  291.     GetTaskCpuUsage(), <libraries/SysInfo.h>
  292. SysInfo.library/GetLoadAverage             SysInfo.library/GetLoadAverage
  293.  
  294.   NAME
  295.     GetLoadAverage - Get load averages
  296.  
  297.   SYNOPSIS
  298.     GetLoadAverage(sysinfo, loadaverage);
  299.                    A0       A1
  300.  
  301.     void GetLoadAverage(struct SysInfo *, struct SI_LoadAverage *);
  302.  
  303.   FUNCTION
  304.     This function fills the SI_LoadAverage structure with current load
  305.     average values. There are three values which mean the average
  306.     load for the last few minutes. Usually these are 1, 5 and 15
  307.     minutes, but this may vary. The number of seconds each load average
  308.     means, is stored in SysInfo->loadavg_time[1-3]. The number 0 means
  309.     that the load average for that time is not implemented.
  310.  
  311.     The SysInfo->loadavg_type field indicates the way the load averages
  312.     are stored in the SI_LoadAverage structure. This can be LOADAVG_NONE,
  313.     in which case load averages are not available at all.
  314.     LOADAVG_FIXEDPNT means that the load averages are stored as
  315.     32-bit values that have been multiplied with SysInfo->fscale.
  316.     To get the actual load average, you need to calculate in floating
  317.     point numbers:
  318.  
  319.       (float) loadaverage->lavg_fixed.load1 / (float) SysInfo->fscale
  320.  
  321.   INPUTS
  322.     sysinfo - SysInfo structure returned by InitSysInfo()
  323.     loadaverage - SI_LoadAverage structure defined in <libraries/SysInfo.h>
  324.  
  325.   RESULT
  326.     None
  327.  
  328.   BUGS
  329.  
  330.   SEE ALSO
  331.     <libraries/SysInfo.h>
  332. SysInfo.library/GetNice                    SysInfo.library/GetNice
  333.  
  334.   NAME
  335.     GetNice - get internal priority, nice-value
  336.  
  337.   SYNOPSIS
  338.     nice = GetNice(sysinfo, which, who)
  339.     D0             A0       D0     D1
  340.  
  341.     LONG GetNice(struct SysInfo *, LONG, LONG);
  342.  
  343.   FUNCTION
  344.     Get a nice-value for a process or group of processes. Nice-value
  345.     is used when the server also contains a scheduler, like Executive.
  346.     Nice-value is used when calculating scheduling priorities for tasks.
  347.  
  348.     The nice-value that gives most CPU time is available from
  349.     SysInfo->nicemin (usually -20) and the nice-value that gives
  350.     least CPU time is in SysInfo->nicemax (usually +20).
  351.  
  352.     Which is one of PRIO_PROCESS, PRIO_PGRP, PRIO USER or PRIO_TASK and
  353.     who is interpreted relative to which (a process identifier for
  354.     PRIO_PROCESS, process group identifier for PRIO_PGRP, user ID
  355.     for PRIO_USER and a task address for PRIO_TASK). A zero value of
  356.     who denotes the current process, process group, user or task. Prio
  357.     is a value in the range SysInfo->nicemin to SysInfo->nicemax.
  358.  
  359.     The GetNice() call returns the highest nice-value (usually lowest
  360.     numerical value) enjoyed by any of the specified processes.
  361.  
  362.     Bits in SysInfo->which_implemented indicate what values you can
  363.     use for which. If this value is 0, then GetNice() and SetNice()
  364.     routines are not available.
  365.  
  366.   INPUTS
  367.     sysinfo - SysInfo structure returned by InitSysInfo()
  368.     which - get priority from which processes
  369.     who - depends on which-field, 0 means current process, PGRP, user or task
  370.  
  371.   RESULT
  372.     nice - highest nice-value enjoyed by any of the specified processes
  373.            -1 is returned if an error occurs. Since -1 is a legitimate
  374.            value, it is necessary to look at SysInfo->errno value if
  375.            -1 is returned by GetNice(). If errno is zero, no error has
  376.            occurred otherwise it will be one of these:
  377.  
  378.      WHICH_ESRCH   No process was located using the which and who values
  379.                    specified.
  380.  
  381.      WHICH_EINVAL  Which was not one of PRIO_PROCESS, PRIO_PGRP,
  382.                    PRIO_USER or PRIO_TASK, or that value is not supported.
  383.  
  384.   NOTES
  385.     The name of this function should have been GetPriority() like in
  386.     Un*x, but then it might have been confused with Exec priorities.
  387.  
  388.   BUGS
  389.  
  390.   SEE ALSO
  391.     <libraries/SysInfo.h>
  392. SysInfo.library/GetPgrp                    SysInfo.library/GetPgrp
  393.  
  394.   NAME
  395.     GetPgrp - Get a process group identifier
  396.  
  397.   SYNOPSIS
  398.     pgrp = GetPgrp(sysinfo);
  399.     D0             A0      
  400.  
  401.     LONG GetPgrp(struct SysInfo *);
  402.  
  403.   FUNCTION
  404.     The process group of the current process is returned by GetPgrp().
  405.  
  406.     If this function is available, the SysInfo->GetPgrp_implemented field
  407.     is TRUE.
  408.  
  409.   INPUTS
  410.     sysinfo - SysInfo structure returned by InitSysInfo()
  411.  
  412.   RESULT
  413.     pgrp - process group identifier or -1 if process group is unknown
  414.  
  415.   BUGS
  416.  
  417.   SEE ALSO
  418.     GetPid(), GetPpid(), <libraries/SysInfo.h>
  419. SysInfo.library/GetPid                     SysInfo.library/GetPid
  420.  
  421.   NAME
  422.     GetPid - Get a process identifier
  423.  
  424.   SYNOPSIS
  425.     pid = GetPid(sysinfo);
  426.     D0           A0      
  427.  
  428.     LONG GetPid(struct SysInfo *);
  429.  
  430.   FUNCTION
  431.     GetPid() returns the process ID of the calling task.  The ID is
  432.     guaranteed to be unique and is useful for constructing temporary
  433.     file names.
  434.  
  435.     This routine is always available. If special unique PIDs can't
  436.     be given, it return the task address, so calling this is equivalent
  437.     to calling FindTask(NULL).
  438.  
  439.   INPUTS
  440.     sysinfo - SysInfo structure returned by InitSysInfo()
  441.  
  442.   RESULT
  443.     pid - process identifier
  444.  
  445.   BUGS
  446.  
  447.   SEE ALSO
  448.     GetPgrp(), GetPpid(), <libraries/SysInfo.h>
  449. SysInfo.library/GetPpid                    SysInfo.library/GetPpid
  450.  
  451.   NAME
  452.     GetPpid - Get a parent process identifier
  453.  
  454.   SYNOPSIS
  455.     pid = GetPpid(sysinfo);
  456.     D0            A0      
  457.  
  458.     LONG GetPpid(struct SysInfo *);
  459.  
  460.   FUNCTION
  461.     GetPpid() returns the process ID of the parent of the calling task.
  462.  
  463.     If this function is available, the SysInfo->GetPpid_implemented field
  464.     is TRUE.
  465.  
  466.   INPUTS
  467.     sysinfo - SysInfo structure returned by InitSysInfo()
  468.  
  469.   RESULT
  470.     pid - parent process identifier or -1 if parent is unknown
  471.  
  472.   BUGS
  473.  
  474.   SEE ALSO
  475.     GetPgrp(), GetPid(), <libraries/SysInfo.h>
  476. SysInfo.library/GetTaskCpuUsage            SysInfo.library/GetTaskCpuUsage
  477.  
  478.   NAME
  479.     GetCpuUsage - Get the current CPU usage values for a task
  480.  
  481.   SYNOPSIS
  482.     success = GetTaskCpuUsage(sysinfo, taskcpuusage, task);
  483.     D0                        A0       A1            A2
  484.  
  485.     LONG GetTaskCpuUsage(struct SysInfo *, struct SI_TaskCpuUsage *, struct Task *);
  486.  
  487.   FUNCTION
  488.     The cpu_usage structure will be filled with current CPU usage
  489.     values for the specified task. Specify NULL for current task.
  490.     This routine is rather similar to GetCpuUsage, but has some
  491.     small differences.
  492.  
  493.     The SysInfo->task_cpu_usage_implemented field indicates what
  494.     values are implemented in the SysInfo.library. The corresponding
  495.     bits are defined in <libraries/SysInfo.h>:
  496.  
  497.     TASK_CPU_USAGEF_TOTAL_IMPLEMENTED
  498.  
  499.       Total CPU usage. The SI_TaskCpuUsage->total_used_time_hz is the
  500.       number of clock ticks during one second. The SI_TaskCpuUsage->
  501.       total_used_cputime is the total number of ticks used. You can
  502.       calculate the CPU usage percentage in this way:
  503.  
  504.           100 * total_used_cputime / total_used_time_hz
  505.  
  506.       The SI_TaskCpuUsage->total_elapsed_time is the used CPU time plus
  507.       idle CPU time, i.e. the elapsed time since the task was created.
  508.       You can calculate how many percent of CPU time task has used:
  509.  
  510.           100 * (total_used_cputime / total_used_time_hz) / total_elapsed_time
  511.  
  512.       Please remember that this number doesn't mean the percentage
  513.       of CPU time the task has used from all used CPU time. It's
  514.       the percentage of CPU time the task has used from the total
  515.       available CPU time.
  516.  
  517.     TASK_CPU_USAGEF_LASTSEC_IMPLEMENTED
  518.  
  519.       CPU time used by this task during last second. The
  520.       SI_TaskCpuUsage->used_cputime_lastsec_hz is the number of
  521.       clock ticks during one second. The SI_TaskCpuUsage->
  522.       used_cputime_lastsec is the number of ticks used. To calculate
  523.       the percentage of CPU time used:
  524.  
  525.           100 * used_cputime_lastsec / used_cputime_lastsec_hz
  526.  
  527.     TASK_CPU_USAGEF_RECENT_IMPLEMENTED
  528.  
  529.       The SI_TaskCpuUsage->recent_used_cputime is a decaying average
  530.       of recent CPU usage. In Executive this is for the last minute.
  531.       The time in seconds is stored in SI_TaskCpuUsage->recent_seconds.
  532.       You can calculate recent CPU usage percentage in this way:
  533.  
  534.          100 * recent_used_cputime / recent_used_cputime_hz
  535.  
  536.     TASK_CPU_USAGEF_IVVOCSW_IMPLEMENTED
  537.  
  538.       Some servers can also keep a count of the number of context
  539.       switches. A context switch happens when one task is switched
  540.       to another. The SI_TaskCpuUsage->involuntary_csw field indicates
  541.       the total number of involuntary context switches for the specified
  542.       task and the SI_TaskCpuUsage->voluntary_csw field indicates the
  543.       total numnber of voluntary context switches.
  544.  
  545.       Involuntary context switch happens when the CPU is taken
  546.       away from a task that has not finished using it. This happens
  547.       when a higher priority task becomes ready to run.
  548.  
  549.       Voluntary context switch happens when task calls Wait() and
  550.       a lower priority task gets CPU time.
  551.  
  552.     TASK_CPU_USAGEF_TOTALCSW_IMPLEMENTED
  553.  
  554.       In some implementations only the total number of context switches
  555.       is available. The SI_TaskCpuUsage->total_csw is just involuntary
  556.       context switches plus voluntary context switches, if specific
  557.       information is available.
  558.  
  559.     TASK_CPU_USAGEF_IVVOCSW_LASTSEC_IMPLEMENTED
  560.     TASK_CPU_USAGEF_TOTALCSW_LASTSEC_IMPLEMENTED
  561.  
  562.       Like above, but for the last second.
  563.  
  564.     When using these numbers, do all calculations in 32-bits.
  565.  
  566.   INPUTS
  567.     sysinfo - SysInfo structure returned by InitSysInfo()
  568.     taskcpuusage - SI_TaskCpuUsage structure defined in <libraries/SysInfo.h>
  569.     task - task address, NULL for current task
  570.  
  571.   RESULT
  572.     success - 0 for success, 1 for error
  573.  
  574.   BUGS
  575.  
  576.   SEE ALSO
  577.     GetCpuUsage(), <libraries/SysInfo.h>
  578. SysInfo.library/InitSysInfo                SysInfo.library/InitSysInfo
  579.  
  580.   NAME
  581.     InitSysInfo - Initialize the SysInfo.library
  582.  
  583.   SYNOPSIS
  584.     SysInfo InitSysInfo(void);
  585.     D0
  586.  
  587.     struct SysInfo *InitSysInfo(void);
  588.  
  589.   FUNCTION
  590.     This function will initialize the SysInfo.library and possibly
  591.     make a connection to the server task. It returns a SysInfo structure
  592.     which you need when requesting information. The structure is read-
  593.     only and it's size may grow in later versions of the library.
  594.  
  595.   INPUTS
  596.     None
  597.  
  598.   RESULT
  599.     SysInfo - structure defined in <libraries/SysInfo.h>
  600.  
  601.   BUGS
  602.  
  603.   SEE ALSO
  604.     FreeSysInfo(), <libraries/SysInfo.h>
  605. SysInfo.library/RemoveNotify               SysInfo.library/RemoveNotify
  606.  
  607.   NAME
  608.     RemoveNotify - Remove a notification request
  609.  
  610.   SYNOPSIS
  611.     RemoveNotify(sysInfo,notify);
  612.                  A0      A0
  613.  
  614.     void RemoveNotify(struct SysInfo *, struct SI_Notify);
  615.  
  616.   FUNCTION
  617.     Remove the notification request added with AddNotify(). This function
  618.     will internally make sure that you won't get any more notification
  619.     messages and it will clean up the queued messages if any. It will
  620.     also clear the signal if it was allocated.
  621.  
  622.   INPUTS
  623.     sysinfo - SysInfo structure returned by InitSysInfo()
  624.     notify - SI_Notify structure you got from AddNotify()
  625.  
  626.   RESULT
  627.     None
  628.  
  629.   BUGS
  630.  
  631.   SEE ALSO
  632.     AddNotify(), <libraries/SysInfo.h>
  633. SysInfo.library/SetNice                    SysInfo.library/SetNice
  634.  
  635.   NAME
  636.     SetNice - set internal priority, nice-value
  637.  
  638.   SYNOPSIS
  639.     success = SetNice(sysinfo, which, who, nice)
  640.     D0                A0       D0     D1   D2
  641.  
  642.     LONG SetNice(struct SysInfo *, LONG, LONG, LONG);
  643.  
  644.   FUNCTION
  645.     Set a nice-value for a process or group of processes. 
  646.  
  647.     See GetNice() for more information.
  648.  
  649.   INPUTS
  650.     sysinfo - SysInfo structure returned by InitSysInfo()
  651.     which - which processes are affected
  652.     who - depends on which-field, 0 means current process, PGRP, user or task
  653.     nice - change nice to this value
  654.  
  655.   RESULT
  656.     success - 0 if there is no error, or -1 if there is, in which case
  657.               the error is in SysInfo->errno:
  658.  
  659.      WHICH_ESRCH   No process was located using the which and who values
  660.                    specified.
  661.  
  662.      WHICH_EINVAL  Which was not one of PRIO_PROCESS, PRIO_PGRP,
  663.                    PRIO_USER or PRIO_TASK, or that value is not supported.
  664.  
  665.      Some implementations may returns one of these:
  666.  
  667.      WHICH_EPERM   A process was located, but neither its effective nor real
  668.                    user ID matched the effective user ID of the caller.
  669.  
  670.      WHICH_EACCES  A non super-user attempted to lower a process priority.
  671.  
  672.   NOTES
  673.     The name of this function should have been SetPriority() like in
  674.     Un*x, but then it might have been confused with Exec priorities.
  675.  
  676.   BUGS
  677.  
  678.   SEE ALSO
  679.     <libraries/SysInfo.h>
  680.