ldmud-3.2.9/doc/
ldmud-3.2.9/doc/efun/
ldmud-3.2.9/mud/
ldmud-3.2.9/mud/heaven7/
ldmud-3.2.9/mud/heaven7/lib/
ldmud-3.2.9/mud/lp-245/
ldmud-3.2.9/mud/lp-245/banish/
ldmud-3.2.9/mud/lp-245/doc/
ldmud-3.2.9/mud/lp-245/doc/examples/
ldmud-3.2.9/mud/lp-245/doc/sefun/
ldmud-3.2.9/mud/lp-245/log/
ldmud-3.2.9/mud/lp-245/obj/Go/
ldmud-3.2.9/mud/lp-245/players/lars/
ldmud-3.2.9/mud/lp-245/room/death/
ldmud-3.2.9/mud/lp-245/room/maze1/
ldmud-3.2.9/mud/lp-245/room/sub/
ldmud-3.2.9/mud/lp-245/secure/
ldmud-3.2.9/mud/morgengrauen/
ldmud-3.2.9/mud/morgengrauen/lib/
ldmud-3.2.9/mud/sticklib/
ldmud-3.2.9/mud/sticklib/src/
ldmud-3.2.9/mudlib/uni-crasher/
ldmud-3.2.9/pkg/
ldmud-3.2.9/pkg/debugger/
ldmud-3.2.9/pkg/diff/
ldmud-3.2.9/pkg/misc/
ldmud-3.2.9/src/autoconf/
ldmud-3.2.9/src/bugs/
ldmud-3.2.9/src/bugs/MudCompress/
ldmud-3.2.9/src/bugs/b-020916-files/
ldmud-3.2.9/src/bugs/doomdark/
ldmud-3.2.9/src/bugs/ferrycode/ferry/
ldmud-3.2.9/src/bugs/ferrycode/obj/
ldmud-3.2.9/src/bugs/psql/
ldmud-3.2.9/src/done/
ldmud-3.2.9/src/done/order_alist/
ldmud-3.2.9/src/done/order_alist/obj/
ldmud-3.2.9/src/done/order_alist/room/
ldmud-3.2.9/src/gcc/
ldmud-3.2.9/src/gcc/2.7.0/
ldmud-3.2.9/src/gcc/2.7.1/
ldmud-3.2.9/src/hosts/
ldmud-3.2.9/src/hosts/GnuWin32/
ldmud-3.2.9/src/hosts/amiga/NetIncl/
ldmud-3.2.9/src/hosts/amiga/NetIncl/netinet/
ldmud-3.2.9/src/hosts/amiga/NetIncl/sys/
ldmud-3.2.9/src/hosts/i386/
ldmud-3.2.9/src/hosts/msdos/byacc/
ldmud-3.2.9/src/hosts/msdos/doc/
ldmud-3.2.9/src/hosts/os2/
ldmud-3.2.9/src/hosts/win32/
ldmud-3.2.9/src/util/
ldmud-3.2.9/src/util/erq/
ldmud-3.2.9/src/util/indent/hosts/next/
ldmud-3.2.9/src/util/xerq/
ldmud-3.2.9/src/util/xerq/lpc/
ldmud-3.2.9/src/util/xerq/lpc/www/
#ifndef MY_RUSAGE_H__
#define MY_RUSAGE_H__

/*------------------------------------------------------------------
 * Portable rusage related definitions and prototypes.
 *
 * Use this file instead of <rusage.h> and others.
 *------------------------------------------------------------------
 */

#include "driver.h"

#ifdef GETRUSAGE_VIA_SYSCALL  /* hpux */
#    include <sys/syscall.h>
#    define getrusage(a, b)  syscall(SYS_GETRUSAGE, a, b)
#endif

#if defined(AMIGA) && !defined(__SASC) && !defined(__GNUC__)
#    include <sys/resource.h>
#endif

#if defined(HAVE_GETRUSAGE)
#    if defined(RUSAGE_USEC) || defined(__hpux__)
#        define RUSAGE_TIME(t) ( (t).tv_sec * 1000 + (t).tv_usec / 1000 )
#    else
#        if defined(solaris)
             /* the header files are POSIX, but the function is BSD :-( */
#            define RUSAGE_TIME(t) ( (t).tv_sec * 1000 + (t).tv_nsec / 1000 )
#        else
#            define RUSAGE_TIME(t) ( (t).tv_sec * 1000 + (t).tv_nsec / 1000000 )
#        endif /* ! solaris */
#    endif /* RUSAGE_USEC */

#    ifdef HAVE_SYS_TIME_H
#        include <sys/time.h> /* Needed on some systems for sys/resource.h */
#    endif

#    ifdef HAVE_SYS_RUSAGE_H  /* solaris */
#        include <sys/rusage.h>
#    endif /* HAVE_SYS_RUSAGE */
#    include <sys/resource.h>
#    ifdef sun
         extern int getpagesize();
#    endif
#    if defined(sun) || defined(ultrix)
         extern int getrusage PROT((int, struct rusage *));
#    endif

#else /* !HAVE_GETRUSAGE */

#    undef GETRUSAGE_RESTRICTED
#    define GETRUSAGE_RESTRICTED
#    define RUSAGE_SELF     0

#    if defined(POSIX) && (HAVE_SYSCONF)
     /* there is actually a system that pretends to be POSIX, prototypes sysconf,
      * but does not have it.
      */
#        define TIMES_FREQ sysconf(_SC_CLK_TCK)

#    else /* !POSIX */

#        include <sys/time.h>
#        include <sys/times.h>
#        include <time.h>

#        define TIMES_FREQ CLK_TCK
#        ifndef CLK_TCK
#            define CLK_TCK CLOCKS_PER_SEC
#            ifndef CLOCKS_PER_SEC
#                define CLOCKS_PER_SEC 60
#            endif /* !CLOCKS_PER_SEC */
#        endif /* !CLK_TCK */

#    endif /* !POSIX */

#    define RUSAGE_TIME(t) ( (t) * 1000 / TIMES_FREQ )

struct rusage {
    long ru_utime, ru_stime;
};

extern int getrusage(int, struct rusage*);
  /* Implemented in port.c */

#endif /* HAVE_GETRUSAGE */

#ifndef RUSAGE_SELF
#    define RUSAGE_SELF 0
#endif

#endif /* MY_RUSAGE_H__ */