?? RIGHT := 110 ??
?? NEWTITLE := 'NOS/VE NETWORK ACCESS: Increment File Access' ??
MODULE nam$increment_file_access_stats;

{ PURPOSE:
{   This module contains the procedure to increment the system variable nav$global_statistics.
{
{ NOTES:
{   The active connections count is decremented if the current value is greater than zero
{   to prevent the count from being negative.

?? NEWTITLE := '  Global Declarations Referenced by This Module', EJECT ??
?? PUSH (LISTEXT := ON) ??
?? POP ??
*copyc jmv$executing_within_system_job
*copyc nav$global_statistics
*copyc osp$is_caller_system_privileged
?? TITLE := '  [XDCL, #GATE] nap$increment_file_access_stats', EJECT ??

  PROCEDURE [XDCL, #GATE] nap$increment_file_access_stats
    (    increment: integer;
         statistic: (active_connection, file_access_request));

*if false
{Why do this check? It's just a statistic ...
    IF (NOT jmv$executing_within_system_job) AND (NOT osp$is_caller_system_privileged ()) THEN
      RETURN; {----->
    IFEND;
*ifend
    IF statistic = active_connection THEN
      IF (increment > 0) OR ((increment < 0) AND (nav$global_statistics.file_access.active_connections > 0))
            THEN
        nav$global_statistics.file_access.active_connections :=
              increment + nav$global_statistics.file_access.active_connections;
      IFEND;
    ELSE
      nav$global_statistics.file_access.file_access_requests :=
            increment + nav$global_statistics.file_access.file_access_requests;
    IFEND;

  PROCEND nap$increment_file_access_stats;
MODEND nam$increment_file_access_stats;
