PARAM(3) BSD Library Functions Manual PARAM(3)NAME
param -- common parameters
SYNOPSIS
#include <sys/param.h>
size
MAX(size a, size b);
size
MIN(size a, size b);
DESCRIPTION
The <sys/param.h> header includes some common definitions and macros specific to NetBSD. The header is perhaps best characterized as a ker-
nel equivalent of <sys/types.h>. The following list summarizes the provided definitions and macros.
o First and foremost, the header defines the version of NetBSD. This is defined as
#define __NetBSD_Version__ 599004800 /* 5.99.48 */
The general format is ``MMmmrrpp00'', where 'MM' and 'mm' denote the major and minor version, respectively, 'rr' is provided for
compatibility, and 'pp' defines the patch level.
o Common utility macros such as MAX() and MIN() as well as more specific macros such as STACK(9), ctod(9), mstohz(9), roundup(9), and
setbit(9).
o Numerous miscellaneous definitions such as limits, constants for the kernel memoryallocators(9), scale factors used by the sched-
uler, kthread(9) priorities, and many others.
o Definitions provided for historical and compatibility reasons. Examples range from definitions such as ``#define BSD'' to old pri-
ority levels used in the kernel.
SEE ALSO bitops(3), cdefs(3), types(3), unistd(3)HISTORY
A <param.h> header appeared already in the Version 4 AT&T UNIX.
BSD April 10, 2011 BSD
Check Out this Related Man Page
ROUNDUP(9) BSD Kernel Developer's Manual ROUNDUP(9)NAME
roundup -- macros for counting and rounding
SYNOPSIS
#include <sys/param.h>
size
howmany(x, size);
size
roundup(x, size);
size
rounddown(x, size);
size
roundup2(x, size);
int
powerof2(x);
DESCRIPTION
The roundup() and rounddown() macros return an integer from rounding x up and down, respectively, to the next size. The howmany() macro in
turn reveals how many times size fits into x, rounding the residual up.
The roundup2() macro also rounds up, but with the assumption that size is a power of two. If x is indeed a power of two, powerof2() return
1.
RETURN VALUES
The return value is an integer from the respective operation. If x is 0, all macros except powerof2() return 0. The behavior is undefined
if size is 0.
EXAMPLES
The following example rounds the variable rx to a 32-bit boundary:
uint16_t rx;
...
rx = roundup2(rx, sizeof(uint32_t));
SEE ALSO ilog2(3), param(3), imax(9)CAVEATS
All described macros make no assumptions about the type of the parameters. These are implicitly assumed to be unsigned integers.
BSD June 1, 2011 BSD
Which shows the current kernel settings accurately? kmtune or sysdef. I ask because although some params show the same setting with both, some do not.
Example
>kmtune | grep nfile
nfile 75008 - (15*NPROC+2048)
>sysdef | grep nfile
nfile 75018 ... (6 Replies)
Hi,
I have two text files.The first and the 2nd file have data in the same format
For e.g. The first file has
BOOKS COUNT: 40
BOOKS AUTHOR1 SUM:1018 MAX:47 MIN:1 AVG:25.45
BOOKS AUTHOR3 SUM:181 MAX:48 MIN:3 AVG:18.1
Note:Read it as Table columnname sum(column) max(column) min(column)... (1 Reply)
Hi friends,
I hope everyone is doing fine. I have this confusion, hope you can help me out with it. The header files contain only function prototypes. Where are the function definitions located. For example, if I would like to see how printf works, where can I see its definition, stdio.h only... (2 Replies)
A structure is there with ,
#define MAX 2000
struct my_struct{
char a;
char b;
char c;
}
I need to extract 4 file's content. So, a function has some task to open the file and extract the content's in it and store each file's data into each character array in the structure.
The... (1 Reply)
I need to use awk for this task !
input (fields are separated by ";"):
1%2%3%4%;AA
5%6%7%8%9;AA
1%2%3%4%5%6;BB
7%8%9%10%11%12;BBIn the 1st field there are patterns composed of numbers separated by "%".
The 2nd field define groups (here two different groups called "AA" and "BB").
Records... (8 Replies)