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 pREPC+ <strong>System</strong> <strong>Calls</strong><br />

ctime Converts the calendar time to a string.<br />

#include <br />

char *ctime (<br />

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

)<br />

Description<br />

Arguments<br />

Return Value<br />

Error Codes<br />

Notes<br />

The ctime() function 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. This call is equivalent to:<br />

asctime(localtime(timer))<br />

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

The buffer used by ctime() to hold the formatted output string is a statically<br />

allocated character array and is overwritten each time the function is called. To save<br />

the contents of the string, you need to copy it elsewhere.<br />

timer Points to the calendar time.<br />

The ctime() function returns the pointer to the converted calendar time string.<br />

Refer to Appendix B.<br />

This function is non-reentrant as it returns a pointer to a statically allocated data<br />

area. The reentrant version of this function is ctime_r().<br />

3-20 <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!