Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.unix.questions Subject: Re: Access to structure inMessage-ID: <4890@mimsy.UUCP> Date: Tue, 30-Dec-86 05:22:55 EST Article-I.D.: mimsy.4890 Posted: Tue Dec 30 05:22:55 1986 Date-Received: Tue, 30-Dec-86 21:36:32 EST References: <1485@brl-adm.ARPA> <96@osupyr.UUCP> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 24 In article <96@osupyr.UUCP> dusan@osupyr.UUCP (Dusan Nedeljkovic) writes: >Does anyone have any clues as to how to access the "user" structure >in ? For anyone with source, the answer is `do what ``ps'' does'. For those on a 4BSD Vax, there is a terribly hacky shortcut if you want to read only your own user structure. It is already in your address space. #include #include #include main() { struct user u; u = *(struct user *)(0x80000000 - UPAGES*NBPG); printf("%d %d\n", u.u_uid, u.u_gid); } `Undocumented features are subject to change without notice.' -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7690) UUCP: seismo!mimsy!chris ARPA/CSNet: chris@mimsy.umd.edu