sys/stat.h moved from libc6-dev to libc6-dev-i386

Asked by Nedim Srndic


I am trying to compile a program I wrote ( on Ubuntu 11.10, AMD64 version. The default installation is missing some include files (e.g., sys/stat.h) I use from the program. It seems sys/stat.h has moved from the libc6-dev (in Ubuntu 10.10) to the libc6-dev-i386 package. I want to build a 64bit executable. The program works well on 64bit versions of Ubuntu 10.10 and 11.04.

Is the usage of libc6-dev-i386 recommended in this case? Is there a different package for 64bit applications? I don't understand why this package has the i386 in it's name. The POSIX spec for sys/stat.h ( doesn't say that this is a 32bit-only include file. I must be missing something here.

In short: what package do I need to install on Ubuntu 11.10 64bit before I compile a program that includes sys/stat.h?

Nedim Srndic

Question information

English Edit question
Ubuntu eglibc Edit question
No assignee Edit question
Solved by:
Nedim Srndic
Last query:
Last reply:
Revision history for this message
enubuntu (mr.tennents) said :

Are you using a 64 bit version?
Run uname -a for security in your terminal and paste here the result.

See also here, maybe this will help you:

Revision history for this message
Nedim Srndic (nedim-sh) said :

The machine in question is a 64 bit virtual machine with Ubuntu 11.10 64bit, running on a 64 bit PC with an Ubuntu 10.10 64bit OS. This is confirmed by the "x86_64" string that I get from running uname -a on BOTH the virtual and the physical machine.

From the search link you posted, you can see that there is a strange thing going on here. The libc6-dev-i386 is made for the AMD64 architecture, while the libc6-dev-amd64 is made for the i386 architecture. As far as I can tell, it should the other way around, i.e., the names are mixed up.

Revision history for this message
enubuntu (mr.tennents) said :

I don't know this.

I think that you should open a bug here:

If it is not a bug, you might receive more help from expert user with a bug report.

Revision history for this message
Nedim Srndic (nedim-sh) said :

Thank you for your help, we might have found a bug. I will report it now.

Revision history for this message
bhs (bharath-vegito) said :

Include files are not specific to 32-bit or 64-bit. they may have conditional compilation w.r.t 32/64bit. To build a 64bit. You should be able to include the file. Could you mention what the function you want to use which is declared in stat.h?

Revision history for this message
Nedim Srndic (nedim-sh) said :

It's been a while since this happened. Since then, I discovered that I need to install the package libc6-dev-i386 on Ubuntu 11.10 64-bit if I want to include sys/stat.h in my programs. It was weird to me that the package name ends in "i386" on a 64-bit system.

The function I was using is open(2).