제가 localhost_r 의 사용법이 맞나요??
글쓴이: segenny / 작성시간: 월, 2007/04/23 - 8:56오후
안녕하세요
혹시 thread_safe 함수 구현중에 localhost_r 의 사용법이 제가 밑에 사용하는것이
맞는 건가요??
time_t now;
struct tm *now_t, rt;
char file_name[1024]="error.log";
time(&now);
now_t = localtime_r(&now, &rt);
error_log=fopen(file_name,"a++");
fprintf(file_name,"[%02d-%02d %02d:%02d][ROOM:%04d][%s] %s",now_t->tm_mon+1, now_t->tm_mday, now_t->tm_hour, now_t->tm_min,room_number,stb_mac, err_message);
....
그리고 now_t = localtime_r(&now, &rt) 와 now_t = localtime_r((const long*)&now, &rt);
와 무슨 차이가 있나요?? Man page 에 참조하면 두번째걸 써야하는것 같은데..
아시는 분들은. 조언부탁드립니다. 그리고 어려운 시간 내줘서 감사합니다.^^;
Forums:
댓글 달기