jeudi 13 novembre 2014

How to determine the wordsize in Linux kernel programming?


Vote count:

0




In userspace code, the macro __WORDSIZE is used, included in <bits/wordsize.h>. However, when I do Linux kernel programming, the __WORDSIZE seems not to be allowed to used.


If <bits/wordsize.h> is included, it will receive a compile error, saying:



error: bits/wordsize.h: No such file or directory


but if <bits/wordsize.h> is not included, it will receive another compile error, saying:



error: ‘__WORDSIZE’ undeclared.


It seems that kernel programming doesn't support the <bits/wordsize.h> header file. What should I do to judge the wordsize in Linux kernel programming?


P.S. my compiler version is gcc (GCC) 4.4.6.



asked 26 secs ago







How to determine the wordsize in Linux kernel programming?

Aucun commentaire:

Enregistrer un commentaire