doesn't include atomic operations

Bug #65218 reported by Stephen Touset
6
Affects Status Importance Assigned to Milestone
linux-source-2.6.17 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: linux-libc-dev

The atomic operations test_and_set_bit et al. used to be in the linux-kernel-headers package. Since that's now a virtual package and everything's now in linux-libc-dev, the header files for these operations are no longer included.

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. You reported this bug a while ago and there hasn't been any activity in it recently. We were wondering is this still an issue for you? Can you try with latest Ubuntu release? Thanks in advance.

Changed in linux-source-2.6.17:
status: New → Incomplete
Revision history for this message
Seamus Allan (seamus-allan) wrote :

Hi, this is still a problem.

We have a software product that uses test_and_set_bit (used to be included from asm/bitops.h) which we cannot build under Ubuntu.

Currently we build under a cross compiling environment (i.e. Scratchbox) but this is less than ideal.

Any ideas/plans to bring these back?

Cheers
Seamus

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Headers provided by linux-libc-dev are not meant to be used to build third-party modules for your kernel. You'd better use linux-headers-* packages for that.

Did you install linux-headers-* from the kernel you want built your software for ?

Revision history for this message
Seamus Allan (seamus-allan) wrote :

Yes we have linux-headers-* installed, and the asm/bitops.h isn't there (the asm directory isn't even).

For this particular problem I have found a workaround using C's builtin atomic memory functions, but I suspect that the bitops method is a little cleaner/lighter.

Incidentally, we are not using this to create a kernel module, just some software that needs to do low level (& atomic) memory operations for lightweight locking of variables in shared memory. But if the original post on this thread is correct, isn't linux-headers- a virutal package for linux-libc-dev?

Cheers

Seamus

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Hi Seamus,

I've used the word "Module" because the <asm/atomic.h> and <asm/bitops.h> header files were not designed for use in userspace, and would fail to compile on some architectures while silently giving non-atomic behavior on others. The C compiler provides its own atomic built-in functions that are suitable for use in userspace programs instead, like the way you did.

You can refer to discussion on lklm at http://marc.info/?l=linux-kernel&m=115299997829268&w=2

linux-headers and linux-headers-2.6 are virtual packages that provides linux-headers-2.6.nn-nn-vvvvvv suitable for the kernel installed on your system.

Hence, those headers won't be back in linux-libc-dev

Thanks again for your time and don't hesitate to submit bug reports in the future.

Changed in linux-source-2.6.17:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.