This is a multi-part message in MIME format.
------_=_NextPart_001_01C7C239.7EBBDA5D
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi,
=20
>>
>> Can we always rely on the fact that gcc will pad the following =
structure?
>>
>> typedef struct {
>> int descrp; SYSCALL64_STRUCT_ATTR;
>> (Automatic padding here?)
>> long long pos; SYSCALL64_STRUCT_ATTR;
>> int mode; SYSCALL64_STRUCT_ATTR;
>> } lseek64_t;
>>
>> What is the correct way to make it portable? Explicitly added padding =
fields?
>may be i am missing something but why is this not portable? And how
>does padding makes this portable?
Hi ... sorry I could not ask very well, what I wanted to. I have a piece =
of code that ASSUMES that the above structure is padded (and I do not =
want to change that code). So how can I make sure that this structure is =
always padded (Is there any other way apart from adding explicit padding =
field?)=20
=20
So like we have a "packed" gcc attribute, do we have a "padded" gcc =
attribute or something like that (that ensures that gcc will always pad =
this structure.).
=20
Thanks,
Rajat
=20
=20
------_=_NextPart_001_01C7C239.7EBBDA5D
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
charset=3Diso-8859-1">=0A=
=0A=
=0A=
=0A==0A=
size=3D2>Hi,
=0A=
=0A=
>>
>> Can we always rely on =
the fact =0A=
that gcc will pad the following structure?
>>
>> =
typedef =0A=
struct {
>> int =0A=
descrp; =0A=
SYSCALL64_STRUCT_ATTR;
>> (Automatic =
padding =0A=
here?)
>> long long pos; =0A=
SYSCALL64_STRUCT_ATTR;
>> int =0A=
mode; =0A=
SYSCALL64_STRUCT_ATTR;
>> } lseek64_t;
>>
>> =
What is =0A=
the correct way to make it portable? Explicitly added padding =0A=
fields?
=0A=
>may be i am missing something but why =
is this not =0A=
portable? And how
>does padding makes this =
portable?
=0A=
Hi ... sorry I could not ask very well, =
what I wanted =0A=
to. I have a piece of code that ASSUMES that the above structure is =
padded =0A=
(and I do not want to change that code). So how can I =
make sure =0A=
that this structure is always padded (Is there any other way apart from =
adding =0A=
explicit padding field?)
=0A=
=0A=
So like we have a "packed" gcc attribute, =
do we have a =0A=
"padded" gcc attribute or something like that (that ensures that gcc =
will always =0A=
pad this structure.).
=0A=
=0A=
Thanks,
=0A=
Rajat
=0A=
=0A=
=0A=