CTOD(9) BSD Kernel Developer's Manual CTOD(9)NAME
ctod -- macros related to bytes, pages, and disk blocks
SYNOPSIS
#include <sys/param.h>
size
ctod(size x);
size
dtoc(size x);
size
ctob(size x);
size
btoc(size x);
size
dbtob(size x);
size
btodb(size x);
DESCRIPTION
The ctod family of macros can be used to convert between bytes, pages (``clicks''), and disk blocks.
The following table lists the possible conversions:
Macro From To
ctod() pages disk blocks
dtoc() disk blocks pages
ctob() pages bytes
btoc() bytes pages
dbtob() disk blocks bytes
btodb() bytes disk blocks
These are typical macros that may appear with different names in other operating systems. Examples include btop() and btopr() in Solaris.
SEE ALSO param(3)HISTORY
Some of these macros appeared in Version 7 AT&T UNIX.
CAVEATS
The described macros make no assumptions about the type of the input parameter. A caller should ensure that neither integer overflow nor
integer underflow are possible.
BSD April 8, 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
Hello all,
I was wondering if anyone had made a bootable Linux CD with additional directory inside it. I'm trying to make a bootable CD with additional rpm to install the correct video card in a seaperate directory. I'm able to make a kickstart bootable CD but am unable to read into the new... (2 Replies)
hello,
I have a firts makefile who call others makefile. for this i use:
$ make -f linux.mak
and output his:
$ make -f linux.mak all
make -C DerelictAL all PLATFORM=linux
make: Entering directory `/home/builder/rpmbuild/SOURCES/derelict2-20100407/DerelictAL'
make: Nothing to be done for... (2 Replies)
Hello,
Although I have found similar questions, I could not find advice that
could help with our problem.
The issue:
We have several hundreds text files containing repeated blocks of text
(I guess back at the time they were prepared like that to optmize
printing).
The block of texts... (13 Replies)
Hi
I need to create a directory when its non-existent
Having an issue with the code here because it doesn't work
can someone point what and how to change, please.
---------- Post updated at 11:08 AM ---------- Previous update was at 11:07 AM ----------
filelist=project_name/files/... (7 Replies)
Hi,
I unable to find the direct command get the total count for the below files with today date.
ls -lrt c90.txt n5.txt t1.txt k3.txt h9.txt s1.txt n2.txt a123.txt
-rw-rw-r-- kkk klkl 980 Apr 26 19:00 c90.txt
-rw-rw-r-- kkk klkl 80 Apr 26 19:00 n5.txt
-rw-rw-r-- kkk klkl 12890 Apr 26... (3 Replies)
Hello,
Although I have found similar questions, I could not find advice that could help with our problem.
The issue:
We have a few thousands text files (books).
Each book has many chapters. Each chapter is identified by a cite-key. We need
to split each of those book files by... (4 Replies)
awk -F "" ' $2 ~ /<Clinical features:>|<Clinical features:>|<Inheritance pattern:>|<Inheritance pattern:>/{print $2, $3}' OFS='\t' genedx156.txt > output.txt
The above command seems to run but no results are in the output.
Basically, I am just searching for those key words and output the... (5 Replies)
Is it possible in awk to parse a webpage (EDAR Gene Sequencing - Genetic Testing Company | The DNA Diagnostic Experts | GeneDx), the source code is attached.
<title> EDAR Gene Sequencing
<dt>Test Code:</dt>
<dd>156 </dd>
<dt>Turnaround Time:</dt>
<dd>6-8 weeks </dd>
... (4 Replies)
Someone, please help on this issue:-
Note : for security reason i didn't mention hostnames and ips.
==============================================================================
# ntpstat
unsynchronised
polling server every 1024 s
Ntpstat showing unsynchronised.
... (29 Replies)