Path: utzoo!attcan!uunet!ncrlnk!ncr-sd!hp-sdd!hplabs!hpda!hpcupt1!dvl From: dvl@hpcupt1.HP.COM (Doug Larson) Newsgroups: comp.sys.hp Subject: Re: u.u_comm on HP9000/800 Message-ID: <7410024@hpcupt1.HP.COM> Date: 8 Nov 88 01:00:21 GMT References: <17014@santra.UUCP> Organization: Hewlett Packard, Cupertino Lines: 23 I assume you are porting from a Berkeley 4.x system. In these systems the u area is located at a constant location in the third quadrant. In HP-UX on the 800 series, this is not the case. The u areas are in an array in system space. E.g. proc[i] matches u[i]. The tricky part comes about for two reasons; The u areas are not sizeof(struct user) apart, and of course the particular u area you are interested in may not be mapped in. In any case, to find u[i]; #define USIZ (sizeof(struct user)) /* make sure the pid array is double word aligned!! */ #define PIDSIZ ((npids * sizeof(int)+sizeof(double) -1) & ~(sizeof(double) -1)) byte address = ubase + i*(USIZ+PIDSIZ) (Make appropriate type casts) gives you the byte address system virtual space. Ubase is where the user areas start. Good luck! Doug Larson hplabs!hpda!dvl