.\" Modified Tue Oct 22 22:28:41 1996 by Eric S. Raymond <esr@thyrsus.com>
.\" Modified Mon Jan 5 20:31:04 1998 by aeb.
.\"
-.TH SYSCTL 2 2012-12-22 "Linux" "Linux Programmer's Manual"
+.TH SYSCTL 2 2019-03-06 "Linux" "Linux Programmer's Manual"
.SH NAME
sysctl \- read/write system parameters
.SH SYNOPSIS
.nf
.B #include <unistd.h>
-.br
.B #include <linux/sysctl.h>
-.sp
+.PP
.BI "int _sysctl(struct __sysctl_args *" args );
.fi
-
+.PP
.IR Note :
There is no glibc wrapper for this system call; see NOTES.
.SH DESCRIPTION
.B Do not use this system call!
See NOTES.
-
+.PP
The
.BR _sysctl ()
call reads and/or writes kernel parameters.
The argument has the form
.PP
.in +4n
-.nf
+.EX
struct __sysctl_args {
int *name; /* integer vector describing variable */
int nlen; /* length of this vector */
void *newval; /* 0 or address of new value */
size_t newlen; /* size of new value */
};
-.fi
+.EE
.in
.PP
This call does a search in a tree structure, possibly resembling
Remove it from your programs now; use the
.I /proc/sys
interface instead.
-
+.PP
This system call is available only if the kernel was configured with the
.B CONFIG_SYSCTL_SYSCALL
option.
It is not yet possible to change operating system by writing to
.IR /proc/sys/kernel/ostype .
.SH EXAMPLE
-.nf
+.EX
#define _GNU_SOURCE
#include <unistd.h>
#include <sys/syscall.h>
perror("_sysctl");
exit(EXIT_FAILURE);
}
- printf("This machine is running %*s\\n", osnamelth, osname);
+ printf("This machine is running %*s\en", osnamelth, osname);
exit(EXIT_SUCCESS);
}
-.fi
+.EE
.SH SEE ALSO
.BR proc (5)