06.08.2013 Views

pSOSystem System Calls - Read

pSOSystem System Calls - Read

pSOSystem System Calls - Read

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

ctime_r (Reentrant) Converts the calendar time to a string.<br />

#include <br />

char *ctime_r (<br />

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

char *buf, /* result buffer */<br />

int buflen /* result buffer length */<br />

)<br />

Description<br />

Arguments<br />

Return Value<br />

Error Codes<br />

ctime_r() is the reentrant version of the ANSI function ctime(), as defined by<br />

POSIX 1003.1c. It converts the calendar time pointed to by timer to a string<br />

representation of the form:<br />

Sun Jan 1 12:30:13 1995\n\0<br />

The time is represented in local time. ctime_r() stores the string in the buffer<br />

pointed to by buf, which is assumed to have space for at most buflen characters.<br />

An error may be returned if the converted string contains more than buflen<br />

characters.<br />

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

timer Points to the calendar time.<br />

buf Points to the buffer where ctime_r() stores the result.<br />

buflen Specifies the size of buf.<br />

Upon success, asctime_r() returns the value of buf. On failure, it returns NULL<br />

and sets errno.<br />

Refer to Appendix B.<br />

3-22 <strong>pSO<strong>System</strong></strong> <strong>System</strong> <strong>Calls</strong>

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

Saved successfully!

Ooh no, something went wrong!