Opened 15 years ago
Closed 15 years ago
#412 closed defect (fixed)
Better socketpair checking for Solaris systems
Reported by: | Pavel Strashkin | Owned by: | Olly Betts |
---|---|---|---|
Priority: | normal | Milestone: | 1.0.17 |
Component: | Omega | Version: | 1.0.16 |
Severity: | normal | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Operating System: | Solaris |
Description
With current configure.ac file state HAVE_SOCKETPAIR macros still undefined because socketpair is not in default C library. Its wrong to check for this function using AC_CHECK_FUNCS macros on Solaris systems. I've attach the patch which fix this defect and as result enable CPU time and memory limits to improve software stability.
Attachments (1)
Change History (6)
by , 15 years ago
Attachment: | fix-solaris-socketpair.patch added |
---|
comment:1 by , 15 years ago
comment:2 by , 15 years ago
Milestone: | 1.0.17 → 1.1.3 |
---|---|
Status: | new → assigned |
Thanks for spotting this.
We shouldn't hard code an OS name check for this. A quick search suggest that there are other platforms which need an extra library for socketpair().
Richard's suggestion looks plausible. I have an account on a Solaris box, so I can test that.
Both this and the original patch will needlessly link other Omega binaries with -lxnet, but that's perhaps not worth the effort to avoid.
Marking for 1.1.3 as we'll fix it there first, then backport.
comment:3 by , 15 years ago
Thanks for review. P.S. This is not hardcoding - this is normal way of using "case" operator. If you'll look at aclocal.m4 you'll see many places where that operator uses to check operation system/platform type.
comment:4 by , 15 years ago
Milestone: | 1.1.3 → 1.0.17 |
---|
The checks on $host_os in aclocal.m4 are from libtool, which sadly is closely coupled to details of different OSes and compilers (probably by necessity, or at least practicality), and because of that sometimes needs updating for new major OS and compiler releases.
The ideal for configure tests is not to key off the OS or version numbers but to test features instead. Other platforms besides Solaris may also need -lxnet, and it's possible some versions of Solaris may not (particular future versions) so it's more robust to just check if socketpair() is found with no extra libraries and if not to retry with -lxnet, regardless of the current value of $host_os.
Richard's suggestion looks good, so I've gone with that, and committed to trunk as r13580. I tested 13582 configures and builds on Solaris with socketpair enabled.
Marking for backporting for 1.0.17.
comment:5 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Backported for 1.0.17 as r13601.
Thanks for the patch.
I wonder if using:
instead of your case clause would work? (possibly after fixing some obvious errors - I've not tested this at all). If so, it would be nicer than hardcoding some behaviour for solaris. It's plausible that other environments will have another library that we need to look for socketpair in.
Olly's better at this sort of stuff than me, so I'll wait for him to wake up and comment on this.