Sigrid Solveig Haflínudóttirrename to shortendf55d101 year agoHistory
97 lines · 1.2 KB · C
RawDownload
#include <OSUtils.h>#include "sl.h"#include "timefuncs.h" doublesec_realtime(void){	struct timeval now; 	if(gettimeofday(&now, nil) != 0)		return 0.0;	return (double)now.tv_sec + (double)now.tv_usec/1.0e6;} /* * nsec() is wallclock and can be adjusted by timesync * so need to use cycles() instead, but fall back to * nsec() in case we can't */u64intnanosec_monotonic(void){	return 0;} voidtimestr(double s, char *buf, int sz){	USED(s); USED(sz);	buf[0] = 0;} doubleparsetime(const char *s){	USED(s);	return 0.0;} voidsleep_ms(int ms){	USED(ms);} intftruncate(int f, soffset sz){	USED(f); USED(sz);	return -1;} char *getcwd(char *buf, usize len){	USED(buf); USED(len);	return nil;} intchdir(const char *path){	USED(path);	return -1;} intaccess(const char *path, int amode){	USED(path); USED(amode);	return -1;} voidsys_init(void){} char os_version[10]; static const u8int boot[] = {#include "sl.boot.h"}; intmain(int argc, char **argv){	static SysEnvRec r;	memset(&r, 0, sizeof(r));	SysEnvirons(2, &r);	snprintf(		os_version, sizeof(boot),		"%d.%d.%d",		r.systemVersion>>8,		(r.systemVersion>>4)&0xf,		(r.systemVersion>>0)&0xf	);	slmain(boot, sizeof(boot), argc, argv);}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t