off_t and paddr_t

Hello all,
Can anyone please tell me what are the sizes of these types:- off_t and
paddr_t. Well i have looked in sys/types.h but all i found is typedef _OFF_T
off_t and typedef _Paddrt paddr_t; Could anyone gimme some clues?
Thanks,
Tray.

Tray Karra <tkarra@ces.clemson.edu> wrote:

Hello all,
Can anyone please tell me what are the sizes of these types:- off_t and
paddr_t. Well i have looked in sys/types.h but all i found is typedef _OFF_T
off_t and typedef _Paddrt paddr_t; Could anyone gimme some clues?

#include <stdio.h>
#include <sys/types.h>

main ()
{
printf (“off_t %d\n”, sizeof (off_t));
printf (“paddr_t %d\n”, sizeof (paddr_t));
}

[columbia@ttyp1] ./a.out
off_t 4
paddr_t 4

Cheers,
-RK


Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Books, Video-based and Instructor-led
Training and Consulting at www.parse.com.
Email my initials at parse dot com.

Robert Krten <nospam83@parse.com> wrote:

Tray Karra <> tkarra@ces.clemson.edu> > wrote:
Hello all,
Can anyone please tell me what are the sizes of these types:- off_t and
paddr_t. Well i have looked in sys/types.h but all i found is typedef _OFF_T
off_t and typedef _Paddrt paddr_t; Could anyone gimme some clues?

#include <stdio.h
#include <sys/types.h

main ()
{
printf (“off_t %d\n”, sizeof (off_t));
printf (“paddr_t %d\n”, sizeof (paddr_t));
}

[columbia@ttyp1] ./a.out
off_t 4
paddr_t 4

Cheers,
-RK

Hi RK,

From /usr/include/sys/target_nto.h

#undef __OFF_T
#undef __INO_T
#undef __BLKCNT_T
#undef __FSBLKCNT_T
#undef __FSFILCNT_T
#if _FILE_OFFSET_BITS - 0 == 64
#define __OFF_T _Int64t
#define __INO_T _Int64t
#define __BLKCNT_T _Uint64t
#define __FSBLKCNT_T _Uint64t
#define __FSFILCNT_T _Uint64t
#define OFF_BITS 64
#elif !defined _FILE_OFFSET_BITS || _FILE_OFFSET_BITS - 0 == 32
#define __OFF_T _Int32t
#define __INO_T _Int32t
#define __BLKCNT_T _Uint32t
#define __FSBLKCNT_T _Uint32t
#define __FSFILCNT_T _Uint32t
#define OFF_BITS 32
#else
#error _FILE_OFFSET_BITS value is unsupported
#endif


cburgess@qnx.com

Another handy way to find these things out:

$ ntox86-gdb.exe some_exec
GNU gdb 5.0 (UI_OUT)
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type “show copying” to see the conditions.
There is absolutely no warranty for GDB. Type “show warranty” for details.
This GDB was configured as “–host=i686-pc-cygwin32 --target=ntox86”.
Reading symbols from some_exec…done.
(gdb) ptype off_t
type = long long int
(gdb) ptype paddr_t
type = unsigned int

cheers,

Kris

“Colin Burgess” <cburgess@qnx.com> wrote in message
news:alkq8q$5qi$1@nntp.qnx.com

Robert Krten <> nospam83@parse.com> > wrote:
Tray Karra <> tkarra@ces.clemson.edu> > wrote:
Hello all,
Can anyone please tell me what are the sizes of these types:- off_t
and
paddr_t. Well i have looked in sys/types.h but all i found is typedef
_OFF_T
off_t and typedef _Paddrt paddr_t; Could anyone gimme some clues?

#include <stdio.h
#include <sys/types.h

main ()
{
printf (“off_t %d\n”, sizeof (off_t));
printf (“paddr_t %d\n”, sizeof (paddr_t));
}

[columbia@ttyp1] ./a.out
off_t 4
paddr_t 4

Cheers,
-RK

Hi RK,

From /usr/include/sys/target_nto.h

#undef __OFF_T
#undef __INO_T
#undef __BLKCNT_T
#undef __FSBLKCNT_T
#undef __FSFILCNT_T
#if _FILE_OFFSET_BITS - 0 == 64
#define __OFF_T _Int64t
#define __INO_T _Int64t
#define __BLKCNT_T _Uint64t
#define __FSBLKCNT_T _Uint64t
#define __FSFILCNT_T _Uint64t
#define OFF_BITS 64
#elif !defined _FILE_OFFSET_BITS || _FILE_OFFSET_BITS - 0 == 32
#define __OFF_T _Int32t
#define __INO_T _Int32t
#define __BLKCNT_T _Uint32t
#define __FSBLKCNT_T _Uint32t
#define __FSFILCNT_T _Uint32t
#define OFF_BITS 32
#else
#error _FILE_OFFSET_BITS value is unsupported
#endif


cburgess@qnx.com

looking around /usr/include,
-D_LARGEFILE -D_FILE_OFFSET_BITS=64
seems to make off_t family 64bit.

Is it supported?
(guess not 'cuz getconf LFS_CFLAGS is undefined for now)

kabe