Bug 251 - SysVIPC does not work on old kernels
Summary: SysVIPC does not work on old kernels
Status: NEW
Alias: None
Product: uClibc
Classification: Unclassified
Component: Other (show other bugs)
Version: 0.9.30.1
Hardware: PC Linux
: P5 minor
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-31 04:52 UTC by Michael Deutschmann
Modified: 2018-05-03 01:24 UTC (History)
2 users (show)

See Also:
Host: i386-pc-linux-uclibc
Target:
Build:


Attachments
Patch to fix IPC on old kernels (12.13 KB, patch)
2009-03-31 04:52 UTC, Michael Deutschmann
Details
Patch to fix IPC on old kernels, against 0.9.30.3 (11.85 KB, patch)
2010-04-01 02:45 UTC, Michael Deutschmann
Details
Patch to fix IPC on old kernels, against 0.9.31 (11.78 KB, patch)
2010-05-19 01:10 UTC, Michael Deutschmann
Details
Patch to fix IPC on old kernels, against 0.9.32 (11.25 KB, patch)
2011-06-17 13:24 UTC, Michael Deutschmann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Deutschmann 2009-03-31 04:52:50 UTC
Created attachment 215 [details]
Patch to fix IPC on old kernels

uClibc is hard coded to use "64-bit" data structures for SysVIPC that were added in Linux 2.4.  As a result, SysVIPC will not work correctly on older kernels.

I'm including a patch to fix this.  My patch translates the new structures used in userspace into the old compatible kernel structures, as needed.

(The "uclibc_khpresence.h" header created by the patch includes one definition not needed for this specific bug, but it will be used by my solution to a different bug.)
Comment 1 Mike Frysinger 2009-07-20 11:42:19 UTC
are there defines glibc is using for this ?  rather than add a new header, you should update common/bits/kernel-features.h.

i see the perm field is copy & pasted in each function ... if it's the same type, better to add a function to ipc.h and have each implementation call that.
Comment 2 Michael Deutschmann 2010-04-01 02:45:34 UTC
Created attachment 1429 [details]
Patch to fix IPC on old kernels, against 0.9.30.3

Heartened by the recent resolution of bug #253, which is relevant to older kernels than this one, I'm submitting my current patch for this issue, against 0.9.30.3

Now that kernel-features.h exists in the release version, my patch can put the version check there as you want.

I haven't factored out the ipc_perm conversions.  These would need to be put in their own .c file to deliver any space savings, and I'd prefer to avoid messing with the Makefiles in my patch.
Comment 3 Michael Deutschmann 2010-05-19 01:10:35 UTC
Created attachment 1741 [details]
Patch to fix IPC on old kernels, against 0.9.31

Here is a version of the patch against the current release version, 0.9.31.
Comment 4 Michael Deutschmann 2011-06-17 13:24:56 UTC
Created attachment 3409 [details]
Patch to fix IPC on old kernels, against 0.9.32