| Summary: | accept4 included unconditionally | ||
|---|---|---|---|
| Product: | uClibc | Reporter: | Michael Deutschmann <michael> |
| Component: | Networking | Assignee: | unassigned |
| Status: | NEW --- | ||
| Severity: | minor | CC: | uclibc-cvs |
| Priority: | P5 | ||
| Version: | 0.9.32 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Host: | Target: | ||
| Build: | |||
| Attachments: | Patch to omit accept4() on kernels that don't support it. | ||
I think it should rather be -#elif defined(__NR_socketcall) +#elif defined(__NR_socketcall) && defined __ASSUME_ACCEPT4 Comment on attachment 3415 [details]
Patch to omit accept4() on kernels that don't support it.
this patch is wrong. __ASSUME_ACCEPT4 means "i can assume accept4 exists". if it is undefined, it does not mean "you may not use accept4".
if you have __NR_accept4 defined, then it means your kernel headers say your target supports it. uClibc currently binds itself to the version of the kernel headers you built it against, so if you want to run on kernel version x.y.z, you better use kernel headers that are x.y.z or *older*. Whoops. I meant to add my "#ifdef __ASSUME_ACCEPT4" above the "#ifdef __NR_accept4", not below. It was pretty much a fluke that the patch worked for me (compiled OK and with no accept4 visible to nm). Your way works too, though. I've altered my patch to just add the #include and change the #elif line as you recommend, and the resulting code is byte for byte identical. |
Created attachment 3415 [details] Patch to omit accept4() on kernels that don't support it. The accept4() call is built even on a kernel that does not support it. I've attached a patch to make uClibc obey the __ASSUME_ACCEPT4 macro already present in kernel-features.h.