sysctl.c 893 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* vi: set sw=4 ts=4: */
  2. /*
  3. * _sysctl() for uClibc
  4. *
  5. * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
  6. *
  7. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  8. */
  9. #include <sys/syscall.h>
  10. /* psm: including sys/sysctl.h would depend on kernel headers */
  11. extern int sysctl (int *__name, int __nlen, void *__oldval,
  12. size_t *__oldlenp, void *__newval, size_t __newlen) __THROW;
  13. struct __sysctl_args {
  14. int *name;
  15. int nlen;
  16. void *oldval;
  17. size_t *oldlenp;
  18. void *newval;
  19. size_t newlen;
  20. unsigned long __unused[4];
  21. };
  22. static inline
  23. _syscall1(int, _sysctl, struct __sysctl_args *, args);
  24. int sysctl(int *name, int nlen, void *oldval, size_t * oldlenp,
  25. void *newval, size_t newlen)
  26. {
  27. struct __sysctl_args args = {
  28. name:name,
  29. nlen:nlen,
  30. oldval:oldval,
  31. oldlenp:oldlenp,
  32. newval:newval,
  33. newlen:newlen
  34. };
  35. return _sysctl(&args);
  36. }