Solaris OS용 Sun Cluster 데이터 서비스 개발 안내서

gettime 유틸리티 코드 목록

gettime 유틸리티는 PROBE 프로그램에서 검사 재시작 간의 경과 시간을 추적하기 위해 사용하는 C 프로그램입니다. 이 프로그램을 컴파일하여 콜백 메소드와 동일한 디렉토리, 즉 RT_basedir 등록 정보에서 가리키는 디렉토리에 배치해야 합니다.


예 B–4 gettime 유틸리티

# This utility program, used by the probe method of the data service, tracks
# the elapsed time in seconds from a known reference point (epoch point). It
# must be compiled and placed in the same directory as the data service callback
# methods (RT_basedir).

#pragma ident   “@(#)gettime.c   1.1   00/05/24 SMI”

#include <stdio.h>
#include <sys/types.h>
#include <time.h>

main()
{
    printf(“%d\n”, time(0));
    exit(0);
}