Copyright © tutorialspoint.com
#include <unistd.h> |
struct __sysctl_args { int *name; /* integer vector describing variable */ int nlen; /* length of this vector */ void *oldval; /* 0 or address where to store old value */ size_t *oldlenp; /* available room for old value, overwritten by actual size of old value */ void *newval; /* 0 or address of new value */ size_t newlen; /* size of new value */ }; |
This call does a search in a tree structure, possibly resembling a directory tree under /proc/sys, and if the requested item is found calls some appropriate routine to read or modify the value.
Tag | Description |
---|---|
EFAULT | The invocation asked for the previous value by setting oldval non-NULL, but allowed zero room in oldlenp. |
ENOTDIR | |
name was not found. | |
EPERM | No search permission for one of the encountered directories, or no read permission where oldval was non-zero, or no write permission where newval was non-zero. |
Not all available objects are properly documented.
It is not yet possible to change operating system by writing to /proc/sys/kernel/ostype.
#define _GNU_SOURCE #include <unistd.h> #include <sys/syscall.h> #include <string.h> #include <stdio.h> #include <stdlib.h> #include <linux/sysctl.h> |
Copyright © tutorialspoint.com