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

📄 lib.txt

📁 操作系统设计与实现源码
💻 TXT
📖 第 1 页 / 共 5 页
字号:
01229	_C,
01230	_C,
01231	_C,
01232	_C,
01233	_C,
01234	_C,
01235	_C,
01236	_S,
01237	_P,
01238	_P,
01239	_P,
01240	_P,
01241	_P,
01242	_P,
01243	_P,
01244	_P,
01245	_P,
01246	_P,
01247	_P,
01248	_P,
01249	_P,
01250	_P,
01251	_P,
01252	_N,
01253	_N,
01254	_N,
01255	_N,
01256	_N,
01257	_N,
01258	_N,
01259	_N,
01260	_N,
01261	_N,
01262	_P,
01263	_P,
01264	_P,
01265	_P,
01266	_P,
01267	_P,
01268	_P,
01269	_U|_X,
01270	_U|_X,
01271	_U|_X,
01272	_U|_X,
01273	_U|_X,
01274	_U|_X,
01275	_U,
01276	_U,
01277	_U,
01278	_U,
01279	_U,
01280	_U,
01281	_U,
01282	_U,
01283	_U,
01284	_U,
01285	_U,
01286	_U,
01287	_U,
01288	_U,
01289	_U,
01290	_U,
01291	_U,
01292	_U,
01293	_U,
01294	_U,
01295	_P,
01296	_P,
01297	_P,
01298	_P,
01299	_P,
01300	_P,
01301	_L|_X,
01302	_L|_X,
01303	_L|_X,
01304	_L|_X,
01305	_L|_X,
01306	_L|_X,
01307	_L,
01308	_L,
01309	_L,
01310	_L,
01311	_L,
01312	_L,
01313	_L,
01314	_L,
01315	_L,
01316	_L,
01317	_L,
01318	_L,
01319	_L,
01320	_L,
01321	_L,
01322	_L,
01323	_L,
01324	_L,
01325	_L,
01326	_L,
01327	_P,
01328	_P,
01329	_P,
01330	_P,
01331	_C,
01332	0,
01333	0,
01334	0,
01335	0,
01336	0,
01337	0,
01338	0,
01339	0,
01340	0,
01341	0,
01342	0,
01343	0,
01344	0,
01345	0,
01346	0,
01347	0,
01348	0,
01349	0,
01350	0,
01351	0,
01352	0,
01353	0,
01354	0,
01355	0,
01356	0,
01357	0,
01358	0,
01359	0,
01360	0,
01361	0,
01362	0,
01363	0,
01364	0,
01365	0,
01366	0,
01367	0,
01368	0,
01369	0,
01370	0,
01371	0,
01372	0,
01373	0,
01374	0,
01375	0,
01376	0,
01377	0,
01378	0,
01379	0,
01380	0,
01381	0,
01382	0,
01383	0,
01384	0,
01385	0,
01386	0,
01387	0,
01388	0,
01389	0,
01390	0,
01391	0,
01392	0,
01393	0,
01394	0,
01395	0,
01396	0,
01397	0,
01398	0,
01399	0,
01400	0,
01401	0,
01402	0,
01403	0,
01404	0,
01405	0,
01406	0,
01407	0,
01408	0,
01409	0,
01410	0,
01411	0,
01412	0,
01413	0,
01414	0,
01415	0,
01416	0,
01417	0,
01418	0,
01419	0,
01420	0,
01421	0,
01422	0,
01423	0,
01424	0,
01425	0,
01426	0,
01427	0,
01428	0,
01429	0,
01430	0,
01431	0,
01432	0,
01433	0,
01434	0,
01435	0,
01436	0,
01437	0,
01438	0,
01439	0,
01440	0,
01441	0,
01442	0,
01443	0,
01444	0,
01445	0,
01446	0,
01447	0,
01448	0,
01449	0,
01450	0,
01451	0,
01452	0,
01453	0,
01454	0,
01455	0,
01456	0,
01457	0,
01458	0,
01459	0,
01460	};

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
			src/lib/ansi/clock.c	 	 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

01500	/*
01501	 * clock - determine the processor time used
01502	 */
01503	/* $Header: clock.c,v 1.3 90/01/22 13:08:11 eck Exp $ */
01504	
01505	#include        <time.h>
01506	
01507	#if     defined(__BSD4_2)
01508	
01509	struct timeval {
01510	        long    tv_sec;                 /* seconds */
01511	        long    tv_usec;                /* and microseconds */
01512	};
01513	
01514	#define RUSAGE_SELF     0
01515	#define RUSAGE_CHILDREN -1
01516	
01517	struct rusage {
01518	        struct timeval ru_utime;        /* user time used */
01519	        struct timeval ru_stime;        /* system time used */
01520	        long    ru_maxrss;
01521	        long    ru_ixrss;               /* integral shared memory size */
01522	        long    ru_idrss;               /* integral unshared data size */
01523	        long    ru_isrss;               /* integral unshared stack size */
01524	        long    ru_minflt;              /* page reclaims */
01525	        long    ru_majflt;              /* page faults */
01526	        long    ru_nswap;               /* swaps */
01527	        long    ru_inblock;             /* block input operations */
01528	        long    ru_oublock;             /* block output operations */
01529	        long    ru_msgsnd;              /* messages sent */
01530	        long    ru_msgrcv;              /* messages received */
01531	        long    ru_nsignals;            /* signals received */
01532	        long    ru_nvcsw;               /* voluntary context switches */
01533	        long    ru_nivcsw;              /* involuntary context switches */
01534	};
01535	
01536	void _getrusage(int who, struct rusage *rusage);
01537	
01538	#elif   defined(_POSIX_SOURCE) || defined(__USG)
01539	
01540	struct tms {
01541	        time_t  tms_utime;              /* user time */
01542	        time_t  tms_stime;              /* system time */
01543	        time_t  tms_cutime;             /* user time, children */
01544	        time_t  tms_cstime;             /* system time, children */
01545	};
01546	
01547	clock_t _times(struct tms *buffer);
01548	
01549	#else                                   /* Version 7 UNIX */
01550	
01551	struct tbuffer {
01552	        long proc_user_time;
01553	        long proc_system_time;
01554	        long child_user_time;
01555	        long child_system_time;
01556	};
01557	
01558	clock_t _times(struct tbuffer *buffer);
01559	
01560	#endif
01561	
01562	clock_t
01563	clock(void)
01564	{
01565	#if     defined(__BSD4_2)
01566	        struct rusage rusage;
01567	
01568	        _getrusage(RUSAGE_SELF, &rusage);
01569	
01570	        return (((unsigned long)rusage.ru_utime.tv_sec * CLOCKS_PER_SEC)
01571	                + rusage.ru_utime.tv_usec);
01572	#elif   defined(_POSIX_SOURCE) || defined(__USG)
01573	        struct tms tms;
01574	
01575	        _times(&tms);
01576	        /* Assume that time_t can be converted to clock_t for Sys5 */
01577	        return tms.tms_utime;
01578	#else
01579	        struct tbuffer tbuffer;
01580	
01581	        _times(&tbuffer);
01582	        return tbuffer.proc_user_time;
01583	#endif
01584	}

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
			src/lib/ansi/ctime.c	 	 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

01600	/*
01601	 * ctime - convers the calendar time to a string
01602	 */
01603	/* $Header: ctime.c,v 1.1 89/06/12 15:21:16 eck Exp $ */
01604	
01605	#include        <time.h>
01606	
01607	char *
01608	ctime(const time_t *timer)
01609	{
01610	        return asctime(localtime(timer));
01611	}

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
			src/lib/ansi/difftime.c	 	 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

01700	/*
01701	 * difftime - compute the difference between two calendar times
01702	 */
01703	/* $Header: difftime.c,v 1.4 90/09/11 10:18:44 eck Exp $ */
01704	
01705	#include        <time.h>
01706	
01707	double
01708	difftime(time_t time1, time_t time0)
01709	{
01710	        /* be careful: time_t may be unsigned */
01711	        if ((time_t)-1 > 0 && time0 > time1) {
01712	                return - (double) (time0 - time1);
01713	        } else {
01714	                return (double)(time1 - time0);
01715	        }
01716	}

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
			src/lib/ansi/div.c	 	 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

01800	/*
01801	 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
01802	 * See the copyright notice in the ACK home directory, in the file "Copyright".
01803	 */
01804	/* $Header: div.c,v 1.3 90/03/05 13:47:53 eck Exp $ */
01805	
01806	#include        <stdlib.h>
01807	
01808	static int tmp = -1;
01809	
01810	div_t
01811	div(register int numer, register int denom)
01812	{
01813	        div_t r;
01814	
01815	        /* The assignment of tmp should not be optimized !! */
01816	        if (tmp == -1) {
01817	                tmp = (tmp / 2 == 0);
01818	        }

⌨️ 快捷键说明

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