/*
 *  lib/std.c
 *
 *  Wrapper for standard functions
 *
 *  Copyright (C) 2004  Phoenix Grid Computing Project
 *                      ( http://www.logos.ic.i.u-tokyo.ac.jp/phoenix/ )
 *
 *  2004-11-26  Implemented basic functions 
 *              by Kaneda Kenji
 */


#include "common.h"
#include "debug.h"
#include <string.h>
#include <sys/utsname.h>


void *
Malloc ( size_t size )
{
     void *ret;

     assert ( size > 0 );
     
     ret = malloc ( size );

     if ( ret == NULL )
	     sys_failure ( "malloc" );

     return ret;
}

void
Free ( void * ptr )
{
	assert ( ptr != NULL );

	free ( ptr );
}

char *
Strdup ( const char *s )
{
	char *ret;
	
	assert ( s != NULL );
	
	ret = strdup(s);

	if ( ret == NULL )
		sys_failure ( "strdup" );

	return ret;
}

void
mzero ( void *s, size_t n )
{
	memset ( s, 0, n );
}
