Files
sics/tecs/sys_util.c
2000-05-24 15:11:09 +00:00

51 lines
775 B
C

#include <stdlib.h>
#include "str_util.h"
#include "sys_util.h"
void *my_malloc(size_t size, const char *text) {
void *ptr;
ptr=calloc(1,size);
/* printf("new %s %X %d\n", text, ptr, size); */
return(ptr);
}
void my_free(void *ptr) {
/* printf("my_free %X\n", ptr); */
free(ptr);
}
#if __VMS
#include <unixio.h>
int sys_remove_file(F_CHAR(file), int file_len) {
char buf[128];
STR_TO_C(buf, file);
return(delete(buf));
}
int sys_gmt_off() {
return(0);
}
#else
#include <unistd.h>
#include <sys/time.h>
int sys_remove_file_(F_CHAR(file), int file_len) {
char buf[128];
STR_TO_C(buf, file);
return(unlink(buf));
}
int sys_gmt_off_() {
struct tm *timp;
time_t tim;
time(&tim);
timp=localtime(&tim);
return(timp->tm_gmtoff);
}
#endif