From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 102b08,6266f9f777efcf2d X-Google-Attributes: gid102b08,public X-Google-Thread: 114b0c,6266f9f777efcf2d X-Google-Attributes: gid114b0c,public X-Google-Thread: f4871,6266f9f777efcf2d X-Google-Attributes: gidf4871,public X-Google-Thread: 1164f8,6266f9f777efcf2d X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1994-01-26 14:47:54 PST Xref: gmd.de comp.sys.sun.apps:6795 comp.sys.hp:28807 comp.parallel.pvm:1328 comp.sys.dec:13079 Path: gmd.de!xlink.net!howland.reston.ans.net!pipex!uknet!EU.net!sun4nl!fwi.uva.nl!casper From: casper@fwi.uva.nl (Casper H.S. Dik) Newsgroups: comp.sys.sun.apps,comp.sys.hp,comp.parallel.pvm,comp.sys.dec Subject: Re: Accessing Real Time Clock in workstations (HPs, Suns, Dec Alphas) Date: 26 Jan 1994 08:11:39 GMT Organization: FWI, University of Amsterdam Distribution: world Message-ID: <2i58jr$8a@mail.fwi.uva.nl> References: <1994Jan26.005700.2572@icaen.uiowa.edu> NNTP-Posting-Host: adam.fwi.uva.nl dsiebert@icaen.uiowa.edu (Doug Siebert) writes: >Could someone explain to me exactly WHY this has to be a system call at all? >It seems to me it would make a GREAT deal of sense to map things like the >hardware clock into a process' address space read-only. Then you don't need >a system call, or a fast trap, just a simple function call (or perhaps a >millicode stub on the HP) Many things could benefit here, the whole UAREA of >a process could be mapped read-only without negative effects, I'd think. Then >getpid() isn't a system call, getuid() isn't, etc., etc. Is there a reason >why this isn't done? Whil for a number of things (getpid(), getppid(), getid()) a memory mapped area in the process space is a solution, nut only because those field hardly ever change. I don't think it is a solution for fast changing things like clocks. Reading the clock (on one processor) while it's being updated by another, may lead to confusing times. And, modern unixes no longer use the tick as granularity of the clock. The hardware clock is used to interpolate the missing microsecond resolution. Reading such a device from userland may be difficult or impossible, and you no longer have ability to hide the details of the clock chip from userland (need a different libc.so for each clock chip you may have, nreaking statically linked programs, or put special hardware detection code in te gettimeofday call). Such things are better left to the kernel. Casper