From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,508255217f73d30e X-Google-Attributes: gidfee84,public From: patchkov@acs1.acs.ucalgary.ca (Serguei Patchkovskii) Subject: Re: mmapping the system clock Date: 1999/07/08 Message-ID: <7m2v7c$85k@ds2.acs.ucalgary.ca>#1/1 X-Deja-AN: 498807604 References: <3784F179.6D410388@netscape.com> Organization: The University of Calgary Newsgroups: comp.unix.osf.osf1 Wan-Teh Chang (wtc@netscape.com) wrote: : I read in comp.programming.threads that : on Tru64 UNIX one can mmap /dev/sysdev0 : to read the system clock without a system call. : I can't find any info about this technique in the : man pages. Upon examining /dev/MAKEDEV and /sys/include/kern/sysdev_info.h, it appears that you should: a) as root, do: 'cd /dev/;./MAKEDEV sysdev0; chmod go+r sysdev0' b) do p = mmap(0,sizeof(struct sysdef_info),PROT_READ,0, open("/dev/sysdev0",O_RDONLY),0) c) get your time at ((struct sysdef_info*)p)->tv) Do not forget to add appropriate error checking. Caveat: I had not tested this. /Serge.P -- home page: http://www.cobalt.chem.ucalgary.ca/ps/