Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

better check for sysctl() availability #37

Merged
merged 1 commit into from Nov 27, 2014
Merged

better check for sysctl() availability #37

merged 1 commit into from Nov 27, 2014

Conversation

abrodkin
Copy link
Contributor

As it was mentioned before some Linux ports are dropping sysctl support.
But the problem happens if libc in use still installs "sys/sysctl.h" header
even if kernel doesn't support sysctl.

This is exactly the case with uClibc and probably other implementations of libc.
But if we check for existing "sysctl" symbol in libc we're golden at least in
compile-time because libc provides some stub at least.

Signed-off-by: Alexey Brodkin abrodkin@synopsys.com

@abrodkin
Copy link
Contributor Author

Ooops I completely forgot to modify "device-linux.c" replacing HAVE_SYS_SYSCTL_H with HAVE_SYSCTL.
Will do a re-spin.
Please disregard this request.

@reubenhwk
Copy link
Collaborator

Very cool! Thanks!

I'll review in more detail when I get time. Seems like I had doubts about
the sysctl bit a while back. I don't recall what my doubts were. It seems
like sysctl is out of favor/style and is being replaced by files in /proc?

When you do a re-spin, please include a tid-bit about why sysctl is being
dropped and what it is being replaced with.

Thanks in advance,
Reuben

On Wed, Nov 26, 2014 at 1:16 PM, Alexey Brodkin notifications@github.com
wrote:

Ooops I completely forgot to modify "device-linux.c" replacing
HAVE_SYS_SYSCTL_H with HAVE_SYSCTL.
Will do a re-spin.
Please disregard this request.


Reply to this email directly or view it on GitHub
#37 (comment).

As it was mentioned before some Linux ports are dropping sysctl support.
This is intentional move and in future versions of Linux kernel this system
call will eventually go away. As a good alternative one may and should use
procfs (/proc/sys).

Currently we chech if corresponding header "sys/sysctl.h" exists.
But the problem happens if libc in use still installs "sys/sysctl.h" header
while provides no implementation for it.

This is exactly the case with uClibc and probably other implementations of libc.
But if we check for existing "sysctl" symbol in libc we're golden at least in
compile-time because libc provides some stub at least.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
@abrodkin
Copy link
Contributor Author

Do you mean extended explanation about "sysctl" discontinuity in commit message of comment in code itself?

@reubenhwk
Copy link
Collaborator

Not an extended explanation. Any background info will do (and of course I
can't require anything). The last I really read up on it I only found a
LWN article posted in 2007. I'm mainly just wanting to know anything new
that I don't already know so I can stay informed. A link to an article, or
anything helpful, would be good.

Thanks in advance,
Reuben

On Wed, Nov 26, 2014 at 1:43 PM, Alexey Brodkin notifications@github.com
wrote:

Do you mean extended explanation about "sysctl" discontinuity in commit
message of comment in code itself?


Reply to this email directly or view it on GitHub
#37 (comment).

@reubenhwk
Copy link
Collaborator

Oh, not a comment in the code. Commit message can be short and simple.
I'm mainly looking for more info on the topic...

On Wed, Nov 26, 2014 at 1:55 PM, Reuben Hawkins reubenhwk@gmail.com wrote:

Not an extended explanation. Any background info will do (and of course I
can't require anything). The last I really read up on it I only found a
LWN article posted in 2007. I'm mainly just wanting to know anything new
that I don't already know so I can stay informed. A link to an article, or
anything helpful, would be good.

Thanks in advance,
Reuben

On Wed, Nov 26, 2014 at 1:43 PM, Alexey Brodkin notifications@github.com
wrote:

Do you mean extended explanation about "sysctl" discontinuity in commit
message of comment in code itself?


Reply to this email directly or view it on GitHub
#37 (comment).

@abrodkin
Copy link
Contributor Author

Well, frankly I haven't been tracking this sysctl topic tightly.

The only thing I know and for me this one is the most important that in UAPI headers which are a way to go for all architectures in Linux kernel and a must for new architectures "sysctl" syscall was put under __ARCH_WANT_SYSCALL_DEPRECATED ifdef:
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/include/uapi/asm-generic/unistd.h#n813

So technically it's still possible to enable it but the question is when this deprecated section will go away completely?

@abrodkin
Copy link
Contributor Author

Ok, so I added a change in "device-linux.c" replacing HAVE_SYS_SYSCTL_H with HAVE_SYSCTL and now if the patch looks good to you please consider applying.

Thanks

reubenhwk added a commit that referenced this pull request Nov 27, 2014
better check for sysctl() availability
@reubenhwk reubenhwk merged commit 1578039 into radvd-project:master Nov 27, 2014
@reubenhwk
Copy link
Collaborator

I merged the request, but it didn't build on linux, so I reverted the
change.

On Wed, Nov 26, 2014 at 10:57 PM, Alexey Brodkin notifications@github.com
wrote:

Ok, so I added a change in "device-linux.c" replacing HAVE_SYS_SYSCTL_H
with HAVE_SYSCTL and now if the patch looks good to you please consider
applying.

Thanks


Reply to this email directly or view it on GitHub
#37 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants