tlinux.c

来自「su 的源代码库」· C语言 代码 · 共 29 行

C
29
字号
/* Copyright (c) Colorado School of Mines, 2006.*//* All rights reserved.                       */#include "stdtest.h"#include <time.h>MAIN(){	struct tm*	tmbufp;	time_t		l1, l2;	FILE*		f;	char		buf[1024];	if(!(f = fopen(tstfile(0),"w+")) )		terror("Open file to write");	/* these sometimes call rare Stdio functions such as fread_unlocked.	   Hopefully, iffe did catch these and built them.	*/	l2 = time(&l1);	tmbufp = localtime(&l2);	fprintf(f, "%ld %ld %p", l1, l2, tmbufp);	fseek(f, 0L, 0);	fread(buf, 1, sizeof(buf), f);	TSTEXIT(0);}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?