/*
 *   FILE
 *	port.c
 *
 *   DESCRIPTION
 *	port-specific routines for HP-UX
 *
 *   INTERFACE ROUTINES
 *	init_address_fixup
 *	random
 *	srandom
 *	getrusage
 *
 *   NOTES
 *	For the most part, this file gets around some non-POSIX calls 
 *	in POSTGRES.
 *
 *   IDENTIFICATION
 *	/usr/local/devel/postgres-v4r2/src/backend/port/hpux/RCS/port.c,v 1.6 1993/08/16 04:22:59 aoki Exp
 */

#include <unistd.h>		/* for rand()/srand() prototypes */
#include <math.h>		/* for pow() prototype */
#include <sys/syscall.h>	/* for syscall #defines */

#include "tmp/c.h"

init_address_fixup()
{
    /*
     * On PA-RISC, unaligned access fixup is handled by the compiler,
     * not by the kernel.
     */
}

long
random()
{
	return(lrand48());
}

void
srandom(seed)
	int seed;
{
	srand48((long int) seed);
}

getrusage(who, ru)
	int who;
	struct rusage *ru;
{
	return(syscall(SYS_GETRUSAGE, who, ru));
}
