Softlink errno.h

I am using Ubuntu 11.04 with PGroup C/C++ Workstation 11.7. It would not compile because it could not find the errno.h file include file. In the previous versions of Ubuntu that file was in

/usr/include/asm/errno.h

but it 11.04 it is in

/usr/include/generic-asm/errno.h

once the compiler finds the file then everything is okay. But it must find the file.

I believe that this can be corrected using a softlink. But I am unsure of the syntax.

ln -s /usr/include/generic-asm/errno.h /usr/include/asm/errno.h

but this does not work.

What is the syntax?

Also, how do I check that the that the link has been created.

Will the link last or will it dissappear when I restart the computer.

What is the command to remove the link if I should want to.

Any help appreciated.

James

Hi James,

I am using Ubuntu 11.04 with PGroup C/C++ Workstation 11.7. It would not compile because it could not find the errno.h file include file. In the previous versions of Ubuntu that file was in

/usr/include/asm/errno.h
but it 11.04 it is in
/usr/include/generic-asm/errno.h

According to this post, this is a Ubuntu bug. https://bugs.launchpad.net/ubuntu/+source/linux/+bug/778047. They moved errno.h without updating the include next in"linux/errnor.h" from asm to generic-asm.

The work around given is to install the “gcc-multilib” package. Or create a symlink from /usr/inluce/asm-generic to /usr/include/asm

sudo ln -s /usr/include/asm-generic /usr/include/asm



ln -s /usr/include/generic-asm/errno.h /usr/include/asm/errno.h

What is the syntax?

This is the correct syntax. For full details, please refer your system’s man page about ‘ln’. i.e. “man ln”

but this does not work.

What’s the error? Though, I’m guessing the “/usr/include/asm/” directory doesn’t exist or you don’t have permissions to create the link.

Also, how do I check that the that the link has been created.

ls -l /usr/include/asm

Will the link last or will it dissappear when I restart the computer.

It will be there after a reboot.

What is the command to remove the link if I should want to.

rm /usr/include/asm/errno.h

  • Mat

I almost lost all info on my harddrive after a fualty Valgrind install. But everything seems to be back to normal now. I do have an issue with this softlink, however. The directory asm-generic does exist and in it is the errno.h file. This causes an error whenever, I run a Prgoup c program that uses the errno.h header file. It looks for it in /usr/include/asm directory which of course is not there. The asm directory does not even exist.

When ever I run the command

ln -s /usr/include/asm-generic /usr/include/asm

nothing happens. It says the file asm exists and stops. Now the file exists in reverse video with a link to asm-generic as shown:

/usr/include/asm -> /usr/include/asm-generic

Now this is a link, but I believe it is in the wrong direction.

When I try the command in the /usr/include/ directory

mkdir asm, nothing happens.

The output states that asm is a file thus no directory is created.

So I am stuck with a reverse link

/usr/include/asm -> /usr/include/asm-generic

and I am unable to create a directory - asm. I also cannot create the correct link

/usr/include/asm-generic -> /usr/inlcude/asm

I am reluctant to delete this link because I believe that it might remove a needed Ubuntu file.

So what do I do.

The problem as stated at the begining of this thread exists again with the new backwards link as I stated above.

Again, what do I do?


THX 1138

Hi THX1138,

Again, what do I do?

Since this is a Ubuntu issue, you might try asking them as to the best work around or following the directions in the Ubuntu issue report.

  • Mat