Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!husc6!cmcl2!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c,comp.unix.wizards Subject: Re: pointer alignment when int != char * Message-ID: <6376@brl-smoke.ARPA> Date: Mon, 31-Aug-87 21:48:40 EDT Article-I.D.: brl-smok.6376 Posted: Mon Aug 31 21:48:40 1987 Date-Received: Sat, 5-Sep-87 00:47:04 EDT References: <493@its63b.ed.ac.uk> <6061@brl-smoke.ARPA> <3812@spool.WISC.EDU> <7939@think.UUCP> <588@murphy.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 15 Xref: mnetor comp.lang.c:4098 comp.unix.wizards:4017 In article <588@murphy.UUCP> dave@murphy.UUCP (Dave Cornutt) writes: >... However, I will say this, because I don't >think the standard has really addressed it: there should be a way to take >any pointer and generate a byte offset from byte 0 in whatever address >space the code is running in. The reason is that you need such a beast >to feed to lseek if you want to access something through one of the >/dev/mem devices (or maybe /proc). The ANSI C standard doesn't address this (pun intended?) because the process may have incommensurable multiple data address spaces. It cannot dictate the mapping to be used by UNIX /dev/*mem and similar facilities; that's not within the scope of the C standard, which also has to apply to non-UNIX-like environments. It is up to the operating system implementation to make things like that work; it has nothing to do with the C language.