⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unixtimeserver.c

📁 嵌入式VxWorks开发的各种实验源代码以及相关教程
💻 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 + -