How to know which programming model is used on may Linux machine

2012-07-25 Thread Pritam Bankar
Hi,

AFAIK there are three programming model that can be chosen on 64 bit
environment. These models are LP64, ILP64, LLP64

Question 1)  But how can I know which model is used on my system ?

Question 2) Does long long data type is limited for LLP64 type model ?

(My system is redhat 6.2 64bit)



Thanks

Pritam Bankar

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: How to know which programming model is used on may Linux machine

2012-07-25 Thread Dave Hylands
Hi Pritam,

On Wed, Jul 25, 2012 at 4:01 AM, Pritam Bankar
pritambankar1...@gmail.com wrote:
 Hi,

 AFAIK there are three programming model that can be chosen on 64 bit
 environment. These models are LP64, ILP64, LLP64

 Question 1)  But how can I know which model is used on my system ?

Write a little program to print the sizes of the various types which
distinguish the models. Something like:

#include stdio.h
int main(int argc, char **argv)
{
printf(sizeof(int) = %zu\n, sizeof(int));
printf(sizeof(long) = %zu\n, sizeof(long));
printf(sizeof(void *) = %zu\n, sizeof(void *));
return 0;
}

which, when run on my 64-bit system produces:

sizeof(int) = 4
sizeof(long) = 8
sizeof(void *) = 8

which according to http://www.unix.org/version2/whatsnew/lp64_wp.html
makes it an LP64 model.

 Question 2) Does long long data type is limited for LLP64 type model ?

I think that their table means that its 64 bits for all.

-- 
Dave Hylands
Shuswap, BC, Canada
http://www.davehylands.com

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies