sysctl.c 693 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /* vi: set sw=4 ts=4: */
  2. /*
  3. * _sysctl() for uClibc
  4. *
  5. * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org>
  6. *
  7. * GNU Library General Public License (LGPL) version 2 or later.
  8. */
  9. #include "syscalls.h"
  10. struct __sysctl_args {
  11. int *name;
  12. int nlen;
  13. void *oldval;
  14. size_t *oldlenp;
  15. void *newval;
  16. size_t newlen;
  17. unsigned long __unused[4];
  18. };
  19. static inline
  20. _syscall1(int, _sysctl, struct __sysctl_args *, args);
  21. int sysctl(int *name, int nlen, void *oldval, size_t * oldlenp,
  22. void *newval, size_t newlen)
  23. {
  24. struct __sysctl_args args = {
  25. name:name,
  26. nlen:nlen,
  27. oldval:oldval,
  28. oldlenp:oldlenp,
  29. newval:newval,
  30. newlen:newlen
  31. };
  32. return _sysctl(&args);
  33. }