Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
uname -m

Gives me



getconf LONG_BIT



So my system is 64 or 32 bit? (it's Gentoo and I don't have root access)

share|improve this question
What does a file on which getconf give you? What does /usr/libexec/conf/default link to? – David Schwartz Apr 13 '12 at 11:18
What did you install? – Ramhound Apr 13 '12 at 11:18
up vote 1 down vote accepted

Your CPU is 64-bit. Your kernel is 64-bit. Something else is 32-bit, but it's hard to tell what. Perhaps the getconf that comes first in your path is 32-bit. Look in /usr/libexec/getconf for clues.

Update: It sounds like you have a primarily 32-bit user space. Maybe someone just installed a 64-bit OS to get support for more than 4GB of physical memory. Maybe you have some 64-bit executables. But it's now obvious you have a mixed environment.

share|improve this answer
I don't have /usr/libexec/ :( – Marqin Apr 13 '12 at 11:32
Okay. I wonder how your platform decides which configuration to target then. – David Schwartz Apr 13 '12 at 11:36
from /usr/lib ? I'm not using BSD... – Marqin Apr 13 '12 at 11:43
Fedora/Redhat use /usr/libexec. I guess Gentoo uses /etc/make.conf. – David Schwartz Apr 13 '12 at 12:03

Try arch if it prints x86_64 you have 64bit. You get 32 for LONG_BIT because some applications you use are 32bit, could be in your case a gcc compiled as 32bit.

So your Arch is really 64bit and you can run 64bit applications but you have installed a 32bit gcc.

share|improve this answer
Arch gives me "x86_64". How to check if my gcc is 32-bit? I found out only, that my PHP is 32-bit. – Marqin Apr 13 '12 at 11:30
file $(which gcc) run this in a terminal. If it prints something like this: /usr/bin/gcc: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped you have a 64bit gcc. Otherwise it's probably 32bit take a look what is written behind ELF. – Pierre Geier Apr 13 '12 at 11:51
"/usr/bin/gcc: ELF 32-bit LSB executable, Intel 80386" So 32-bit. – Marqin Apr 13 '12 at 11:53
There you got it. Something in your gentoobox is really missconfigured. And many applications just use gcc to compile even if you have x86_86-pc-linux-gnu-gcc. Somemore information about your Gentoo System would be useful. You're running a 64bit Kernel but have installed 32bit applications. So someone did change the CHOST or your kernel wasn't build on the system with the current installed 32bit gcc. Or it was installed there but cross-compiled. @DavidSchwartz Yes, but it's really uncommon with Gentoo. – Pierre Geier Apr 13 '12 at 12:01
64-bit kernel and 32-bit user space is not necessarily a misconfiguration. – David Schwartz Apr 13 '12 at 12:02

I cant remember if you need root access to be able to read the make.conf on Gentoo but try

grep CHOST /etc/make.conf

If you get


Then your system is set up to compile and install 64 bit packages. Otherwise if you get


Then your system is set up for 32 bit.

If you don't get either then you may need root privileges. Given your uname though I would expect your system to be 64-bit.

share|improve this answer
I got CHOST="i686-pc-linux-gnu" so why arch, uname -m and uname -r show it is 64 bit? – Marqin Apr 13 '12 at 11:50
Okay, so you have a 64-bit CPU, 64-bit kernel, and 32-bit development environment and target platform. It's possible someone just installed a 64-bit kernel on a 32-bit userspace, maybe to get support for more than 4GB of physical memory. Maybe to allow 64-bit executables to work. – David Schwartz Apr 13 '12 at 12:00
@Marqin I strongly suspect that David is right there, your system is set up for 32-bit, but someone has installed a 64-bit kernel. Presumably so that all the memory is available to the OS, but will also ensure that there are no 64-bit compatibility problems (which are pretty rare anyway). – Mokubai Apr 13 '12 at 13:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .