using off_t in talloc
Love Hörnquist Åstrand
lha at kth.se
Thu Jul 20 14:29:43 GMT 2006
"Stefan (metze) Metzmacher" <metze at samba.org> writes:
> Hi *,
> I thought about removing off_t from talloc,
> it's used as return value of talloc_total_size() and
> I have added some configure checks
> to the standalone build of talloc.
> And it seems that:
> sizeof(off_t) is 8 (only Stratos has 4)
> sizeof(size_t) is 4 on x86 and 8 on 64bit platforms
> Are there any platforms where the total RAM-size per
> process doesn't fit into size_t?
short answer: no.
size_t is the type returned by sizeof operator. c99 defines MAX_SIZE (that
is the maximum value of size_t) to be 65535, or greater.
That said, you should look at mmap for a clue how its used. size_t for
memory sizes, off_t is for disk offsets, so depending on what you want to
return, memory offset or disk offset you have to choose from size_t or
contains defintions for both types.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 823 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20060720/f2f5a7bf/attachment.bin
More information about the samba-technical