Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ setitimer(2) — DG/UX 4.00

Media Vault

Software Library

Restoration Projects

Artifacts Sought



                                                             setitimer(2)



        _________________________________________________________________
        setitimer                                             System Call
        Set one of the interval timers.
        _________________________________________________________________


        SYNTAX

        #include <sys/time.h>

        int      setitimer  (which_timer, new_state_ptr, old_state_ptr)
        int                     which_timer;
        struct itimerval        *new_state_ptr;
        struct itimerval        *old_state_ptr;


        PARAMETERS

        which_timer    Specifies which of the three available timers to
                       set.  Can be ITIMER_REAL, ITIMER_VIRTUAL, or
                       ITIMER_PROF.


        new_state_ptr  The value to set in the specified timer.


        old_state_ptr  The previous value of the specified timer is
                       returned in <old_state_ptr> if non-zero.


        DESCRIPTION

        Setitimer() can set one of three timers: ITIMER_REAL,
        ITIMER_VIRTUAL, or ITIMER_PROF.

        The ITIMER_REAL timer decrements in real-time.  A SIGALRM signal
        is delivered to the calling process when the timer expires.

        The ITIMER_VIRTUAL timer decrements when the process is running
        in user code.  A SIGVTALRM signal is delivered to the calling
        process when the timer expires.

        The ITIMER_PROF timer decrements both when the process is running
        in user code and when the system is running in behalf of the
        process.  It is designed to be used by interpreters in
        statistically profiling the execution of interpreted programs.  A
        SIGPROF signal is delivered to the calling process when the timer
        expires.

        The timeval structure defined in <sys/time.h> is of the form:




        DG/UX 4.00                                                 Page 1
               Licensed material--property of copyright holder(s)





                                                             setitimer(2)



                      struct itimerval
                      {
                          struct timeval  it_interval; /* timer interval
                          struct timeval  it_value;    /* current value
                      }


        If it_value is non-zero, it indicates the time to the next timer
        expiration.  If it_interval is non-zero, it specifies a value to
        be used in reloading it_value when the timer expires.  Setting
        it_value to 0 disables a timer.  Setting it_interval to 0 causes
        a timer to be disabled after its next expiration.


        RETURN VALUE

        0              Call was successful


        -1             An error occurred.  Errno is set to indicate
                       error.


        EXCEPTIONS

        Errno may be set to one of the following error codes:


        EFAULT   the <new_state_ptr> specified a bad address


        EINVAL  invalid argument


        SEE ALSO

        The related system calls:  alarm, getitimer, sigvec

















        DG/UX 4.00                                                 Page 2
               Licensed material--property of copyright holder(s)



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026