CLEAR_USER(9) Memory Management in Linux CLEAR_USER(9)NAME
clear_user - Zero a block of memory in user space.
SYNOPSIS
unsigned long clear_user(void __user * to, unsigned long n);
ARGUMENTS
to
Destination address, in user space.
n
Number of bytes to zero.
DESCRIPTION
Zero a block of memory in user space.
Returns number of bytes that could not be cleared. On success, this will be zero.
COPYRIGHT Kernel Hackers Manual 3.10 June 2014 CLEAR_USER(9)
Check Out this Related Man Page
SYSINFO(2) Linux Programmer's Manual SYSINFO(2)NAME
sysinfo - returns information on overall system statistics
SYNOPSIS
#include <sys/sysinfo.h>
int sysinfo(struct sysinfo *info);
DESCRIPTION
Until Linux 2.3.16, sysinfo() used to return information in the following structure:
struct sysinfo {
long uptime; /* Seconds since boot */
unsigned long loads[3]; /* 1, 5, and 15 minute load averages */
unsigned long totalram; /* Total usable main memory size */
unsigned long freeram; /* Available memory size */
unsigned long sharedram; /* Amount of shared memory */
unsigned long bufferram; /* Memory used by buffers */
unsigned long totalswap; /* Total swap space size */
unsigned long freeswap; /* swap space still available */
unsigned short procs; /* Number of current processes */
char _f[22]; /* Pads structure to 64 bytes */
};
and the sizes were given in bytes.
Since Linux 2.3.23 (i386), 2.3.48 (all architectures) the structure is:
struct sysinfo {
long uptime; /* Seconds since boot */
unsigned long loads[3]; /* 1, 5, and 15 minute load averages */
unsigned long totalram; /* Total usable main memory size */
unsigned long freeram; /* Available memory size */
unsigned long sharedram; /* Amount of shared memory */
unsigned long bufferram; /* Memory used by buffers */
unsigned long totalswap; /* Total swap space size */
unsigned long freeswap; /* swap space still available */
unsigned short procs; /* Number of current processes */
unsigned long totalhigh; /* Total high memory size */
unsigned long freehigh; /* Available high memory size */
unsigned int mem_unit; /* Memory unit size in bytes */
char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding to 64 bytes */
};
and the sizes are given as multiples of mem_unit bytes.
sysinfo() provides a simple way of getting overall system statistics. This is more portable than reading /dev/kmem.
RETURN VALUE
On success, zero is returned. On error, -1 is returned, and errno is set appropriately.
ERRORS
EFAULT pointer to struct sysinfo is invalid
CONFORMING TO
This function is Linux-specific, and should not be used in programs intended to be portable.
The Linux kernel has a sysinfo() system call since 0.98.pl6. Linux libc contains a sysinfo() routine since 5.3.5, and glibc has one since
1.90.
SEE ALSO proc(5)COLOPHON
This page is part of release 3.44 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
Linux 2012-05-05 SYSINFO(2)
Hello list,
Have a problem that's highlighting gaps in my knowledge; can you assist?
We have a script that's tacked onto our trading application which allows branch managers etc. to kill off the sessions of other users at their branch. A menu option in the application spawns a shell running... (8 Replies)
I'm writing a script to get a datestamped file from a ftp server. It seems that the "get" command does not respect variables. Anyone knows how to fix the problem?
I'm trying to get a file named "rcsnotesYYYYMMDD"
Here's my script
today=`date +%Y%m%d`
tput clear
user <login> <password>... (1 Reply)
im suppose to write a script that examine how many users are logged in the student server. if there are less than 10 logged in a message suppose to display that says "there are less than 10 users currently signed on" and if there are more than 10 logged in a message suppose to display that says... (1 Reply)
Hi, I just wondering I done program which will list .jpg extension file but if there is not .jpg file in current directory display error how to do it ; here is my code
#!/bin/sh
echo "Enter a program function :" # declear User input
read func1 func2
## user must input list follow by... (1 Reply)
I am curious to know what kind of cron-jobs experienced admins have running on their servers.
I personally have :
1) something to backup very regularly my important directories
2) something that build (at night) my software under development
3) something that build (at night) my Docbook own and... (2 Replies)
Hello All,
I am very sure this a dumb question to many, but from my view its worth asking.
When I do a vi on a file, on the right bottom side I am seeing something like below:
27,16-24 7%
which tells me that I am on line 27 (which is the first number before the comma, i would like... (11 Replies)