Date: Thu, 8 Jan 2004 16:45:23 -0500 From: John Baldwin <jhb@FreeBSD.org> To: des@des.no (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=) Cc: alpha@freebsd.org Subject: Re: structure padding Message-ID: <200401081645.24241.jhb@FreeBSD.org> In-Reply-To: <xzpoete2kr7.fsf@dwp.des.no> References: <xzpoete42r1.fsf@dwp.des.no> <200401081542.49500.jhb@FreeBSD.org> <xzpoete2kr7.fsf@dwp.des.no>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday 08 January 2004 04:28 pm, Dag-Erling Smørgrav wrote:
> John Baldwin <jhb@FreeBSD.org> writes:
> > Maybe:
> >
> > struct eproc {
> > union {
> > pid_t e_sid;
> > long e_oldspare;
> > }
> > long e_spare[1];
> >
> > (I think gcc supports anonymous unions like that.)
>
> I thought about that, but it's butt-ugly...
>
> Does anyone have an Alpha running 4.x that I could test this on?
>
> > In 6.0 you could remove the union hack and change the ABI, assuming that
> > you want to put this in 5.x as well.
>
> 5.x has a completely different struct kinfo_proc which already
> contains the session id.
Actually, why not just use a long for the e_sid instead of pid_t? A long will
certainly fit a pid_t. Doesn't hurt for it to be too big. So just:
char e_comm[]
long e_sid;
long e_spare;
--
John Baldwin <jhb@FreeBSD.org> <>< http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve" = http://www.FreeBSD.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200401081645.24241.jhb>
