Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: patchkov@acs1.acs.ucalgary.ca (Serguei Patchkovskii)
Subject: Re: mmapping the system clock
Date: 1999/07/08	[thread overview]
Message-ID: <7m2v7c$85k@ds2.acs.ucalgary.ca> (raw)
In-Reply-To: 3784F179.6D410388@netscape.com

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/



       reply	other threads:[~1999-07-08  4:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3784F179.6D410388@netscape.com>
1999-07-08  4:00 ` Serguei Patchkovskii [this message]
     [not found]   ` <37853B51.13C2A901@netscape.com>
1999-07-12  4:00     ` mmapping the system clock Vincent Nicolas
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox