Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!ames!ucbcad!ucbvax!hplabs!hpcea!hpfcdc!rml From: rml@hpfcdc.UUCP Newsgroups: comp.arch Subject: Re: Re: myths & magazines [really: HZ] Message-ID: <4890001@hpfcdc.HP.COM> Date: Tue, 24-Nov-87 19:31:33 EST Article-I.D.: hpfcdc.4890001 Posted: Tue Nov 24 19:31:33 1987 Date-Received: Mon, 30-Nov-87 07:20:12 EST References: <953@winchester.UUCP> Organization: HP Ft. Collins, Co. Lines: 24 > Remedies: Another thing that can help is to have the source try to find HZ rather than define it itself. All systems conforming to ANSI C or POSIX will define CLK_TCK in; unfortunately it's hard to check for POSIX conformance safely because you need to include to do so, and it may not exist on non-POSIX systems. #ifdef __STDC__ #include #define HZ CLK_TCK #else #include /* defines HZ in Sys III and Sys V */ #ifndef HZ #define HZ 60 /* best guess */ #endif #endif I suppose this can cause problems on non-ANSI, non-UN*X machines without ; more #ifdef'ing could then be appropriate. Bob Lenk {ihnp4, hplabs}!hpfcla!rml