lkml.org 
[lkml]   [1999]   [Sep]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Bug#44654: dpkg: seg faults w/2.3.17; problem traced to sysinfo()
>The best I have so far is
>
> struct _foo
> {
> ...
> ...
> }
>
> struct real_foo
> {
> ...
> ...
> char pad [64-sizeof(struct _foo)] __attribute((packed));
> }

An alternative:

struct real_foo
{
struct _foo {
...
...
} b;
char pad [64-sizeof(struct _foo)];
}

Although this does alter references to <var>.b.<ref>, It does eliminate
the duplicate entry for the contents of _foo. and real_foo.

BTW, the structure (in all forms) assumes that 64 is >= sizeof(struct ...
code. This may not always be the case. How about making it:

char pat [64 - (sizeof(struct _foo) % 64)]

-------------------------------------------------------------------------
Jesse I Pollard, II
Email: pollard@navo.hpc.mil

Any opinions expressed are solely my own.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:53    [W:0.027 / U:1.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site