time.c
来自「这是一个同样来自贝尔实验室的和UNIX有着渊源的操作系统, 其简洁的设计和实现易」· C语言 代码 · 共 28 行
C
28 行
#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <time.h>#include <unistd.h>#include <string.h>#include <stdlib.h>#include "sys9.h"time_ttime(time_t *tp){ char b[20]; int f; time_t t; memset(b, 0, sizeof(b)); f = _OPEN("/dev/time", 0); if(f >= 0) { _PREAD(f, b, sizeof(b), 0); _CLOSE(f); } t = atol(b); if(tp) *tp = t; return t;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?