How to know which programming model is used on may Linux machine
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
Hi Pritam, On Wed, Jul 25, 2012 at 4:01 AM, Pritam Bankar <pritambankar1988@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
participants (2)
-
Dave Hylands -
Pritam Bankar