📄 unixtimeserver.c
字号:
/* unixTimeServer.c - example RPC server code */
#include <sys/types.h>
#include <time.h>
#include <stdio.h>
#include "time.h"
#define NULL 0
char ** print_time_1 (void)
{
time_t tloc;
static char * pStr;
/* Get system time in seconds since the EPOCH */
if ((tloc = time ((time_t *)0)) == (time_t)(-1))
{
printf ("time() failed\n");
return (NULL);
}
/* Convert the system time to an ASCII string */
if ((pStr = ctime (&tloc)) == NULL)
{
printf ("ctime failed\n");
return (NULL);
}
return (&pStr);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -