06.08.2013 Views

pSOSystem System Calls - Read

pSOSystem System Calls - Read

pSOSystem System Calls - Read

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

pREPC+ <strong>System</strong> <strong>Calls</strong> localtime_r<br />

localtime_r (Reentrant) Converts the calendar time to broken-down time.<br />

#include <br />

struct tm *localtime_r (<br />

const time_t *timer, /* pointer to calendar time */<br />

struct tm *resultp /* pointer to result */<br />

)<br />

Description<br />

Arguments<br />

Return Value<br />

Error Codes<br />

localtime_r() is the reentrant version of the ANSI function localtime(), as<br />

defined by POSIX 1003.1c. It converts the calendar time pointed to by timep into<br />

broken-down time and stores it in the structure pointed to by resultp. The time is<br />

represented in local time.<br />

The calendar time is generally obtained through a call to time().<br />

timer Points to the calendar time.<br />

resultp Points to the tm structure where localtime_r() stores the result.<br />

The tm structure is defined in the mktime() description on page 3-<br />

111.<br />

Upon success, localtime_r() returns the value of resultp. On failure, it returns<br />

NULL; the only cause of failure is if timer points to a negative value.<br />

No error codes are returned.<br />

<strong>pSO<strong>System</strong></strong> <strong>System</strong> <strong>Calls</strong> 3-93<br />

3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!