Utilities Reference
Utilities Reference
bz2cat 55
bzip2 56
c++filt 58
calib 59
cam-cdrom.so 61
cam-disk.so 62
cam-optical.so 64
cat 66
CC, cc 68
chat 69
chattr 75
chgrp 77
chkdosfs 79
chkfsys 82
chkqnx6fs 87
chmod 90
chown 94
cksum 96
clear 98
cmp 99
/etc/context.conf 101
coreinfo 103
cp 104
cpio 112
cron 115
crontab 117
ctags 121
cut 123
cvs 125
date 137
dcheck 142
dd 145
deflate 148
deva-ctrl-4dwave.so 150
deva-ctrl-audiopci.so 152
deva-ctrl-cs4281.so 154
deva-ctrl-ess1938.so 156
deva-ctrl-geode.so 158
deva-ctrl-i8x0.so 160
deva-ctrl-intel_hda.so 162
deva-ctrl-nmg6.so 164
deva-ctrl-sb.so 166
deva-ctrl-via686.so 168
deva-ctrl-vortex.so 170
deva-ctrl-ymfds1.so 172
deva-mixer-ac97.so 174
deva-mixer-ak4531.so 175
deva-mixer-hda.so 176
deva-util-restore.so 177
devb-adpu320 178
devb-aha8 182
devb-ahci 186
devb-btmm 190
devb-eide 194
devb-fdc 200
devb-loopback 203
devb-mvSata 208
devb-ram 212
devb-umass 215
devc-con, devc-con-hid 217
devc-par 237
devc-pty 239
devc-ser8250 240
devc-serpci 245
devc-serusb 247
devc-serzscc 250
devf-generic 254
devf-ram 261
devg-ati_rage128.so 267
devg-carmine.so 270
devg-chips.so 274
devg-coral.so 277
devg-extreme2.so 282
devg-flat.so 285
devg-geode.so 286
devg-gma9xx.so 289
devg-i810.so 292
devg-i830.so 295
devg-intelhd.so 298
devg-matroxg.so 301
devg-poulsbo.so 304
devg-radeon.so 307
devg-rage.so 310
devg-s3_savage.so 313
devg-sis630.so 316
devg-smi5xx.so 319
devg-smi7xx.so 322
devg-soft3d.so 325
devg-soft3d-fixed.so 326
devg-svga.so 327
devg-tnt.so 329
devg-tvia.so 332
devg-vesabios.so 335
devg-vmware.so 337
devh-egalax.so 339
devh-microtouch.so 341
devh-ps2ser.so 343
devh-touchintl.so 347
devh-usb.so 349
devi-dyna 351
devi-elo 353
devi-hid 356
devi-hirun 359
devi-microtouch 364
devi-semtech 367
devi-zytronic 369
devn-asix.so 372
devn-crys8900.so 375
devn-dm9102.so 378
devn-el509.so 380
devn-el900.so 382
devn-epic.so 385
devn-fd.so 388
devn-i82544.so 390
devn-micrel8841.so 393
devn-ne2000.so 395
devn-pcnet.so 398
devn-pegasus.so 402
devn-rtl.so 405
devn-rtl8150.so 408
devn-sis9.so 411
devn-smc9000.so 414
devn-speedo.so 417
devn-tigon3.so 420
devn-tulip.so 423
devn-via-rhine.so 426
devnp-ath.so 429
devnp-axe.so 431
devnp-bce.so 433
devnp-bcm1250.so 435
devnp-bcm43xx.so 438
devnp-bge.so 440
devnp-e1000.so 442
devnp-i80579.so 445
devnp-i82544.so 447
devnp-mpcsec.so 451
devnp-mpc85xx.so 453
devnp-msk.so 456
devnp-ral.so, devnp-ural.so 458
devnp-rtl8169.so 461
devnp-rum.so 464
devnp-shim.so 467
devnp-speedo.so 468
devp-pccard 471
devu-ehci.so 474
devu-kbd 476
devu-mouse 477
devu-ohci.so 478
devu-prn 480
devu-uhci.so 482
df 484
dhcp.client 486
dhcpd 492
/etc/dhcpd.conf 500
/var/state/dhcp/dhcpd.leases 521
dhcprelay 524
diff 528
diff3 533
dig 542
dinit 543
dirname 548
diskboot 550
dispconf 553
dloader 555
dnssec-dsfromkey 558
dnssec-keyfromlabel 559
dnssec-keygen 560
dnssec-signzone 561
ds 562
du 566
dumpefs 568
dumper 569
dumpifs 572
echo 575
ed 577
egrep 578
elvis 579
enum-devices 602
enum-usb 615
env 625
errno 627
esh 628
etfsctl 635
expand 640
/etc/exports 642
expr 644
false 647
fcat 648
fdformat 649
fdisk 652
fesh 659
fgrep 662
file 663
find 667
finstall 683
flashctl 684
flex 689
fmt 691
fold 692
fontinfo 694
fpemu.so 697
freeze 698
fs-cd.so 701
fs-cifs 703
fs-dos.so 707
fs-etfs-ram 712
fs-ext2.so 716
fs-mac.so 718
fs-nfs2 720
fs-nfs3 722
fs-nt.so 725
fs-qnx4.so 727
fs-qnx6.so 730
fs-udf.so 733
fsysinfo 738
/etc/fstab 742
ftp 744
/etc/ftpchroot 745
ftpd 746
/etc/ftpd.conf 749
/etc/ftpusers 754
fullpath 756
g++ 757
/etc/gateways 759
gawk 764
gcc 782
gcov 788
gdb 790
getconf 794
getty 799
gf-calib 800
gns 802
gprof 809
grep 810
gunzip 815
gzip 816
ham 820
hamctrl 821
hd 822
head 826
helpviewer 828
hidview 837
hogs 839
host 841
hostapd 842
hostname 844
/etc/hosts 845
/etc/hosts.equiv 846
id 849
if_up 851
ifconfig 853
ifwatchd 864
indent 866
inetd 868
/etc/inetd.conf 870
inflator 875
infocmp 878
input-cfg 880
inputtrap 882
io-audio 885
io-blk.so 888
io-display 899
io-graphics 903
io-hid 906
io-pkt-v4, io-pkt-v4-hc, io-pkt-v6-hc 908
io-usb 914
join 916
kill 918
ksh 920
ld 971
ldd 972
ldrel 974
less 976
link 986
ln 987
ln-w 990
logger 991
login 993
logout 997
lpd 998
lpr 1000
lprc 1003
lprq 1006
lprrm 1008
ls 1010
lsm-autoip.so 1015
lsm-pf-v4.so, lsm-pf-v6.so 1018
lsm-qnet.so 1019
lwresd 1026
m4 1027
/usr/share/misc/magic 1028
make 1031
mcd 1036
mcs 1060
melt 1061
mesg 1062
/etc/mib.txt 1063
mixer 1064
mkasmoff 1067
mkcldr 1068
mkbuild 1070
mkdir 1072
mkdosfs 1074
mkefs 1077
mketfs 1085
mkfifo 1093
mkfontdir 1095
mkifs 1097
mkimage 1126
mkkbd 1127
mkqnx6fs 1129
mkrec 1132
mksbp 1134
/etc/moduli 1135
more 1136
mount 1139
mq 1143
mqueue 1145
mrouted 1146
mstrip 1154
mv 1155
named 1159
named-checkconf 1160
named-checkzone, named-compilezone 1161
/etc/named.conf 1162
ndp 1163
netmanager 1165
netstat 1167
/etc/networks 1172
newgrp 1173
nfsd 1175
/etc/nfsstart 1178
nice 1179
nicinfo 1182
nm 1185
nohup 1186
nslookup 1188
/etc/nsswitch.conf 1194
nsupdate 1196
ntpd 1197
ntpdate 1202
ntpdc 1205
ntpq 1212
ntptrace 1222
objcopy 1224
objdump 1225
od 1226
omshell 1229
on 1234
op 1238
openssl 1239
/etc/party.conf 1244
passwd 1246
paste 1250
patch 1252
pax 1256
pccard-launch 1262
pci 1264
pci-bios, pci-bios-v2 1265
pcnfsd 1267
/etc/pcnfsd.conf 1268
pdebug 1269
ped 1271
pf 1280
/etc/pf.conf 1296
pfctl 1333
pfm 1340
ph 1344
phablang 1347
phabmsg 1349
phcalc 1352
phdialer 1353
phditto 1356
phfind 1360
phfont 1363
phgrafx 1371
phin 1374
phlip 1379
phlocale 1391
phlogin, phlogin2 1394
phmenu 1398
Photon 1401
phrelay 1403
phrelaycfg 1411
phs-to-bjc 1413
phs-to-bmp 1416
phs-to-escp2 1419
phs-to-ijs 1423
phs-to-pcl 1426
phs-to-ps 1432
phshutdown 1434
phuser 1437
phview 1440
pidin 1442
pin 1454
ping 1455
ping6 1460
pipe 1465
pppd 1467
pppoectl 1470
pppoed 1475
pps 1476
pr 1477
preview 1480
/etc/printcap 1482
printf 1486
prjobs 1491
procnto* 1493
/etc/protocols 1500
ps 1501
pterm 1505
ptermcs 1516
pv 1518
pwd 1520
pwm 1521
pwmopts 1526
python 1530
qbinaudit 1533
QCC, qcc 1535
qconfig 1543
qconn 1546
qcp 1548
qde 1551
qed 1553
qtalk 1555
QWinCfg 1564
racoon 1566
/etc/racoon.conf 1568
random 1578
ranlib 1580
rcp 1581
readelf 1583
renice 1584
/etc/resolv.conf 1586
˜/.rhosts 1589
rlogin 1592
rlogind 1594
rm 1596
rmdir 1598
rndc 1600
rndc-confgen 1601
rndc.conf 1602
route 1603
route6d 1607
routed 1610
/etc/rpc 1615
rpcbind 1616
rpcgen 1618
rpcinfo 1621
rsh 1623
rshd 1625
rtadvd 1628
/etc/rtadvd.conf 1631
rtc 1634
rtquery 1637
rtsold 1639
ruptime 1641
rwho 1642
rwhod 1643
savercfg 1645
scp 1648
script 1649
sed 1650
seedres 1657
sendnto 1658
/etc/services 1660
setconf 1661
setkey 1663
setupbsp 1669
sftp 1671
sftp-server 1672
sh 1673
shelf 1674
showlicense 1676
showmem 1677
showmount 1678
show_vesa 1679
shutdown 1681
size 1683
slay 1684
sleep 1689
slinger 1690
slogger 1706
sloginfo 1710
smic 1712
snapshot 1717
snmpbulkwalk 1720
snmpd 1723
/etc/snmpd.conf 1725
snmpget 1726
snmpgetnext 1729
snmpnetstat 1731
snmpset 1734
snmpstatus 1737
snmptest 1739
snmptranslate 1745
snmptrap 1747
snmptrapd 1750
snmpwalk 1752
/etc/socks.conf 1755
sockstat 1758
sort 1760
spatch 1763
split 1766
spooler 1768
ssh 1770
ssh-add 1771
ssh-agent 1772
˜/.ssh/ssh_config, /etc/ssh/ssh_config 1773
ssh-keygen 1774
ssh-keyscan 1776
ssh-keysign 1777
sshd 1778
/etc/ssh/sshd_config 1779
startup-* options 1780
startup-apic 1785
startup-bios, startup-bios-32 1788
strings 1791
strip 1792
stty 1793
su 1801
sync 1803
sysctl 1804
sysinfo 1810
/etc/syslog.conf 1812
syslogd 1815
tail 1817
tar 1819
tcpdump 1823
tee 1854
telnet 1856
telnetd 1866
textto 1870
tftp 1871
tftpd 1874
tic 1876
time 1878
tinit 1880
top 1882
touch 1883
tr 1886
tracelogger 1889
traceprinter 1893
traceroute 1898
traceroute6 1903
true 1905
tsort 1906
tty 1907
uesh 1908
umask 1913
umount 1916
uname 1917
unexpand 1919
unifdef 1921
uniq 1922
unlink 1924
unzip 1925
uptime 1929
usb 1930
use 1932
usemsg 1935
uud 1939
uudecode 1940
uue 1941
uuencode 1942
vi 1943
view 1944
/etc/view.conf 1945
waitfor 1946
wc 1947
which 1948
who 1950
wpa_cli 1951
wpa_passphrase 1955
wpa_supplicant 1956
xargs 1961
zap 1964
zcat 1966
zip 1967
Glossary 2047
Index 2067
The Utilities Reference describes the utilities, manager processes, and configuration
files included with the QNX Neutrino operating system. This reference is intended for
everyone from end-users to system administrators.
Your system might not include all of the things that this reference describes,
depending on what software you’ve installed. For example, some utilities are included
in the QNX Momentics Tool Suite, and others are included in a specific Board Support
Package (BSP).
Typographical conventions
Throughout this manual, we use certain typographical conventions to distinguish
technical terms. In general, the conventions we use conform to those found in IEEE
POSIX publications. The following table summarizes our conventions:
Reference Example
Code examples if( stream == NULL )
Command options -lR
Commands make
Environment variables PATH
continued. . .
Reference Example
File and pathnames /dev/null
Function names exit()
Keyboard chords Ctrl-Alt-Delete
Keyboard input something you type
Keyboard keys Enter
Program output login:
Programming constants NULL
Programming data types unsigned short
Programming literals 0xFF, "message string"
Variable names stdin
User-interface components Cancel
We use an arrow (→) in directions for accessing menu items, like this:
CAUTION: Cautions tell you about commands or procedures that may have
! unwanted or undesirable side effects.
Technical support
To obtain technical support for any QNX product, visit the Support area on our
website (www.qnx.com). You’ll find a wide range of support options, including
community forums.
Syntax conventions
Most QNX utilities follow standard conventions for argument syntax and behavior.
These conventions are based on the utility conventions outlined in POSIX
1003.2-1992.
The syntax synopsis for each utility appears at the top of the page of its manual entry.
The utility name appears first, followed by other allowed command-line arguments,
which include options, option arguments (e.g. “number” in -n number), and operands
(e.g. the names of files to act on).
The syntax synopsis is the only reliable source for information about mutual
exclusivity of options and about whether a command-line element is optional or
required. This information isn’t usually contained in the detailed option listings that
appear after the syntax section.
A typical utility syntax line looks like this:
utilityname [-abcd] [-o arg | -p arg] infile... outfile
The example above shows a utility called utilityname that accepts the options -a,
-b, -c, and -d — these options may be used alone or in any combination.
The utility also accepts the options -o and -p, both of which require an option
argument, and which may not be used together (but may be used with the other options
-abcd). The utility requires two or more operands: one or more infile and exactly one
outfile.
• When utilities have many options, the options may appear grouped together in the
syntax like this:
utilname [-abcd]
which means that the options -a, -b, -c, and -d are supported.
• Options, option arguments, and operands enclosed in brackets ([ and ]) are
optional and can be omitted. Note that the [ and ] symbols should never be
included in the actual command.
• Arguments separated by | are mutually exclusive. Sometimes mutually exclusive
arguments that relate to modes of operation are indicated with multiple syntax lines
representing the different forms of the command.
• A trailing ellipsis mark (...) after options or operands indicates that the preceding
item may be repeated. If the preceding item is optional, the ellipsis indicates that
the item may occur zero or more times, e.g.:
utility [filename...]
If the item is mandatory, the ellipsis indicates it may occur one or more times, e.g.:
utility filename...
Invoking utilities
There are a number of general guidelines to follow when running utilities:
• An option may be followed by another option after a single dash (-) on the
command line as long as each preceding option doesn’t have an option argument.
For example, the option string -abc is equivalent to -a -b -c. However, if -a
accepts an option argument, then -abc would be equivalent to -a bc instead.
• Options and their option arguments should be specified with spacing as shown in
their documentation. If the documentation says:
-n number
the number should be a separate command-line argument from the -n. But if the
documentation refers to:
-nnumber
then number should appear in the same argument as -n without any intervening
blanks. Utilities in QNX and in POSIX-conforming systems permit both forms in
all utilities unless otherwise stated, but you’ll achieve the greatest portability by
using the preferred form. This is particularly important when developing scripts
that may be used on multiple (QNX and non-QNX) platforms.
• Options are usually listed in alphabetical order, but there’s no restriction on the
order that they may appear in the command line when used, unless otherwise
indicated in the documentation for the utility. Note that in some utilities, mutually
exclusive options override each other in a “last one wins” manner.
• All options and associated option arguments must precede any operands on the
command line. For example, if you want to run the cp utility with the -R option,
you may enter:
cp -R dir1 dir2
but not:
cp dir1 dir2 -R
• Decimal integers are accepted when numeric values are required in operands and
option arguments, unless otherwise specified. Some utilities may support 0octal
and 0xhex numbers as well without being documented as doing so. For this reason,
don’t precede decimal numbers with leading zeros.
• The argument -- (“dash dash”) may be placed on the command line as a delimiter
indicating the end of options and the start of operands. This is particularly useful
when the operands themselves might start with a dash. For example, to remove a
file named “-t”, you would use:
rm -- -t
Utilities that don’t accept any options also accept and discard a -- before their
operands, unless otherwise indicated.
File conventions
File pathnames specified on the command line are restricted to 255 characters. Some
input files are specifically identified as “text files.” Text files are expected to contain
ASCII text in newline-terminated lines that don’t exceed 2048 characters, unless
otherwise indicated.
Signal conventions
Signal actions are inherited from the process that invokes the utility. Most utilities
don’t do any special processing upon receipt of a signal, but behave instead according
to the system defaults. When a utility performs some action on receipt of a signal
other than the default, it’s documented as doing so.
Note that temporary files aren’t left in place after a utility is terminated due to a signal,
unless otherwise specified.
Servers and resident processes typically run only as root and ignore most signals
(such as SIGPWR).
Error conventions
Utilities may fail for many reasons ranging from incorrect usage to underlying system
failure. The documentation for the utilities doesn’t attempt to outline the exact
behavior for all possible modes of failure.
In all cases, unless otherwise specified, every error results in a diagnostic message
printed to standard error.
When an error occurs, the utility stops the processing of the current operand and
proceeds to process the next operand in the sequence. If a utility fails to process one
operand but succeeds on others, the exit status still reflects failure. For utilities that
recurse through a filesystem (e.g. find), if an action cannot be performed on one file
within a hierarchy, the utility stops processing that file and goes on to the subsequent
files in the hierarchy.
When an unrecoverable error occurs (e.g. insufficient memory), the utility prints a
diagnostic message to standard error and exits immediately.
The utilities and configuration files are described here in alphabetical order.
Name:
/etc/acl.conf
Description:
The acl.conf file is used to specify what context is available to an agent and
manager. This definition includes what operations are permitted on this collection of
data objects.
Here’s the search order that’s used to find this file:
2 /etc/acl.conf
B GetBulk
G Get
I Inform
N GetNext
R Response
S Set
U SNMPv2-Trap
For example:
agent_party manager_party agent_context G
The agent acting as agent_party allows the manager acting as manager_party to do
GET operations on the collection of data objects included in the agent_context.
See also:
snmpget, snmptest, snmptrapd, snmpwalk
Based on ISO IS 8824 (ASN.1), RFC 1065, RFC 1066, RFC 1067, RFC 1446
Syntax:
addr2line_variant [options] [addr ...]
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
The addr2line_variant depends on the target platform, as follows:
Description:
The addr2line utility translates program addresses into file names and line numbers.
Given an address and an executable, it uses the debugging information in the
executable to figure out which file name and line number are associated with a given
address.
For detailed documentation, see the GNU website at http://www.gnu.org/.
Contributing author:
GNU
Syntax:
addvariant [-c] [-i init_lvls] [-P] [[os_name]
cpu_name] variant_name
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
-c Add the created directory structure to the CVS repository on the
next cvs commit.
-i init_lvls Create the initial common.mk and Makefile files in the current
working directory. The Makefile contains a line defining the
level(s) contained in the directory structure. Specify init_lvls as OS,
OS/CPU, or OS/CPU/VARIANT (use a slash (/) or a dash (-) to
separate multiple levels).
os_name The name of the operating system to add (e.g. qnx4, nto, linux).
cpu_name The name of the CPU to add (e.g. mips, ppc, x86).
Description:
The addvariant utility is a shell script that creates a directory structure for your
source tree. It also ensures that each level of this structure contains necessary files
used by the make utility.
Using addvariant to create your variant directory structure enables you to take
advantage of the makefile rules of the QNX build environment. For more information
on these rules, see the Conventions for Recursive Makefiles and Directories appendix
of the Neutrino Programmer’s Guide.
The project level includes a file called common.mk. This file contains any “special”
flags and settings needed for compilation and linking.
Each level in the directory structure needs a properly constructed Makefile with
appropriate macros and include files. At most levels, Makefile includes
recurse.mk, the file used by higher-level makefiles to recurse into lower-levels. The
Makefile at the lowest level of the directory tree (the variant level) includes the
common.mk file from the project level instead of recurse.mk.
If requested, addvariant also adds the directories and files it has created to CVS,
ready for your next cvs commit.
• LIST macro
• *_name options
• current subdirectories
Squashing levels
The addvariant utility has the ability to “squash” directory levels together. If you
enter the command:
addvariant creates a recursing Makefile in the CWD structure that has a line like
this:
Examples:
Create a two-level directory called nto-x86/o:
For detailed examples, see “Examples of creating Makefiles” in the Conventions for
Recursive Makefiles and Directories appendix of the Neutrino Programmer’s Guide.
See also:
make
Conventions for Recursive Makefiles and Directories appendix of the QNX Neutrino
Programmer’s Guide
Andrew Oram and Steve Talbott, Managing Projects with make, O’Reilly and
Associates, 1991
Syntax:
appbuilder [options]
Runs on:
QNX Neutrino, Microsoft Windows
Options:
-h height[%] The height of the window, in pixels, or as a percentage of the
screen height if % is specified.
-l filepath (“el”) Look in filepath for the library callbacks file. Make the
callbacks found in this file available to all applications loaded
later.
The format for the library callbacks file is as follows:
l=library_name
L=path
f=function1
f=function2
l=another_library_name
f=function3
f=function4
f=function5
Lines beginning with l= specify the library in which to find the
following functions; if no library specification is given, the
function specifications are ignored. The L=path specification
line is optional, it tells the linker where to look for the library
callbacks; if you don’t specify this path, the linker will use its
default path.
In addition to functions in the library callbacks file, the linker
looks in the application directory (the directory containing
abapp.dfn) for libcalls.def. Callbacks found in
libcalls.def will be available only while the application is
loaded.
-n Don’t lock the application’s files. If someone already has an
application open, PhAB won’t open it unless you started PhAB
with the -n option.
If you’re using NFS or SMB, you should start PhAB with the -n
option because you can’t lock files with either.
-Si|m|n The initial state of the main window (iconified, maximized, or
normal).
-s server_name The name of the Photon server:
Description:
The appbuilder utility starts the Photon Application Builder (PhAB). For
information about using PhAB to develop Photon applications, see the Photon
Programmer’s Guide.
Since this utility modifies the installation tree, you must run it as a privileged user. It
also requires the environment be properly set. On Linux, if you use sudo (as would be
the case on Ubuntu), you must also specify the -E option to preserve the environment.
In this case, however, the PATH environment variable is set to a safe one for security
reasons, so you need to specify the full path to the utility:
Syntax:
Install a patch:
applypatch [-b] [-c] [-d path] [-F] [-H] [-v] patch_file
Uninstall a patch:
applypatch -U num
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
-b Don’t make a backup.
CAUTION: If you specify the -b option, you won’t be able to uninstall this patch or
! any patches applied after it. We don’t recommend this option for general use.
-c Extract the patch contents only. No metadata will be recorded, nor will
any backup file be generated. This is useful when pulling out individual
files for testing, but we don’t recommend this option for general use.
-d path Specify the destination path. This path will be the root directory used for
extracting the patch contents as well as for storing the patch metadata.
The default is the currently active QNX SDP installation.
-F Turn off prompting by forcing a “yes” answer to all queries. Normally
newer files aren’t overwritten by older files from the patch. This option
disables that check. This means locally updated files may be silently
replaced by an older version from the patch.
-H (QNX Neutrino 6.5.0 and later) Install all host-side files in the patch. By
default, applypatch installs only those for the current host OS.
The version of applypatch in 6.4.1 installs host-side files for all host OSs.
CAUTION: Due to the nature of the patching process, any patch that was installed
! after patch ID num will be uninstalled as well. In effect, you’ll roll back to the state the
system was in just before patch ID num and all subsequent patches were applied.
Description:
The applypatch utility installs and uninstalls QNX patches, and also lists the
installed patches. It’s installed in $QNX_HOST/usr/bin and supports our current
patch tar files.
This utility first backs up any files which will be overwritten and then extracts the
patch files.
If you’ve applied a sequence of patches, you can uninstall them only in reverse order.
If you select a patch (Patch ID X) for uninstallation, then any patches installed since
Patch ID X are also marked for uninstallation. A warning and list of affected patches is
printed and confirmation requested for this situation.
See also:
tar
Syntax:
aps show [-d delay] [-f shorthand] [-l] [-v...]
[partition_name ...]
Runs on:
Neutrino
Options:
-B milliseconds Specify the critical CPU budget, in milliseconds. The default is 0.
-d delay The delay period, in tenths of a second, when using the -l option.
The default is 50.
• bmp_safety
The default is normal. For more information about the policies,
see “Scheduling policies” in the entry for SchedCtl() in the
Neutrino Library Reference.
-s security_policy . . .
Specify the security policies to add to the system. Each
security_policy must be one of:
• root0_overall
• root_makes_partitions
• sys_makes_partitions
• parent_modifies
• nonzero_budgets
• root_makes_critical
• sys_makes_critical
• root_joins
• sys_joins
• parent_joins
• join_self_only
• partitions_locked
• recommended
• flexible
• basic
• none
The default is none. For more information about the policies, see
the description of SCHED_APS_ADD_SECURITY in the entry for
SchedCtl() in the Neutrino Library Reference.
Once you’ve added a security policy, you can’t remove it, except by rebooting the
system.
-w windowsize_ms
Set the size of the averaging window, in milliseconds, for the
system. You can set the window size to any value from 8 ms to
400 ms.
If you change the tick size of the system at runtime, do so before defining the adaptive
partitioning scheduler’s window size. That’s because Neutrino converts the window
size from milliseconds to clock ticks for internal use.
For more information, see “Choosing the window size” in the
System Considerations chapter of the Adaptive Partitioning
User’s Guide.
-y bankruptcy_policy . . .
Set the bankruptcy policy for the system to the specified items.
Each bankruptcy_policy must be one of:
• cancel_budget — set the offending partition’s critical
budget to zero, which forces the partition to be scheduled by
its percentage CPU budget only. This also means that a second
bankruptcy can’t occur.
• log — not currently implemented.
• reboot — cause the system to crash with a brief message
identifying the offending partition. This is the most severe
response, suggested for use while testing a product, to make
sure bankruptcies are never ignored. You probably shouldn’t
use this option in your finished product.
• basic — deliver bankruptcy-notification events and make the
partition out-of-budget for the rest of the scheduling window
(nominally 100 ms).
• recommended — the combination of cancel_budget and
log.
• none — do nothing.
The default is basic. For more information about the policies,
see “Handling bankruptcy” in the entry for SchedCtl() in the
Neutrino Library Reference.
Description:
Use the aps command to create, modify, and query adaptive partitions from the
command line, as well as to set the averaging window, and the security and bankruptcy
policies for the entire system.
To launch an application into a partition, use the -Xaps option to the on command.
Examples:
Create a partition called Drivers with a budget of 20% and a critical budget of 5
milliseconds:
Change the Drivers partition’s budget to 25% and its critical budget to 7
milliseconds:
Display the amount of the budget and critical budget that the partitions are using,
every 2 seconds:
Since usage is the default shorthand for the -f option, the above command is the
same as:
aps show -l -d 20
See also:
on, pidin
SchedCtl() in the Neutrino Library Reference
Adaptive Partitioning User’s Guide
Syntax:
ar_variant -key_letter[mod [relpos]] archive [member...]
ar_variant -M [ <mri-script ]
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
The ar_variant depends on the target platform, as follows:
Description:
The ar program creates and modifies archives, and extracts members from them. An
archive is a single file holding a collection of other files in a structure that makes it
possible to retrieve the original individual files (called members of the archive).
The original files’ contents, mode (permissions), timestamp, owner, and group are
preserved in the archive; you can restore them on extraction. The ar utility can
maintain archives whose members have names of any length.
For detailed documentation, see the GNU website at http://www.gnu.org/.
Contributing author:
GNU
See also:
nm
Syntax:
arp [-n] hostname
arp [-nv] -a
arp [-v] -d -a
arp [-v] -d hostname [pro [iface_name]]
arp -s hostname ether_addr [temp] [pub [pro [iface_name]]]
arp -f filename
Runs on:
Neutrino
Options:
-a Display all of the current ARP entries.
-d hostname Delete an entry for the specified host. Only the superuser can use
this option.
-f filename Load the ARP cache with entries found in the specified file. Entries
in the file should be of the form:
-v Be verbose.
Description:
The arp utility displays and modifies the Internet-to-Ethernet address translation
tables used by the Address Resolution Protocol (ARP).
With no options, the utility displays the current ARP entry for hostname. The host
may be specified by name or by number, using Internet dot notation.
License:
This utility is based on copyright software of The Regents of the University of
California; for licensing information, see the Third Party License Terms List at
http://licensing.qnx.com/third-party-terms/.
See also:
ifconfig, io-pkt*
Name:
/etc/autoconnect
Description:
The /etc/autoconnect script is run when an application needs to establish a
TCP/IP connection to a remote host. This file can be in any form (e.g. a shell script or
an executable), and contains all of the necessary commands required to create the
connection.
To activate the script, define the environment variable AUTOCONNECT and set its
value to 1.
If there’s no route to a remote host (see route, ifconfig, netmanager, phlip or
the options to io-pkt*), or there are no nameservers defined (see
/etc/nsswitch.conf) and a hostname can’t be resolved, the autoconnect script is
run. The exit status of the script determines whether or not a retry is attempted:
One time you might use this feature is when you have a dialup ISP account for internet
access. The ppp link is established only when an application needs to reach a host over
the link. When the link is terminated depends on inactivity timeouts specified by the
client or server, errors, or other events. The autoconnect script only launches
commands to establish a connection; it doesn’t terminate the connection.
Suppose that a host is configured with only the localhost interface, and no
nameservers. You need to create a script:
pppd connect "/bin/chat -v -f /etc/chat" defaultroute \
+resconf 115200 updetach /dev/ser2
exit
The chat utility is used to dial the service provider. The important option here is the
updetach option. This option daemonizes pppd after the PPP interface has been
configured. This way, the script doesn’t exit until the interface is configured. If an
application attempts to resolve a hostname, the application blocks while a connection
to an ISP is established, which provides a nameserver and a default route. When the
script exits with a status of zero, the socket library retries and the application
continues, assuming that the function succeeded. If an exit status of non-zero is
returned, the socket library returns the original error to the application.
If you’re using the Photon dialer to establish your connection, the script would look
like this:
phdialer -a
exit
The -a option causes phdialer to autoconnect and daemonize itself when the
interface is configured.
See also:
ifconfig, io-pkt*, netmanager, /etc/nsswitch.conf, phdialer, phlip,
pppd, route
Syntax:
basename string [suffix]
Runs on:
Neutrino
Options:
string A string of text.
Description:
The basename utility is useful primarily for extracting the filename portion of a
pathname, but since it performs only string operations, you can use it with any string.
The basename utility prints to standard output a substring of its string argument, plus
a newline character. The basename utility forms this substring by doing the
following, in order:
3 Deleting the string argument’s suffix, provided you’ve specified a suffix operand
that’s identical to the string operand’s suffix.
If suffix is equal to the remaining string, the suffix isn’t removed (e.g. if suffix is
prog.c and the remaining string is prog.c, the suffix .c isn’t removed).
The result is a null string only if string is a null string (""). In this case, basename
outputs a single newline character.
If string consists entirely of slash characters, basename prints a single slash, followed
by a newline character.
You’ll use the basename utility most often within shell scripts, where it’s normally
invoked inside back-ticks (‘...‘), or contained in $(...).
Examples:
Command: Output:
basename . .
basename /usr/src/prog.c prog.c
continued. . .
Command: Output:
basename /usr/src/prog.c .c prog
basename /usr/src/prog.c .a prog.c
basename /usr/src/ src
basename ...//[fred] [fred]
Exit status:
0 Successful completion.
See also:
dirname, fullpath
Syntax:
bc [-l] [file...]
Runs on:
Neutrino
Options:
-l (“el”) Include a library of defined math functions and set the scale to 20. (See
“Library functions,” below.)
file The pathname of a text file containing commands and function definitions to
be interpreted by bc. If any files are specified, bc processes those files, then
reads from the standard input.
Description:
The bc utility is an interactive, programmable calculator that supports a complete set
of control structures, including functions.
The bc utility supports 26 functions, 26 simple variables, and 26 array variables. Each
array may have up to 2048 elements. In addition, the utility performs arithmetic
operations using a radix 100 number system with user-definable precision. When you
specify the precision, the numbers are exact to that precision, unlike binary
floating-point representation where rounding errors may compromise accuracy. The
utility also operates in different bases, so you can easily convert numbers from one
base to another.
Many common programming language constructs are supported, including:
• local variables.
The bc utility provides no support for character or string manipulation. The syntax of
bc is derived from C, but doesn’t constitute a programming language.
Let’s look at a very simple bc program:
"hello, world\n"
When this program is run, the statement "hello, world" is echoed with a newline
character. In general, the result of any expression that isn’t assigned to a variable or
used in a control structure is echoed. For example, the following statement:
5ˆ2
Bases
Two special builtin variables let you choose the base in which numbers are input and
output:
When numbers are recognized, the input base determines the significance of each
digit. For example, the value 66 in base 10 is:
6 × 10ˆ0 = 6
+ 6 × 10ˆ1 = 60
--
66
whereas in base 8, it’s:
6 × 8ˆ0 = 6
+ 6 × 8ˆ1 = 48
--
54
Note that hex numbers are recognized in the different bases and that their values also
change with the base. For example, the number FF is valid in base 10 and has the
decimal value 165:
F(=15) × 10ˆ0 = 15
+ F(=15) × 10ˆ1 = 150
---
165
Setting the output base results in one of two numerical formats:
• For bases in the range 2 to 16, the format consists of the alphabet 0-9,A-F.
• For bases in the range 17 to 10000, the format consists of a series of decimal digits
with groups separated by spaces. In this format, each group represents a digit of
significance, thus the number 61 in obase=20 is printed as:
3 1
which should be interpreted as:
1 × 20ˆ0 = 1
+ 3 × 20ˆ1 = 60
--
61
Variables
The bc utility supports 26 simple variables, named a through z (case is significant),
and 26 arrays, also named a through z. The context determines whether the simple
variable or the array is selected. All variables are auto-initialized to 0 and are always
available (i.e. there’s no declaration statement).
Functions may create local variables (with the auto statement) that hide the global
variables of the same name while the function is executing. Arrays are limited to 2048
elements. Variables may be referenced (right-valued) or assigned to (left-valued).
Assignment operators
The assignment operator has many variations, as in the C language. For example:
a += x
a = a + x
a = b = 10
b = a++
b = a; a = a + 1;
b = ++a
a = a + 1; b = a;
continued. . .
The if statement
The if statement takes the following form:
if (expr) statement
The statement is executed only if expr evaluates to a nonzero quantity. Regardless of
the value of expr, the next statement is executed.
if (i > 2047) {
"i exceeds array limit"
i = 2047; /* limit index */
}
a[i] /* always print value */
Iteration statements
The bc utility supports two iteration statements: while and for. In both of these
structures, break means “exit the loop immediately,” and continue means “pretend
you have finished executing statement.”
The while statement has the general form:
1 If expr is false, go to 4.
2 Execute statement.
3 Go to 1.
4 Proceed.
In the while statement, continue and break are analogous to “Go to 1” and “Go to
4,” respectively.
The for statement has the general form:
1 expr1
2 If expr2 is false, go to 6.
3 Execute statement.
4 Execute expr3.
5 Go to 2.
6 Proceed.
In the for statement, continue and break are analogous to “Go to 4” and “Go to 6,”
respectively.
User-defined functions
In bc, you can define named functions that support parameters, local variables, and
recursion. A function name is a single lowercase character (a to z). A function has the
general form:
define name(parameter-list) { function-body }
You can’t remove or replace functions; it’s an error to attempt to do so. Functions can
call other functions, including themselves.
Functions can accept an arbitrary number of parameters, which may be either simple
or array variables.
Parameters are passed by value, that is, the function is given a private copy of all
parameters that remains in effect until the function returns. Notice that arrays are also
passed by value; this differs from the C calling convention.
The first statement in a function can be an auto statement, which creates “local”
variables for the function. The auto statement has this general form:
auto [variable|array]...
The local variables are used in place of the global variables of the same name until the
function returns; the local variables are also initialized to zero (see the example
below).
Functions can contain a return statement. The return statement causes the function
to exit, discarding any local variables and parameters. The statement may be in either
of two forms:
return
Or
return [retval]
where retval is a constant or a variable name. If no specific return statement is
given, or if retval is omitted, a value of 0 is returned.
if (n > 2048) {
"Array length out of bounds...\n"
return 0;
}
for (i=0; i < n; i++) {
t += b[i];
}
return t;
}
The function s() is introduced by the define statement, which also reveals the
parameter types. It’s important that all functions be called with the appropriate types
and number of parameters. Failure to do so results in unpredictable errors.
All parameters in bc are passed by value, including arrays. This is unlike C, where
arrays are always passed by reference.
The auto statement introduces the locally scoped variables t and i. You should use
automatic variables to prevent unwanted side effects of using global variables.
Function Returns
sqrt(expression) Square root of the value
continued. . .
Function Returns
length(expression) Number of significant decimal digits in the expression
scale(expression) Number of decimal digits to the right of the decimal marker
Library functions
The bc library is enabled if you invoke bc with the -l option, or if you include the
interpretation file /usr/lib/bclib.b in the command line. The library sets the
scale to 20, which you can override by assigning a new value. The library defines the
following functions:
Syntax Function
a(expression) Arctangent (in radians)
c(expression) Cosine (in radians)
e(expression) Exponential function
k(expr1,expr2) Bessel function of integer order
l(expression) Natural logarithm
s(expression) Sine (in radians)
Files:
/usr/lib/bclib.b
Contains the bc library, a set of function definitions that are loaded
automatically when the -l option is specified. This file must be present for the
-l option to work.
Exit status:
0 Successful completion.
Caveats:
The bc utility’s syntax contains a few ambiguities:
a++
a
Although the intent is obvious, the newline at the end of the while statement
comprises the body of the loop, thus a is never incremented. The C equivalent of
this example is:
a=0;
while (a < 100);
The following are “correct” versions:
a=0
while (a < 100) a++
Or
while (++a < 100)
Or
while (a < 100) {
a++
}
• The quit statement causes bc to exit when it encounters the statement, not when it
attempts to execute it. Thus, the following causes bc to exit immediately:
if (0) {
quit
}
and is equivalent to:
quit
See also:
Brian W. Kernighan and Dennis M. Ritchie, The C Programming Language,
Prentice-Hall, 1978
Syntax:
bdftophf2 [-A offset] [-E end_character]
[-N num_chars] [-O output_file]
[-o output_path] [-S start_character]
bdf_file
Runs on:
Neutrino
Options:
-A offset Offset character encodings.
Description:
The bdftophf2 utility converts Binary Data Format (BDF) font files into Photon font
files. BDF is a universal standard for ASCII bitmap font representation.
Examples:
Convert all the BDF Courier font files in the /font/bdf directory to Photon font files
in the /home/fred/font directory:
The Extension installation is necessary only if you want this font to be searched for
characters not found (such as Asian/Latin fonts) in other font files.
Caveats:
This utility works only with Unicode BDF files.
The glyphs within the .bdf file must be sorted in ascending order. For example,
0x0000, 0x0020,0x2e5f, 0xfffe is an example of a set of glyphs listed in ascending
order.
Syntax:
bindres [-x|-l][-q|-v] resfile|loadfile [widgetfile...]
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
-l List the widgetfiles in the resfile. If no widget files are specified, all the
files are listed.
-v Verbose mode.
-x Extract the widgetfiles in the resfile. If no widget files are specified, all
the widget files are extracted.
Description:
This utility binds the widgets in one or more widgetfiles into a single resource file
resfile. It’s usually run automatically as part of the PhAB build process. If you specify
a loadfile (an executable or shared object in ELF format), bindres creates a
temporary resource file, then binds it into the application.
It is possible to run an application with a separate widget resource file. If widget
resources are not bound into an application executable, at runtime the system looks for
widgets in a file with the same name as the application, but with a .res extension.
This utility can also list or extract the widgets in widget resource (.res) files
generated by bindres.
See also:
ldrel
Generating, Compiling, and Running Code in the Photon Programmer’s Guide
Syntax:
bison [options] input_file
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
For a complete listing, see the documentation at
http://www.gnu.org/software/bison/manual/.
Description:
The bison utility is a general-purpose parser generator that converts an annotated
context-free grammar into a parser for that grammar. For detailed documentation, see
http://www.gnu.org/software/bison/manual/.
This utility is subject to the GNU Public License (GPL). We’ve included it for use on
development systems.
Contributing author:
GNU
Syntax:
bkgdmgr
Runs on:
Neutrino
Options:
None.
Description:
The Photon Background Manager (bkgdmgr) provides advanced capabilities for
Photon’s desktop background display.
In addition to being able to draw a solid color background, bkgdmgr can blend
primary and secondary colors in a tiled 8×8 pixel pattern, or display a bitmap image
in any format that Photon supports. Bitmaps can be displayed in any of the following
modes:
Tiled to fill Repeats the image side-to-side and top-to-bottom to fill the
screen. Tile positioning can be biased to the top, bottom, left,
right (or a combination such as top-left), or centered.
Stretched to fill Stretches the image to fill the screen. You can specify that
bkgdmgr either maintain the original aspect (width:height) ratio
of the image, or ignore it if necessary to fill the screen.
Unmodified Don’t tile or stretch the image, but display only a single copy.
Positioning can be biased to the top, bottom, left, right (or a
combination such as top-left), or centered.
If you need only a solid background color, you don’t need to run bkgdmgr. The
Photon Window Manager, pwm, can draw a solid color desktop background.
The Background Manager reads options from a config file that it shares with pwm,
located in $HOME/.ph/wm/wm.cfg. If $HOME isn’t set, bkgdmgr looks for the
file in /.ph/wm/wm.cfg. Normally you don’t edit this file manually. Use the
Background tab on the pwmopts utility to set the options for bkgdmgr, which are
saved to the configuration file.
You can force bkgdmgr to reread the configuration file and reapply the settings by
rerunning it, or by sending it the signal SIGUSR1, for example, slay -sUSR1
bkgdmgr.
Files:
$HOME/.ph/wm/wm.cfg
Holds a user’s PWM workspace and configuration.
See also:
pwm, pwmopts
Syntax:
bootpd [-dpsT] [-t timeout] [configfile]
Runs on:
Neutrino
Options:
-d Increase the level of debugging output (-dd to be more verbose).
-t timeout When not running standalone, this option specifies the time in minutes
that bootpd will wait for the next boot request before exiting to
conserve system resources. When the next boot request arrives, inetd
will restart bootpd. If you don’t want bootpd to exit, give timeout a
value of 0. The default timeout is 15 minutes.
Description:
The bootpd server implements an Internet Boot Protocol server as defined in RFC
951 and RFC 1048.
It’s normally invoked by the inetd daemon via the following line in the
/etc/inetd.conf file:
This method conserves system resources: bootpd is started only when a boot request
arrives, and if it doesn’t receive another boot request within fifteen minutes (default) of
the last one received, it exits. You can use the -t option to specify a different timeout
value in minutes (e.g. -t 20). A timeout value of zero means forever.
Rather than wait for a boot request, bootpd can be started independently of inetd.
This is probably the desired mode of operation for large network installations with
many hosts.
When using the -s option, bootpd and inetd may compete for the same port. Make
sure to comment out the bootps entry in the /etc/inetd.conf file. In this case, the
-t option has no effect, because bootpd never exits.
Upon startup, bootpd first reads its configuration file, /etc/bootptab, and then
begins listening for BOOTREQUEST packets.
The server rereads its configuration file when it receives a hangup signal (SIGHUP) or
when it receives a bootp request packet and detects that the file has been updated.
Hosts may be added, deleted, or modified when the configuration file is reread.
Files:
/etc/bootptab Boot protocol server configuration file.
Errors:
Reported to system log.
License:
This utility is based on software of Carnegie Mellon University; for licensing
information, see the Third Party License Terms List at
http://licensing.qnx.com/third-party-terms/.
Caveats:
Individual host entries must not exceed 1024 characters.
See also:
/etc/bootptab, inetd, tftpd
TCP/IP Networking in the Neutrino User’s Guide
Based on RFC 951, RFC 1048, RFC 1084, Assigned Numbers
Name:
/etc/bootptab
Description:
The /etc/bootptab file is used by the bootpd daemon.
The configuration file has a format similar to that of termcap, in which two-character
case-sensitive tag symbols are used to represent host parameters. These parameter
declarations are separated by colons (:). The general format is:
bf Bootfile.
hn Send hostname. This is strictly a boolean tag; it doesn’t take the usual equals
sign and value. Its presence indicates that the hostname should be sent to
RFC 1048 clients. The bootpd daemon attempts to send the entire hostname
as it’s specified in the configuration file. If the name doesn’t fit into the reply
packet, it’s shortened to just the host field (up to the first period, if present) and
then tried. The server never sends an arbitrarily truncated hostname (if nothing
reasonable fits, nothing is sent).
ht Host hardware type (see Assigned Numbers RFC). This tag specifies the
hardware type code as either an unsigned decimal, octal, or hexadecimal
integer or as one of the following symbolic names:
• ethernet or ether for 10M Ethernet
• ieee802, tr, or token-ring for IEEE 802 networks.
sa TFTP server address the client should use (useful with multi-homed servers).
This tag takes a whitespace-separated list of IP addresses.
vm Vendor magic cookie selector. This can be one of the following keywords:
• auto (indicating that vendor information is determined by the client’s
request)
• rfc1048 (which always forces an RFC 1048-style reply)
• cmu (which always forces a CMU-style reply).
There’s also a generic tag, Tn, where n is an RFC 1048 vendor field tag number. This
lets you take advantage of future extensions to RFC 1048 without being forced to
modify bootpd first. Generic data may be represented as either a stream of
hexadecimal numbers or as a quoted string of ASCII characters. The length of the
generic data is automatically determined and inserted into the proper field(s) of the
RFC 1048-style bootp reply.
All IP addresses are specified in standard Internet “dot” notation and may use decimal,
octal, or hexadecimal numbers (octal numbers begin with 0, hexadecimal numbers
begin with 0x or 0X).
The hostname, home directory, and bootfile are ASCII strings that may be optionally
surrounded by double quotes ("). The client’s request and the values of the hd and bf
symbols determine how the server fills in the bootfile field of the bootp reply packet.
If the client specifies an absolute pathname and that file exists on the server machine,
then that pathname is returned in the reply packet. If the file can’t be found, the
request is discarded and no reply is sent. If the client specifies a relative pathname, a
full pathname is formed by prepending the value of the hd tag and testing for existence
of the file. If the hd tag isn’t supplied in the configuration file or if the resulting boot
file can’t be found, then the request is discarded.
Clients that specify null boot files always elicit a reply from the server. The exact reply
again depends on the hd and bf tags. If the bf tag gives an absolute pathname and the
file exists, then that pathname is returned in the reply packet. If the hd and bf tags
together specify an accessible file, then that filename is returned in the reply. If a
complete filename can’t be determined or if the file doesn’t exist, then the reply
contains a zeroed-out bootfile field.
In all these cases, the file must have its public read access bit set, since this is required
by tftpd.
Many host entries often share common values for certain tags (such as name servers,
etc.). Rather than repeatedly specify these tags, you can use the tc (table
continuation) mechanism to list a full specification for one host entry that can be
shared by others. The template entry is often a dummy host that doesn’t actually exist
and never sends bootp requests. This feature is similar to the tc feature of termcap
for similar terminals.
Note that bootpd allows the tc tag symbol to appear anywhere in the host entry,
unlike termcap, which requires it to be the last tag. Information explicitly specified
for a host always overrides information implied by a tc tag symbol, regardless of its
location within the entry. The value of the tc tag may be the hostname or IP address
of any host entry previously listed in the configuration file.
Sometimes it’s necessary to delete a specific tag after it’s been inferred via tc. You
can do this by using the construction tag @, which removes the effect of the tag as in
termcap.
For example, to completely undo an IEN-116 name server specification, put the
following at an appropriate place in the configuration entry:
:ns@:
After removal with @, a tag is eligible to be set again through the tc mechanism.
Blank lines and lines beginning with a pound sign (#) are ignored in the configuration
file. Host entries are separated from one another by newlines; a single host entry may
be extended over multiple lines if the lines end with a backslash (\). Lines can be
longer than 80 characters.
Tags may appear in any order, with the following exceptions:
default1:\
:hd=/usr/boot:bf=null:\
:ds=128.2.35.50 128.2.13.21:\
:ns=0x80020b4d 0x80020ffd:\
:ts=0x80020b4d 0x80020ffd:\
:sm=255.255.0.0:gw=0x8002fe24:\
:hn:vm=auto:to=-18000:\
:T37=0x12345927AD3BCF:T99="Special ASCII string":
carnegie:ht=6:ha=7FF8100000AF:ip=128.2.11.1:tc=default1:
baldwin:ht=1:ha=0800200159C3:ip=128.2.11.10:tc=default1:
wylie:ht=1:ha=00DD00CADF00:ip=128.2.11.100:tc=default1:
arnold:ht=1:ha=0800200102AD:ip=128.2.11.102:tc=default1:
bairdford:ht=1:ha=08002B02A2F9:ip=128.2.11.103:tc=default1:
bakerstown:ht=1:ha=08002B0287C8:ip=128.2.11.104:tc=default1:
gastonville:ht=6:ha=7FFF81000A47:ip=128.2.11.115:tc=default1:
hahntown:ht=6:ha=7FFF81000434:ip=128.2.11.117:tc=default1:
hickman:ht=6:ha=7FFF810001BA:ip=128.2.11.118:tc=default1:
lowber:ht=1:ha=00DD00CAF000:ip=128.2.11.121:tc=default1:
mtoliver:ht=1:ha=00DD00FE1600:ip=128.2.11.122:tc=default1:
The bootpd daemon looks in /etc/services to find the port numbers it should use.
Two entries are extracted:
If the port numbers can’t be determined this way, they’re assumed to be 67 for the
server and 68 for the client.
Caveats:
As a QNX Neutrino extension, the argument to the bf tag can start with an “or bar”
character (|). If it does, then the following is taken to be a command to spawn in order
to get a boot image:
If you use this extension, tftpd must not be started as root. One choice is to create
the user tftp and start tftpd as that user. You could also create and use the user
ftp, but that opens up your machine to anonymous ftp. For information on how to
change the user as which tftpd starts, see /etc/inetd.conf.
See also:
bootpd
Syntax:
brconfig -a
or:
Runs on:
Neutrino
Options:
-a Display the status of all bridge devices present on the system. This flag is
mutually exclusive with all other subcommands.
All other operations require that a bridge be specified. If a bridge is specified with no
subcommands, the status of that bridge is displayed. The following subcommands are
available:
delete interface Remove the interface named by interface from the bridge.
Promiscuous mode is disabled on the interface when it’s
removed from the bridge.
maxaddr size Set the size of the bridge address cache to size. The default is
100 entries.
timeout seconds Set the timeout of address cache entries to the given number of
seconds. If seconds is zero, then address cache entries don’t
expire. The default is 1200 seconds.
-discover interface
Clear the “discovering” attribute on a member interface. For
packets without the “discovering” attribute, the only packets
forwarded on the interface are broadcast or multicast packets
and packets for which the destination address is known to be on
the interface’s segment.
stp interface Enable the IEEE 802.1D Spanning Tree Protocol (STP) on the
interface. Spanning Tree is used to detect and remove loops in a
network topology.
-stp interface Disable the Spanning Tree Protocol on the interface. This is the
default for all interfaces added to a bridge.
maxage seconds Set the time that a Spanning Tree Protocol configuration is
valid. The default is 20 seconds, the minimum 1 second, and
the maximum 255 seconds.
fwddelay seconds Set the time that must pass before an interface begins
forwarding packets when Spanning Tree is enabled. The default
is 15 seconds, the minimum 1 second, and the maximum 255
seconds.
hellotime seconds Set the time between broadcasting of Spanning Tree protocol
configuration messages. The default is 2 seconds, the minimum
1 second, and the maximum 255 seconds.
priority value Set the bridge priority for Spanning Tree. The default is 32768.
Allowed numerical values range from 0 (highest priority) to
65535 (lowest priority).
Description:
The brconfig utility is used to configure network bridge parameters and retrieve
network bridge parameters and status from io-pkt.
A network bridge creates a logical link between two or more IEEE 802 networks that
use the same (or “similar enough”) framing format. For example, it’s possible to
bridge Ethernet and 802.11 networks together, but it isn’t possible to bridge Ethernet
and Token Ring networks together.
To create a bridge interface, use the ifconfig command’s create subcommand.
Perform all other bridge configuration using the brconfig utility.
Examples:
The following code, when placed in the file /etc/ifconfig.bridge0, creates a
bridge called bridge0, adds the interfaces ray0 and fxp0 to the bridge, and then
enables packet forwarding. You could use such a configuration to implement a simple
802.11-to-Ethernet bridge (assuming the 802.11 interface is in ad hoc mode).
create
!brconfig $int add ray0 add fxp0 up
Consider a system with two 4-port Ethernet boards. The following code, when placed
in the file /etc/ifconfig.bridge0 causes a bridge consisting of all eight ports to
be created with Spanning Tree enabled:
create
!brconfig $int \
add tlp0 stp tlp0 \
add tlp1 stp tlp1 \
add tlp2 stp tlp2 \
add tlp3 stp tlp3 \
add tlp4 stp tlp4 \
add tlp5 stp tlp5 \
add tlp6 stp tlp6 \
add tlp7 stp tlp7 \
up
See also:
ifconfig, pf
Syntax:
bunzip2 [options] [files...]
Runs on:
Neutrino
Options:
For a complete listing, see bzip2
Description:
This utility decompresses files that have been compressed with bzip2.
See also:
bzip2 freeze, gzip, pax, tar
Backing Up and Recovering Data in the Neutrino User’s Guide
Syntax:
bz2cat [options] [files...]
Runs on:
Neutrino
Options:
For a complete listing, see bzip2
Description:
This utility decompresses files that have been compressed with bzip2, and sends the
output to standard output.
See also:
bzip2 freeze, gzip, pax, tar
Syntax:
Compress and decompress files:
Decompress files:
Runs on:
Neutrino
Options:
-1 . . . -9 Set the blocksize to 100k . . . 900k.
-d Force decompression.
--repetitive-best
Compress repetitive blocks better.
--repetitive-fast
Compress repetitive blocks faster.
-z Force compression.
Description:
This utility compresses and decompresses files:
If no file names are given, bzip2 compresses or decompresses from standard input to
standard output.
See also:
freeze, gzip, pax, tar
Backing Up and Recovering Data in the Neutrino User’s Guide
Syntax:
c++filt [options] [symbol...]
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
See the GNU website at http://www.gnu.org/.
Description:
The C++ and Java languages provides function overloading, which means that you can
write many functions with the same name (providing each takes parameters of
different types). All C++ and Java function names are encoded into a low-level
assembly label (this process is known as mangling). The c++filt program does the
inverse mapping: it decodes (demangles) low-level names into user-level names so
that the linker can keep these overloaded functions from clashing.
For detailed documentation, see the GNU website at http://www.gnu.org/.
Contributing author:
GNU
Syntax:
calib [options]
Runs on:
Neutrino
Options:
-a alg Specify the calibration algorithm. Valid algorithms are 3 and 4. Default
value is 3.
-b val Specify the touch point acceptance variance (range 0 - 2000). Enabling
this will force bound checking on touch points.
-d w,h The width and height of the screen to be calibrated. If you don’t specify
this option, calib attempts to get this information from the hardware.
-f file The name and location of a calibration file to create instead of the
default at /etc/system/config/calib.$hostname.
-l limit Limit the number of samples for each touch point. Default value is 15.
-o offset Offset for crosshair position, which you can use to tweak calibration.
Applicable only with 4-point calibration.
-O The Origin. Touch screen origin (0,0) is at the lower right side. Default
is upper left corner.
-v Verbose output.
Description:
The calib utility is used to calibrate a touchscreen. Once the touchscreen is
successfully configured (i.e. you’ve created an input.node file), it must be calibrated.
The calib utility saves a configuration file at
/etc/system/config/calib.$hostname. For information about this file format,
see the “Calibration file format” section of the “Writing an Input Device Driver”
chapter of the Input DDK documentation.
To invoke the calibration screen:
1 Start Photon.
2 Run calib.
Examples:
Calibrate a quarter of a standard 640x480 VGA screen (the driver will cover only part
of the screen):
calib -d 320,240
Syntax:
driver ... cdrom cdrom_options ... &
Runs on:
Neutrino
Options:
driver One of the devb-* drivers.
The cdrom options control the driver’s interface to cam-cdrom.so for CD-ROM
devices. If specified, they must follow the cdrom keyword:
retries=num:path_id:target:lun
Set the maximum number of command retries on the specified
path, target, and lun. The default is 10.
timeout=time:path_id:target:lun
Set the command timeout on the specified path, target, and lun.
The default for a CD-ROM is 10 seconds; for a CD changer, it’s
20 seconds.
Description:
The cam-cdrom.so shared object provides common access methods (CAMs) for
CD-ROM devices.
See also:
cam-disk.so, cam-optical.so, devb-*, fs-*, io-blk.so
Connecting Hardware in the Neutrino User’s Guide
Syntax:
driver ... disk disk_options ... &
Runs on:
Neutrino
Options:
driver One of the devb-* drivers.
The disk options control the driver’s interface to cam-disk.so. If specified, they
must follow the disk keyword:
name=prefix[@device_number]
Specify the device prefix and optionally where to start
numbering the devices from:
• disk name=usb names the devices /dev/usb0,
/dev/usb1, and so on
• disk name=usb@2 starts at /dev/usb2, /dev/usb3, and
so on (in the absence of any existing naming conflicts)
CAUTION: Specify device numbers only on a closed system where you know all the
nobios Don’t use the geometry from BIOS int 13. By default, if you
don’t specify the translation option, the BIOS geometry is
used.
noptab Don’t use the geometry from the partition table. The geometry
from the partition table is used if you specify the nobios
option, or the BIOS geometry is invalid.
retries=num:path_id:target:lun
Set the maximum number of command retries on the specified
path, target, and lun. The default is 10.
timeout=time:path_id:target:lun
Set the command timeout on the specified path, target, and lun.
translation=heads[:sectors[:path_ID[:target[:lun]]]]
Specify the geometry explicitly; this overrides the geometry
from the BIOS and the partition table. The arguments are:
Description:
The cam-disk.so provides common access methods (CAMs) for hard disk devices.
See also:
cam-cdrom.so, cam-optical.so, devb-*, fdisk, fs-*, io-blk.so
Syntax:
driver ... optical disk_options ... &
Runs on:
Neutrino
Options:
driver One of the devb-* drivers.
nobios Don’t use the geometry from BIOS int 13. By default, if you don’t
specify the translation option, the BIOS geometry is used.
noptab Don’t use the geometry from the partition table. The geometry from
the partition table is used if you specify the nobios option, or the
BIOS geometry is invalid.
retries=num@path_id:target:lun
Set the maximum number of command retries on the specified path,
target, and Logical Unit Number (LUN). The default is 10.
rmb=[true|false]@path_id:target:lun
Set/clear the device as removable on path N, target N, and LUN N.
timeout=g1:g2:g3:rw@path_id:target:lun
Set the rw and group command timeouts on path N, target N, and
LUN N. The defaults are the values from the Timeout and Protect
mode page if supported, otherwise 60:90:10:10 (in seconds).
translation=heads[:sectors[@path_ID[:target[:lun]]]]
Specify the geometry explicitly; this overrides the geometry from the
BIOS and the partition table. The arguments are:
• heads and sectors — report this many heads (and optionally,
sectors) to io-blk.so for hard disks (default is 64 heads and 32
sectors). The QNX filesystem doesn’t need this information for
normal operation. It’s needed only to let fdisk write the correct
boot cylinder for booting.
• path_ID — the number of the controller to use, where the first
controller is 0 (the default).
• target — for IDE, this is the master (0) or slave (1); for SCSI, it’s
the SCSI ID the device is jumpered for. The default is 0.
• lun — the Logical Unit Number for SCSI; not needed for IDE.
The default is 0.
verbose=verbosity@path_id:target:lun
Set the verbosity level on path N, target N, and LUN N.
Description:
The cam-optical.so provides common access methods (CAMs) for optical disk
devices.
See also:
cam-disk.so, cam-cdrom.so, devb-*, fdisk, fs-*, io-blk.so
Syntax:
cat [-c] [-n|-r] [-u] [file...]
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
-c Compress sequences of multiple newline characters into single newlines.
-n Print line numbers, but don’t restart the number for each new file.
-r Print line numbers, restarting the number for each new file.
-u Write unbuffered output. Data from the input file(s) is written to the standard
output without delay as each file is read.
file The pathname of an input file. If no files are specified, the standard input is
used. If a file is the dash character (-), cat reads from the standard input at
that point in the sequence.
Description:
The cat utility reads files in the order you specify and writes their contents to
standard output.
Examples:
Write the contents of myfile to standard output:
cat myfile
Concatenate doc1 and doc2 and write the result to doc.all:
cat doc1 doc2 > doc.all
Exit status:
0 All input files were output successfully.
>0 An error occurred.
Caveats:
Because of the shell language mechanism used to perform output redirection, a
command such as:
cat doc doc.end > doc
causes the original data in doc to be lost. The file doc is opened for write by the shell,
and therefore truncated to zero length, before cat is executed.
See also:
cp, head, tail
Syntax:
cc [options] [operands]
CC [options] [operands]
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
For a complete list, see qcc.
Description:
The cc utility is used to compile code; CC is for compiling C++ code. Under QNX
Neutrino, they’re both links to qcc.
Under QNX 4, CC and cc are links to an older compiler that you can’t use to compile
code for QNX Neutrino.
Contributing author:
GNU
See also:
qcc
Syntax:
chat [options] script
Runs on:
Neutrino
Options:
-e Turn on echoing. Echoing may be turned on or off at specific
points in the chat script by using the ECHO keyword. When
echoing is enabled, all output from the modem is echoed to
stderr.
-f chatfile Read the chat script from chatfile. If you use this option, don’t
also specify a script argument. You must have read access to
chatfile. Multiple lines are permitted in the file. Use spaces or
horizontal tab characters to separate the strings.
-r report file Set the file for output of the report strings. If you use the
keyword REPORT, the resulting strings are written to this file. If
this option isn’t used and you still use REPORT keywords, the
stderr stream is used for the report strings.
-s Send all log messages from the -v options and all error
messages to stderr.
-S Don’t use the system log for log messages from the -v options
or error messages.
-t timeout Set the timeout for the expected string to be received. If the
string isn’t received within the time limit, the reply string isn’t
sent. An alternate reply may be sent; the script fails if there’s
no alternate reply string. A failed script causes chat to
terminate with a nonzero error code.
-V Verbose mode, but send all output to stderr; chat logs all text
received from the modem and the output strings that it sends.
This device is usually the local console at the station running
chat or pppd.
-v Verbose mode; chat logs all text received from the modem
and the output strings that it sends. In order to capture the log
messages, you need to have syslogd running.
script If the script isn’t specified in a file with the -f option, the
script is included as parameters to the chat program.
Description:
The chat program defines a conversational exchange between the computer and the
modem. Its primary purpose is to establish the connection between the Point-to-Point
Protocol Daemon (pppd) and the remote’s pppd process.
You should consider the modem functions (modem_open(), modem_read(),
modem_script(), and modem_write(), described in the Library Reference) or the
Photon Dialer as an alternative to chat.
Chat script
The chat script defines the communications.
A script consists of one or more “expect–send” pairs of strings, separated by spaces,
with an optional “subexpect–subsend” string pair, separated by a dash as in the
following example:
ogin:-BREAK-ogin: ppp ssword: hello2u2
This line indicates that the chat program should expect the string ogin:. If it fails to
receive a login prompt within the time interval allotted, it’s to send a break sequence to
the remote and then expect the string ogin:. If the first ogin: is received, the break
sequence isn’t generated.
Once it receives the login prompt, chat sends the string ppp and then expects the
prompt ssword:. When it receives the prompt for the password, it sends the password
hello2u2.
A carriage return is normally sent following the reply string. It isn’t expected in the
“expect” string unless it’s specifically requested by using the \r character sequence.
The expect sequence should contain only what is needed to identify the string. Since
it’s normally stored on a disk file, it shouldn’t contain variable information. It’s
generally not acceptable to look for time strings, network identification strings, or
other variable pieces of data as an expect string.
To help correct for characters that may be corrupted during the initial sequence, look
for the string ogin: rather than login:. The leading l character might be received in
error and you may never find the string even though it was sent by the system. For this
reason, scripts look for ogin: rather than login: and ssword: rather than
password:.
Abort strings
Many modems report the status of the call as a string. These strings may be
CONNECTED, NO CARRIER or BUSY. It’s often desirable to terminate the script should
the modem fail to connect to the remote. The difficulty is that a script doesn’t know
exactly which modem string it may receive. On one attempt, it may receive BUSY,
while the next time it may receive NO CARRIER.
These “abort” strings may be specified in the script using the ABORT sequence. It’s
written in the script as in the following example:
Report strings
A “report” string is similar to the ABORT string. The difference is that the strings, and
all characters to the next control character such as a carriage return, are written to the
report file.
The report strings may be used to isolate the transmission rate of the modem’s connect
string and return the value to the chat user. The analysis of the report string logic
occurs in conjunction with the other string processing such as looking for the expect
string. The use of the same string for a report and abort sequence is probably not very
useful, however, it is possible.
The report strings don’t change the completion code of the program.
These report strings may be specified in the script using the REPORT sequence. It’s
written in the script as in the following example:
This sequence expects nothing and then sends the string ATDT5551212 to dial the
telephone. The expected string is CONNECT. If the string CONNECT is received, the
remainder of the script is executed. In addition the program writes to the expect-file
the string CONNECT plus any characters that follow it, such as the connection rate.
Timeout
The initial timeout value is 45 seconds; you can change it by using the -t option.
To change the timeout value for the next expect string, specify the TIMEOUT string.
For exmple:
This changes the timeout to 10 seconds when it expects the login: prompt. The
timeout is then changed to 5 seconds when it looks for the password: prompt.
The timeout, once changed, remains in effect until it’s changed again.
Sending EOT
The special reply string of EOT indicates that the chat program should send an EOT
character to the remote. This is normally the end-of-file character sequence. A return
character isn’t sent following the EOT. The EOT sequence may be embedded into the
send string using the sequence ˆD.
Generating break
The special reply string of BREAK causes a break condition to be sent. The break is a
special signal on the transmitter. The normal processing on the receiver is to change
the transmission rate. It may be used to cycle through the available transmission rates
on the remote until you’re able to receive a valid login: prompt. The break sequence
may be embedded into the send string using the \K sequence.
Escape sequences
The expect and reply strings may contain escape sequences. All of the sequences are
legal in the reply string. Many are legal in the expect. The Expect? column in the table
below indicates whether or not the sequence is valid in an expect string.
Exit status:
0 The normal termination of the program. This indicates that the script was
executed without error to the normal conclusion.
1 One or more of the parameters are invalid or an expect string was too large for
the internal buffers. This indicates that the program wasn’t properly executed.
3 A timeout event occurred when there was an expect string without having a
“-subsend” string. This may mean that you didn’t program the script correctly
for the condition or that some unexpected event has occurred and the expected
string couldn’t be found.
... The other termination codes are also strings marked as an ABORT condition.
Using the termination code, it’s possible to determine which event terminated the
script. It’s possible to decide if the string BUSY was received from the modem as
opposed to NO DIALTONE. While the first event may be retried, the second probably
has little chance of succeeding during a retry.
See also:
syslogd
modem_open(), modem_read(), modem_script(), modem_write() in the Library
Reference
Syntax:
chattr [+/- attribute]... [filename]...
Runs on:
Neutrino
Options:
attribute The attribute you want to remove (-) or set (+).
filename The name of a file whose attributes you want to display or manipulate.
Description:
The chattr utility is a front end to the devctl(DCMD_FSYS_FILE_FLAGS)
command (from <sys/dcmd_blk.h>), which gets and sets file attributes (that are
outside the scope of the POSIX standard). For example, the DOS/FAT filesystem has
the concept of “hidden” or “system” files. Such attributes are typically stored as flags
in the on-disk inode of each file.
These attributes are divided into the following classes:
It’s the responsibility of each io-blk.so filesystem module to map generic attributes
to and from their private representation.
For example, a hidden file is a generic concept of a filename that may be hidden from
normal user browsing (not displayed by ls) but remains available (to open() by an
application) if its name is already known. The representation of this concept varies
between filesystems:
This mapping functionality allows for application abstraction away from a particular
on-disk structure (a program can work unchanged against any file on any filesystem).
Many filesystem-specific attributes have no corresponding generic concept, and must
Examples:
List the attributes for a file:
# chattr chattr.c
chattr.c: +backup +contiguous +used +modified
See also:
devb-*, fs-*, fsysinfo, io-blk.so
Syntax:
chgrp [-R] [-v] group file...
Runs on:
Neutrino
Options:
-R Recursively change group ownership of files. For each file that names a
directory, chgrp changes the group of the directory and of all files in the
file hierarchy below it.
group A group name from the group database, or a numeric group ID.
Description:
The chgrp utility lets you change the group ownership of one or more files. For each
file you name, chgrp sets the file’s group ID to that specified by the group argument.
If you invoke chgrp with the -R option, and chgrp attempts but fails to change the
group ID of a particular file in a specified file hierarchy, it continues to process the
remaining files in the hierarchy.
You must be root or the owner of the file in order to change its group ownership. The
underlying filesystem might impose further restrictions. For example, the QNX 4
filesystem sets the _PC_CHOWN_RESTRICTED configuration variable; for more
information, see pathconf() in the Neutrino Library Reference.
Examples:
Change the group of myfile to 27:
chgrp 27 myfile
Change the group of myfile to technical:
Files:
/etc/group This file defines the known group IDs for the system. It associates
group names with a numerical ID and a list of users who are
members of the group.
Entries in this file appear in the following format:
groupname:unused:groupid:user[,user]...
Exit status:
0 The utility executed successfully and all requested changes were made.
See also:
chmod, chown, find ... -chgrp
Working with Files in the Neutrino User’s Guide
Syntax:
chkdosfs [-npuy] device | mountpoint | file
Runs on:
Neutrino
Options:
-n Answer “no” to all repair questions and prompts.
device The device name hosting the DOS filesystem (e.g. /dev/hd0t6).
Description:
The chkdosfs utility performs a consistency check on the specified DOS filesystem.
This check consists of multiple passes over the filesystem.
If an error occurs, the action taken depends on the command-line options used. If -p
was specified (typically to auto-check the filesystem at startup), no message is
displayed and the default repair action is silently made. If either -n or -y was
specified, a descriptive message is displayed and a “no” or “yes” response to the
suggested action is automatically generated. Otherwise the user interactively decides
on the repair action to make (the suggested default is indicated).
In order to perform repairs, chkdosfs requires write access to the device hosting the
DOS filesystem. Normally, only root has permission for write access; if chkdosfs
does not have such access, it will still check the filesystem but will operate as if the -n
option had been specified.
By default, the chkdosfs utility checks an on-disk flag that’s maintained by the
filesystem that indicates to chkdosfs whether or not anything needs to be checked.
This flag is usually updated when mounting or unmounting the filesystem. The -u
option can be used to force the chkdosfs to run regardless of the state of this flag.
a Read-only.
b Not usually necessary.
For more information, see the Filesystems chapter of the System Architecture guide.
Examples:
Check the filesystem on the DOS partition of a hard disk:
# chkdosfs /dev/hd0t11
Exit status:
0 The filesystem was checked and either no errors were detected or all such errors
were repaired.
1 The filesystem was not checked. This may be because the user interrupted the
operation, a non-recoverable internal error such as insufficient memory
occurred, or chkdosfs found an unrepairable error.
Contributing author:
Wolfgang Solfrank, Martin Husemann
See also:
chkfsys, chkqnx6fs, devb-eide, fs-dos.so, mkdosfs, mount, umount
Syntax:
When running on QNX 4:
chkfsys [-fpPqrsuvV] [-z zapfile] drive
When running on QNX Neutrino:
chkfsys [-fpPqrsuvVx] [-z zapfile] mountpoint
Or:
chkfsys [-fpPqrsuvVx] [-z zapfile] -m drive
Runs on:
Neutrino
Options:
-f Don’t fix anything.
-m (QNX Neutrino only) No mountpoint; the path specified is a raw
device/partition.
-p Prompt before starting.
-P Suppress prompting (i.e. fix without asking any questions).
-q Be quiet.
-r Rebuild the bitmap without prompts or messages.
-s Suppress the display of statistics.
-u Check the filesystem, regardless of the status recorded on the disk.
-v Be verbose. (Shows files in addition to directories as they’re being
checked. Slows chkfsys considerably.)
-V Very verbose display.
-x (QNX Neutrino only) Exit with detailed error codes; see below.
-z zapfile Record pathnames of files that need to be zapped in the specified file.
The zapfile must reside on a different filesystem from the one being
checked.
drive The disk to check (e.g. /dev/fd0, /dev/hd0t77).
mountpoint (QNX Neutrino only) The filesystem mountpoint of the drive (e.g. /).
Description:
The chkfsys utility performs a consistency check of a QNX 4 filesystem on the
requested drive. The chkfsys utility doesn’t operate on disk partitions containing
non-QNX filesystems (e.g. DOS partitions, QNX 2 partitions). In addition, chkfsys
must have access to the block special file that the filesystem is contained in. For this
reason, chkfsys can’t be used on NFS-mounted QNX filesystems.
For QNX filesystems, chkfsys recursively walks the filesystem, checking every file
on the disk. During the walk, checks are made on the directory entry of each file and
the extents that make up the file. A bitmap is constructed in memory that’s consistent
with the block allocation of all files and directories on the disk. This bitmap is then
compared to the existing one on the disk. If they differ, the user is given the option of
replacing the existing bitmap on disk with the one constructed in memory.
By default, chkfsys checks an on-disk flag that’s maintained by the filesystem that
indicates to chkfsys whether or not anything needs to be checked. If the flag is set,
chkfsys reports that everything is fine and exits immediately. When you do an
orderly shutdown of the system, this flag is always set (unless an error had occurred in
the process). If you shut down the system by powering down, the flag may or may not
be set, depending on the state of the filesystem at the time. You can use the -u option
to force chkfsys to run even if the flag is set.
CAUTION: You should use chkfsys only when the filesystem is stable. There
! should be NO files open for writing when chkfsys is running. If you make any
repairs, remount the filesystem by slaying and restarting the disk driver.
If you aren’t doing any fixes (with the -f option), you may check a filesystem with
open files, but beware: you may get inconsistent reports in this case.
The chkfsys utility is normally used to recover blocks that were lost through the use
of the zap utility. When zap has been used, chkfsys reports that there are blocks
used in the bitmap that are in fact not used by any file. These blocks may be recovered
by writing the reconstructed bitmap back to disk. The chkfsys utility attempts to
read each of these blocks, but doesn’t mark bad blocks as available. Any blocks found
this way are added to the /.bad_blks file at the root of the filesystem being checked.
The chkfsys utility tells you if any files are using blocks that are now known to be
bad.
If chkfsys reports that a block is used by more than one file, this could indicate one
of two problems:
• If bad blocks exist, then this means that the file uses a block that’s bad and marked
as used in the bitmap.
• If there are no known bad blocks, then a multiple allocation of a single block has
occurred.
In either case, the file should be saved on another disk (if possible), and the original
file should be destroyed with the zap utility. The chkfsys utility should then be run
again to update the bitmap, after which the saved file may be restored onto this disk.
In general, whenever the bitmap is replaced, chkfsys should be run a second time to
ensure that the filesystem is indeed consistent. To do so you must specify the -u
option.
The -f (no fix) option prevents chkfsys from attempting to make any fixes to the
filesystem. The disk isn’t opened for write, but only for read. This option lets a user
examine the filesystem without requiring other users to stop using the disk or
filesystem. Beware, however, that the -f option may report errors that don’t really
exist (if other users are opening, closing, or growing files during the time that
chkfsys is running). Even so, this can be a valuable option for sites that are up and
running 24 hours a day, when the system operator carefully evaluates the results. If
you see errors that you believe result from current activity, run chkfsys again with
the -f option to verify the errors. If you have located errors that require fixing, you
should idle the filesystem and run chkfsys without the -f option.
The -p (pause) option is used primarily with floppy disks. You can start chkfsys
from a floppy diskette, wait for chkfsys to pause, remove the current disk (which
contains the chkfsys command), and then insert another disk you wish to check.
The -q (quiet) option suppresses the display of each filename as that file is checked.
This speeds up the checking significantly, without loss of information, because
chkfsys shows you the name of any files that have errors.
The -r (rebuild) option suppresses the warning message that normally appears at the
end of a chkfsys run when the existing bitmap differs from the newly constructed
bitmap in memory. When -r is specified, chkfsys automatically rebuilds the bitmap.
Note that this option isn’t effective with the -f (no fix) option.
The -s (no stats) option prevents the display of the statistics message that normally
appears at the end of a chkfsys run.
The -v (verbose) option displays information on the checking.
The -P (no prompt) option causes chkfsys to automatically fix problems
encountered without prompting the user before each fix. However, there are some
serious errors (disk IO error or corruption of a high level directory) for which the fix
may be to remove a directory (and all its hierarchy/contents). This may not be a
prudent action to undertake without user confirmation. In such a situation -P will print
an error message and exit. If you wish chkfsys to continue unattended in all
circumstances, you can specify this as “-PP”.
The -z zapfile option is used to record, in the named file, the names of files that should
be zapped after chkfsys is finished. The zapfile must be on a different filesystem
from the one being checked. When a file is found to use an area of the disk allocated
to another file, or when a file uses an area of the disk marked as bad in the bitmap, the
files must be zapped and chkfsys run again.
After a power failure
The chkfsys utility may also be run after a system crash or power failure, which may
have left some files busy. The utility makes the files “unbusy” and also makes checks
to ensure that no damage to the filesystem has occurred. QNX is designed to be
immune to this type of damage.
In the event of the loss of a filesystem due to the corruption of the root directory and
the bitmap (first few blocks of the disk), you should refer to the QNX Neutrino System
Architecture, and the dinit utility documentation for methods of initializing just
those portions of your disk. If only the root block and bitmap are damaged, chkfsys
is able to recover the files in most cases. If the root directory or inode file is damaged
(the next areas on the disk), recovery may be possible with the dinit, spatch, and
chkfsys utilities. Note that such repair requires intimate knowledge of the filesystem
structure. Many users would just recover lost files from a backup at this point. You
shouldn’t expect to run into such problems; these are very rare events that we’ve tried
to anticipate.
a Read-only.
b Not usually necessary.
For more information, see the Filesystems chapter of the System Architecture guide.
Examples:
Check the filesystem on the QNX partition of a hard disk:
chkfsys /hd
Check the QNX filesystem mounted as the root (/) and automatically rebuild the
bitmap:
chkfsys -rs /
Exit status:
The exit status depends on whether or not you specified the -x option:
CAUTION: An exit status of zero doesn’t indicate that no problems were found with
! the filesystem(s). It merely indicates that no irrecoverable errors internal to the
chkfsys utility were encountered.
>0 The filesystem(s) may not have been checked. The chkfsys operation may
have been interrupted at the request of the user or an internal error (such as
running out of memory) may have occurred.
• If you specified the -x option, the lower bit of the error code indicates whether or
not anything was fixed, while the upper four bits identify the cause of failure if
nonzero:
See also:
chkdosfs, chkqnx6fs, dcheck, dinit, fs-qnx4.so, spatch, zap
Backing Up and Recovering Data in the Neutrino User’s Guide
Syntax:
chkqnx6fs [-sv] host
Runs on:
Neutrino
Options:
-s Display header information from the superblock. The number of -v options
controls which fields chkqnx6fs displays.
If you specify -s, chkqnx6fs locates and verifies the active superblock, but doesn’t
check the filesystem itself.
host The host of the filesystem. You can specify this as a block-special device or
partition (e.g. /dev/hd0t76), as a regular file, or as the root directory of a
mounted fs-qnx6 filesystem (which will be resolved to the real host device).
Description:
The chkqnx6fs performs a consistency check on a Power-Safe (fs-qnx6)
filesystem. The check is conducted in these passes:
1 Locate and verify superblocks and select the newest stable one.
Only a stable filesystem can be checked (i.e. one that isn’t going to change or be
updated during the scan). A stable filesystem is one of the following:
• unmounted
• mounted read-only
• mounted read-write with snapshots disabled (in which case the stable filesystem,
not the working copy, is checked)
You shouldn’t actually need to use chkqnx6fs in a production system (e.g. in a boot
script). The design of the fs-qnx6 filesystem should (in the absence of software bugs,
physical bad blocks, or malicious data modification on the raw device) make any such
check unnecessary.
a Read-only.
b Not usually necessary.
For more information, see the Filesystems chapter of the System Architecture guide.
Examples:
# chkqnx6fs -v /dev/hd0t76
** Prelude: read and verify superblocks **
** Pass 1 : verify bitmap and inodes **
** Pass 2 : verify directory hierarchy **
** Summary: 20216/8040524 blocks, 142/62816 inodes **
Exit status:
0 The filesystem is consistent/stable.
See also:
chkdosfs, chkfsys, fs-qnx6.so, mkqnx6fs
Backing Up and Recovering Data in the Neutrino User’s Guide
“Power-Safe filesystem” in the Filesystems chapter of the System Architecture guide
“Power-Safe filesystem” in the Filesystems chapter of the Neutrino User’s Guide
Syntax:
chmod [-Rv] mode file...
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
-R Recursively change file modes. For each file that names a directory, chmod
changes the file mode bits of the directory and all files in the file hierarchy
below it.
mode Represents the change to be made to the file mode of each file named (see
the Description below).
file The pathname of a file whose file mode bits are to be modified.
Description:
The chmod utility lets you change any or all of the file permission mode bits of one or
more files. For each file that you name, chmod changes the file permission mode bits
according to the mode operand.
To change a file’s permission mode bits, the user of chmod must be either the owner of
the file or the superuser, root.
The mode option can be either a symbolic_mode expression or a nonnegative octal
integer.
Symbolic Modes
The symbolic_mode has the following form:
[who]operator[copy|permissions][,symbolic_mode]
g Group access
o Other access
u User access
+ Add specified permissions to the group, other, or user category of the specified
files.
- Remove specified permissions from the group, other, or user category of the
specified files.
= Set the specified permissions for the group, other, or user category of the
specified files.
The copy part specifies the unmodified permissions (i.e. before the chmod command
has been executed) of one of:
g Group
o Other
u User
r Read permission
s When executed, set the user ID (if who contains or implies u) and/or group ID
(if who contains or implies g)
t Sticky bit
w Write permission
x Execute permission
The who specification is optional. When it isn’t supplied, all the permissions (user,
group and other) are affected, but for + and = operators, only those permissions that
aren’t set in the file creation mask (see umask) are set.
The permissions part is also optional. If omitted, it defaults to none (i.e. the command
adds no permissions, removes no permissions, or sets the permissions to none,
depending on the operator).
Perform both the above operations, in the order given, on three files: myfile, file2,
and zzz:
Add read permission to the user, remove write permission from the user, and set the
group permissions to be the same as the other permissions:
Octal Modes
In octal mode, permissions are specified with a three-digit octal number. The three
digits represent user, group, and other permissions in that order.
Each permission may be specified with an octal number: read = 4; write = 2; execute
= 1; no permission = 0. The octal equivalents are derived by adding the numbers
associated with the four basic permissions. The following table illustrates their use:
For example, give the user read/write/execute (octal 7 = rwx), group read/execute
(octal 5 = r-x), and other read only (octal 4 = r--) for the file myfile:
You can combine these file modes with the permission modes described above. For
example:
In this case, setuid is set, and the user, group, and other get read/write access.
Exit status:
0 The utility executed successfully and all requested changes were made.
Caveats:
If the mode operand isn’t valid, chmod doesn’t change the file mode bits of any file.
See also:
chgrp, chown, find ... -chmod ..., ls, umask
Working with Files in the Neutrino User’s Guide
Syntax:
chown [-Rv] owner[:group] file...
Deprecated:
Runs on:
Neutrino
Options:
-R Recursively change ownership of files. For each file operand that names a
directory, chown changes the user ID of that directory and of all files in the
file hierarchy below it.
owner A username from the user database, or a numeric userid. The chown utility
changes the owner of each file to the user ID of the specified owner.
group A group name from the user database, or a numeric groupid. The chown
utility changes the group of each file to the groupid of the specified group.
Description:
The chown utility sets each file’s owner and group to the user and group IDs specified
by the owner and group operands.
Examples:
Change the owner of file data to user 27:
chown 27 data
Change the owner of the file subfile to dtdodge and set the group of the file to
techies:
Exit status:
0 The utility executed successfully and all requested changes were made.
Caveats:
If you invoke chown with the -R option, and chown attempts but fails to change the
owner or group of a particular file in a specified file hierarchy, it continues to process
the remaining files in the hierarchy. The chown utility can fail to change the user or
group of a file if you don’t have appropriate permissions.
See also:
chgrp, chmod, find ... -chown ...
Working with Files in the Neutrino User’s Guide
Syntax:
cksum [-o algorithm] [-q|-v] [file...]
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
-o algorithm Use the specified algorithm. Valid algorithm values include:
Algorithm Action
1 Use historic 16-bit checksum algorithm.
2 Use historic 32-bit checksum algorithm.
9 Use 1003.2 draft 9 algorithm (QNX versions 4.0 and 6)
11 Use 1003.2 draft 11 algorithm
12 Use 1003.2 draft 12 algorithm
92 Use 1003.2-1992 standard algorithm (DEFAULT)
4.1 Use old QNX cksum algorithm (QNX 4.10-4.21)
Description:
The cksum utility writes one line to standard output for each file you specify. This line
contains the checksum of the file, as well as the file size and the name of the file being
checked. The format of this output varies slightly depending on the command line
options specified to cksum as follows:
continued. . .
If you don’t specify any files, cksum processes standard input; no filename is given in
the output line.
The cksum utility lets you quickly compare a suspect version of a file to a trusted
version of the same file. You can also use cksum to check files after they have been
transferred by modem, restored from backup media, or unpacked from a compressed
form. The utilities that perform these operations have their own checks, but cksum
serves as a useful independent checking mechanism.
If you wish to perform a byte-by-byte comparison of files, you can use the cmp utility.
Exit status:
0 All files were processed successfully.
See also:
cmp, diff
Syntax:
clear
Runs on:
Neutrino
Options:
None.
Description:
This utility clears the text-mode screen or the current pterm window.
Syntax:
cmp [-l|-s] file1 file2
Runs on:
Neutrino
Options:
-l (“el”) Print the byte position (in decimal) and the differing bytes (octal) for
all differences (not just the first one) between the two files.
-s Be silent. Return the exit status only.
file1 The pathname of the first file to be compared. If file1 is the dash (-)
character, standard input is used.
file2 The pathname of the second file to be compared.
Description:
The cmp utility compares two files.
This utility is intended for comparing binary files, if you want to compare text files,
use diff.
If you specify both the -s and -l options, nothing is printed (no long output).
Examples:
Compare the files myfile.dat and save.dat:
cmp myfile.dat save.dat
Exit status:
0 The files are identical.
1 The files differ. This includes cases where one file is identical to the first part
of the other. In such cases, if you haven’t specified the -s option, cmp writes to
standard error a message that EOF was reached in the shorter file (before any
differences were found).
>1 An error occurred.
See also:
cksum, diff, patch, wc
Name:
/etc/context.conf
Description:
The context.conf file is used to define a collection of object resources that’s
accessible by a network entity. A context is made up of:
The agent acts as a proxy machine for the remote non-SNMP system.
Here’s the search order that’s used to find this file:
2 /etc/context.conf
where:
contextDstpartyIndex
Decimal value.
contextSrcpartyIndex
Decimal value.
contextProxyContext
Object identifier.
For example, the following defines a context (agent_context) that consists of view
index number 3 from the /etc/view.conf file:
agent_context .1.3.6.1.6.3.3.1.4.10.0.0.59.3
3 NULL CurrentTime
0 0 0
See also:
snmpget, snmpgetnext, snmptest, snmptrapd, snmpwalk
Based on ISO IS 8824 (ASN.1), RFC 1065, RFC 1066, RFC 1067, RFC 1446
Syntax:
coreinfo
Runs on:
Neutrino
Options:
None.
Description:
The coreinfo utility displays information about a QNX Neutrino core file. It lets you
examine a core dump directly, without using a debugger.
See also:
dumper
Syntax:
cp [-f|-i] [-Rrp] [QNX Neutrino extensions]
source_file target_file
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
-A (QNX Neutrino extension) Preserve source file access times.
-B (QNX Neutrino extension) Use a very small (2 KB) copy buffer.
-c (QNX Neutrino extension) Create any directories necessary to open
the destination path. For example, if the directory /home/eric
doesn’t exist, and you enter:
cp -c file /home/eric/source/file
The default mode under QNX Neutrino is different from that under QNX 4.
cp -R / /hd/backup
In this particular example, only the disk devices (block special files) actually have
their data backed up to files in /hd/backup/dev because cp doesn’t copy character
special files on recursive copies.
The addition of -N, as follows:
cp -RN / /hd/backup
causes the contents of the disk to be backed up, but the /dev
directory is skipped, since it doesn’t exist on the hard disk device.
Description:
There are two syntax forms for cp:
cp dir/dir/myfile /existingdir
copies the contents of dir/dir/myfile to the file /existingdir/myfile.
This second form is assumed when the destination file is an existing directory or
when you specify more than one source file.
General
Unless you specify the -R (recursive) option, cp refuses to copy any source_file that is
a directory.
For duplicating lists of files, see the pax -rw utility, which is another POSIX utility
for duplicating files. You can select sets of files that match complex criteria by using
find, and then pipe them to pax.
What cp does when a destination file already exists depends on the options used. If
you don’t specify -f or -i, cp prompts you only if you don’t have write permission
for the existing destination file. When this happens, you’re asked if you want to unlink
the file first. If you don’t, cp goes on to any remaining files. You’re prompted only if
stdin is a tty. Otherwise, cp prints a diagnostic message to stderr and skips that file.
If you’re copying to removable media, such as a floppy or removable disk, and the
media becomes full, cp closes and removes the incompletely copied destination file,
displays a message, then exits.
Recursive copying
When doing a recursive copy of a directory, the destination must be a directory. If
you’re copying more than one item, the directory must already exist. If you’re copying
a single directory, cp creates the destination directory (all intermediate directories
must already exist unless you specify the -c option).
There are two recursive copying modes available with cp:
• In the historical QNX 4 behavior, specified by the -Mqnx option, cp copies the files
and directories underneath the source directory to the destination directory. The
source directory itself isn’t duplicated within the destination directory.
• The default mode (-Munix) causes cp to duplicate the source directory within the
destination directory (unless a single directory is being copied and the destination
directory doesn’t yet exist, in which case -Munix and -Mqnx modes do the same
thing).
The default mode under QNX Neutrino is different from that under QNX 4.
Examples:
Copy file1, file2, and file3 from the current working directory to the
/home/eric directory:
cp -Rpv . /mydir/
Do the same in -Munix mode only:
Using -Mqnx instead of -Munix in the previous example copies the contents of the
directories named on the command line into /mydir/ (i.e. the file ./bin/ls is
copied to /mydir/ls, and the directory ./usr/bin is /mydir/bin in the
destination).
Files:
Input files If you don’t specify the -r option, and you name only one source file,
that source file may be of any filetype.
If you specify the -r option, or there’s more than one source file, the
input files specified by each source_file operand, including those files
contained within named directories, must be either regular files, block
special files, or directories.
If you use the -R option, FIFOs are duplicated in the destination
directory structure, but contents of the source FIFOs aren’t copied. If
cp encounters any block special or character special files in the source
files, an error occurs, because cp can’t create them at the destination.
Output files Each newly created output file is one of the following:
• A directory that contains copies of the files and subdirectories — if
any — found in the input directory.
• A regular file that has the same contents as the corresponding input
file.
• A FIFO that was created because the corresponding input file was
a FIFO and you specified -R. The data from the original FIFO isn’t
copied into the new FIFO (i.e. the new FIFO is empty).
Environment variables:
POSIX_STRICT Affects whether file modification times are copied, and, if set
on, causes the QNX Neutrino extension options to be disabled.
The setting of the POSIX_STRICT environment variable
affects the -p and -t options, as follows:
Exit status:
0 All input files were copied successfully.
Caveats:
If cp is copying multiple files or doing a recursive copy, but you didn’t specify the -R
option, cp refuses to copy FIFO and character special files.
If you specify the -R option, and cp attempts but fails to copy a particular file in a
specified file hierarchy, it continues to process the remaining files in the hierarchy.
See also:
mv, ln, pax
Syntax:
Read/list an archive:
Write an archive:
cpio -o[Bacv]
Copy files:
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
-a Reset access times of input files after they’ve been copied. When the -l
option is also specified, the access times of linked files aren’t reset. You
can use this option only with the -o or -i options.
-B Cause input/output to be blocked 5120 bytes to the record. You can use
this option only with the -o or -i options for data directed to or from
character special files.
-d Create directories as needed. You can use this option only with the -i or
-p options.
-f Copy in all files except those in patterns. You can use this option only
with the -i option.
-i Copy in. (Extract files from an archive being read from standard input.)
-l (“el”) Whenever possible, link files rather than copy them. You can use
this option only with the -p option.
-p Pass. Conditionally copy files from a list read from standard input to the
destination directory named as an argument to cpio.
-r Interactively rename files. A new name for each file is requested from
the user. Read and write permissions for the controlling terminal
(/dev/tty) are required for this option. If you type a null line, the file
is skipped. You should use this option only with the -i or -o options.
-t Print a table of contents of the input. No files are created. You can use
this option only with the -i option.
-u Copy files unconditionally. Usually an older file doesn’t replace a new
file with the same name. You can use this option only with the -i or -p
options.
-v Be verbose. Print the names of the affected files. You can use this option
only with the -i option. It provides a detailed listing when used with the
-t option.
Description:
The cpio utility produces and reads files in the format specified by the POSIX cpio
Archive/Interchange File Format. It operates in three modes.
The -i mode (copy in) extracts files from the standard input, which is assumed to be
the product of a previous cpio -o. Only files with names that match patterns are
selected. Multiple patterns may be specified. If no patterns are specified, the default
for patterns is to select all files. The extracted files are conditionally created and
copied into the current directory, and possibly any levels below, based on the options
used. The permissions of the files are those stored by the previous cpio -o
invocation. The owner and group of the files are that of the current user unless the user
has appropriate privileges, which causes cpio to retain the owner and group of the
files stored by the previous cpio -o invocation.
The -o mode writes the archive to the standard output.
The -p mode (pass) reads the standard input to obtain a list of pathnames of files that
are conditionally created and copied into the destination directory based upon the
options used.
If an error is detected, the cause is reported and the cpio utility continues to copy
other files. The utility skips over any unrecognized files encountered in the archive.
The following restrictions apply to the cpio utility:
• Pathnames are restricted to 256 characters.
• Appropriate privileges are required to copy special files.
• Blocks are reported in 512-byte quantities.
• Leading slashes (/) are stripped when files are extracted from an archive.
Examples:
Copy out the files listed by the ls utility and redirect them to the file archive:
ls | cpio -o >archive
Use the output file archive from the cpio -o utility, extract those files that match
the patterns memo/al and memo/b*, create the directories below the current directory,
and place the files in the appropriate directories:
Take the filenames piped to cpio from the find utility and copy or link those files to
another directory named newdir, while retaining the modification time:
Exit status:
0 All input files were copied.
Caveats:
When cpio restores a directory, it matches the permissions of the directory created to
those of the original. If that directory lacks write permission, any attempt to copy
additional files under that directory fails. To get around this, save the files under a
directory first before the directory itself. If find is used to generate pathnames for
cpio, the -depth option should be supplied to find.
Note also that the controlling terminal (/dev/tty) is used to prompt the user for
information when the -i or -r options are specified.
See also:
cp, find, pax, tar
Backing Up and Recovering Data in the Neutrino User’s Guide
Syntax:
cron [-d crondir] [-s] [-v] &
Runs on:
Neutrino
Options:
-d crondir Use the named directory instead of /var/spool/cron.
-s Poll for jobs every minute (to compensate for clock skew).
Description:
The cron server schedules commands to be run at specified times, without user
intervention. This server supports user-specific cron entries, and runs continuously.
The server must be run in the background.
The cron server assumes it has sole use of the /var/spool/cron directory.
Therefore, you can run only one cron server per filesystem containing that directory.
You typically run the cron server on the network server.
Commands are specified by instructions found in crontab files, which you can access
via the crontab utility.
To minimize overhead, cron examines the contents of the files in
/var/spool/cron/crontabs when it first comes up, and then reexamines only
those that have been changed via the crontab utility.
Files:
Errors cause diagnostic messages to be written to standard error. If you specify -v, log
messages are written to the standard error.
The cron utility uses data read from the following:
/var/spool/cron
Each cron command assumes it has exclusive use of this directory.
/var/spool/cron/cron.allow
If present, this file lists the only users authorized to have their crontab run. By
default, all users are authorized. The cron.deny list (below) overrides the
setting of the cron.allow list.
/var/spool/cron/cron.deny
If present, this file lists users who aren’t authorized to have their crontab run.
This list overrides the list of users authorized (the cron.allow file).
/var/spool/cron/crontabs/*
The periodic commands to be run are read out of files found in this directory.
Exit status:
The cron utility normally runs indefinitely. However, it terminates early if errors are
encountered in startup, errors are encountered in reading the crontabs files, or if it’s
terminated by a signal.
>0 An error occurred. A diagnostic message will have been written to standard
error.
See also:
crontab
Syntax:
crontab [-d cron_dir] [-u user] [file]
Runs on:
Neutrino
Options:
-d cron_dir The location of the crontab directory.
-l (“el”) List the crontab entry of the user. Without the -u option, the
invoking user’s entry is listed.
-u user Specify the user whose crontab is to be acted upon. When submitting
a crontab, the new crontab entry replaces or creates that user’s
crontab. When removing (-r) or listing (-l) existing crontabs, this
specifies which user’s crontab to remove or list. Only root may use
this option.
Description:
The crontab utility creates or replaces a user’s crontab entry. You can input the new
crontab entry by specifying a file that contains specifications for crontab entries. If you
don’t specify a file, the standard input is used.
This utility needs to have the setuid (“set user ID”) bit set in its permissions. If you use
mkefs, mketfs, or mkifs on a Windows host to include this utility in an image, use
the perms attribute to specify its permissions explicitly, and the uid and gid
attributes to set the ownership correctly.
modify crontab entries. If cron.allow doesn’t exist and cron.deny exists and is
empty, then global usage is allowed. These permission files consist of one user name
per line.
Each command you specify is executed from your home directory using the shell
(/bin/sh). The cron utility supplies a default environment for the shell, defining
HOME, LOGNAME, SHELL(=/bin/sh), PATH (=:/bin:/usr/bin) and TZ.
Users who want to have their .profile executed must explicitly do so in their
crontab entry.
A crontab entry consists of lines of six fields each. The fields are separated by
blanks. The first five are integer patterns that specify the following:
• minute (0-59)
• hour (0-23)
Each of these patterns can be an asterisk (meaning all valid values), an element, a list
of elements separated by commas, or a range separated by a hyphen (-).
An element is either a number or two numbers separated by a hyphen (meaning an
inclusive range). You can specify days by two fields (day of the month and day of the
week). If both are specified, both are adhered to.
As an example of specifying the two types of days, the following line:
0 0 1,15 * 1
runs a command at 00:00h on the first and fifteenth of each month, as well as at 00:00h
on every Monday. To specify days with only one field, the other field should be set to
*. For example:
0 0 * * 1
1 0 * * * calendar -
30 5 * * 1-5 /usr/lib/uucp/uuclean
Remove any files under /tmp that haven’t been modified in more than seven days:
Examples:
List your own crontab entry:
crontab -l
Files:
When an error occurs, a diagnostic message is written to the standard error.
The standard input may be read for the content of crontab files when they are being
created (none of -e, -l or -r are specified) and no file is specified on the command
line.
When a crontab file is being edited, the editor invoked by crontab inherits
crontab’s standard input, standard output, and standard error.
The following files relative to one of /var/spool/cron, or the directory named in
the -d option are used by crontab:
crontabs/userid The crontab utility may create, edit, list or remove this file.
Exit status:
0 Successful completion.
Caveats:
If you inadvertently enter the crontab utility with no argument, don’t try to get out
by typing Ctrl-D (end-of-file), since this would replace your crontab file with an empty
file. In this case, you should exit by typing your interrupt character, which is typically
Ctrl-C.
See also:
cron
Syntax:
ctags options files...
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
-a Append to the tags file, instead of overwriting it.
-t Include typedefs.
files The pathnames of the files that are to be scanned for tags.
Description:
The ctags utility generates a file called tags from a group of C source files.
Each C source file is scanned for #define statements and function definitions. The
name of the macro or function becomes the name of a tag. For each tag, a line is added
to the tags file, which contains:
• a tab character
• a tab character
Examples:
Generate tags for all the C source and header files in the current directory:
ctags *.[ch]
Contributing author:
Steve Kirkendall; ctags is part of the elvis suite.
See also:
elvis, less, more, vi
Syntax:
cut -b list [-n] [file...]
Runs on:
Neutrino
Options:
-b list Cut out the bytes found in the byte positions specified by list.
-c list Cut out the characters found in the character positions specified by list.
For example, a list of -c 1-64 outputs the first 64 characters of each
line.
-d delim Use the delimiter specified by delim (default is tab).
-f list Cut out the fields specified by list. For example, -f 2,9 outputs the
second and ninth fields. The fields described by list are assumed to be
separated in the file by a delimiter character (see option -d). Lines
without field delimiters are passed through intact, unless -s is specified.
-n Don’t split multi-byte characters. Characters are output only if at least
one byte is selected, and, after a prefix of zero or more unselected bytes,
the rest of the bytes that form the character are selected.
-s If -f is specified, suppress lines with no field delimiters.
file The pathname of a text file, whose contents are used instead of the
standard input.
Description:
For every file you name, the cut utility cuts out columns or fields from each line,
concatenates them, and writes them to the standard output.
If the fields are of a fixed length, you can select them by the byte or character position
with option -b or -c. If, however, the fields vary in length from line to line, you can
select them with the -f option, provided they’re separated by a delimiter character. By
default, cut assumes the field delimiter character to be tab. You can use the -d option
to specify another delimiter.
In options -b, -c, and -f, list is a comma-separated list of integers (in increasing
order), with an optional dash (-) to indicate ranges.
You can use the cut utility as a filter; if no files are given, the standard input is used.
Examples:
The following are examples of the list argument:
ls -l | cut -c57-79,56,56,1-11
Exit status:
0 All input files were output successfully.
See also:
grep, join, paste
Syntax:
cvs [ global_options ] cmd [ cmd_options ] [ args ]
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
The global_options are:
--allow-root=rootdir
Specify the legal CVSROOT directory (server only).
-H
--help Print a help message.
-Q Be really quiet.
-q Be somewhat quiet.
-v
--version Display version and copyright information for CVS.
-w Make new working files read-write.
-x Encrypt all communication (client only).
-z gzip-level Set the compression level (client only).
Description:
CVS is a concurrent version-control system that you can use to keep track of source
files. The cvs commands, command options, and command arguments are
summarized below; for more information, see Version Management with CVS by Per
Cederqvist et al.
This utility is subject to the GNU Public License (GPL). We’ve included it for use on
development systems.
add
add [options] [files...]
Add a new file or directory. The options include:
admin
admin [options] [files...]
Administration of history files in the repository. The options include:
annotate
annotate [options] [files...]
Show the last revision where each line was modified. The options include:
-f Use the head revision if the specified tag or date isn’t found.
checkout
checkout [options] modules...
-f Use the head revision if the specified tag or date isn’t found.
commit
commit [options] [files...]
diff
diff [options] [files...]
Show differences between revisions. In addition to the options shown below, diff
accepts a wide variety of options to control output style, for example ‘-c’ for context
diffs.
The options include:
edit
edit [options] [files...]
-a actions Specify actions for temporary watch, where the actions argument is
edit, unedit, commit, all, or none.
editors
editors [options] [files...]
export
export [options] modules...
history
history [options] [files...]
-n module In module.
import
import [options] repository vendor-tag release-tags...
Import files into CVS, using vendor branches. The options include:
init
init
log
log [options] [files...]
login
login
logout
logout
rdiff
rdiff [options] modules...
release
release [options] directory
remove
remove [options] [files...]
rtag
rtag [options] tag modules...
-a Clear the tag from removed files that would not otherwise be tagged.
status
status [options] files...
tag
tag [options] tag [files...]
Add a symbolic tag to checked out version of files. The options include:
unedit
unedit [options] [files...]
-a actions Specify actions for temporary watch, where the actions argument is
edit, unedit, commit, all, or none.
update
update [options] [files...]
Bring the work tree into sync with the repository. The options include:
-d Create directories.
watch
watch [on|off|add|remove] [options] [files...]
For on/off, turn on/off read-only checkouts of files. For add/remove, add or remove
notification on actions. The options include:
-a actions Specify actions for temporary watch, where actions is edit, unedit,
commit, all, or none.
watchers
watchers [options] [files...]
Keyword substitution
Keyword expansion modes:
-kk $Id$
-ko No expansion.
Keywords:
$Author: joe $
$Date: 1993/12/09 03:21:13 $
$Header: /home/files/file1,v 1.1 1993/12/09 03:21:13 joe Exp harry $
$Id: file1,v 1.1 1993/12/09 03:21:13 joe Exp harry $
$Locker: harry $
$Name: snapshot_1_14 $
$RCSfile: file1,v $
$Revision: 1.1 $
$Source: /home/files/file1,v $
$State: Exp $
$Log: file1,v $
Revision 1.1 1993/12/09 03:30:17 joe
Initial revision
Contributing author:
Per Cederqvist et al, Version Management with CVS
Copyright (C) 1992, 1993 Signum Support AB
Permission is granted to make and distribute verbatim copies of this manual provided
the copyright notice and this permission notice are preserved on all copies.
Permission is granted to copy and distribute modified versions of this manual under
the conditions for verbatim copying, provided also that the entire resulting derived
work is distributed under the terms of a permission notice identical to this one.
Permission is granted to copy and distribute translations of this manual into another
language, under the above conditions for modified versions, except that this permission
notice may be stated in a translation approved by the Free Software Foundation.
See also:
Using CVS in the Neutrino User’s Guide
Per Cederqvist et al, Version Management with CVS, available at
http://www.loria.fr/˜molli/cvs-index.html
Syntax:
Display the date and time:
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
-S seconds Set the maximum number of seconds (of real time) over which date
is to adjust the time. The date utility doesn’t increase the clock speed
by more than 100% or decrease it by more than 50%. If date can’t do
a slow adjustment within those constraints, the time is changed
immediately. (The default is 300 seconds; use -S0 to disable the
gradual adjustment.)
-s seconds Display the string equivalent of this date, supplied as seconds since the
start of the Epoch (00:00 January 1, 1970). This value is used instead
of the system time value for the number of seconds.
-t Display the current operating system time, in seconds since the start of
the Epoch, as a long integer.
-v Be verbose.
date A date specification to set the date to. Only the superuser (root) can
change the date. For more information, see “Setting the date,” below.
+format The format in which the date and time are to be displayed.
Description:
The date utility is used to display and set the current system date and time in
software. Only the superuser (root) may use date to set the time.
This utility uses strftime(), a libc library function, to format the time into a string.
For a complete list of the field descriptors you can use in the +format option, see
strftime() in the Library Reference.
The date utility always terminates its output with a newline character.
Be careful if you set the date during the period that a time zone is switching from
daylight saving time to standard time. When a time zone changes to standard time, the
local time goes back one hour (for example, 2:00 a.m. becomes 1:00 a.m.). The local
time during this hour is ambiguous (e.g. 1:14 a.m. occurs twice in the morning that the
time zone switches to DST). To avoid problems, use UTC time to set the date in this
period.
1 [[[CC]YY]MM]DD]hhmm[.SS]
2 MMDDhhmm[YY]
Where:
MM Numerical month of the year (01 for January, 02 for February, etc.)
Month Either the numerical month (1, 2,...12) or the standard English
abbreviation for the month (jan, feb,...dec)
am|pm Literally am or pm; you can combine them with hour values less than 13 if
you don’t want a 24-hour clock
Format 1 is compatible with the touch utility. Since each field is two digits, you must
specify a leading 0 for single-digit numbers. You should find this format particularly
useful for adjusting the time of day, since its minimal form is just hhmm (hour and
minute).
Format 2 follows the UNIX System V date conventions. It’s similar to the Format 1,
with the month and day specified, but the year is optional at the end of the
specification instead of the beginning. If there’s a dot (.) in the date, date assumes
the date is Format 1 instead of Format 2. The date utility also differentiates between
MMDDhhmmYY (Format 2) and YYMMDDhhmm (Format 1) by the value of the first
pair of digits. The years 00-12 are before the Epoch. Therefore, if the first pair of
digits is in that range, the date is treated as it is in Format 1.
Format 3 follows the date convention used in QNX 4.00 and earlier. This format is
assumed if there’s more than one operand (the other two formats consist of a single
string of digits), or if there’s just one number that’s two or fewer digits in length.
If you change the date or time, date adds a a line to the /var/log/wtmp if it already
exists.
The date utility doesn’t create /var/log/wtmp if it doesn’t already exist. This file
can quickly become very big, which isn’t good on an embedded system with limited
resources.
Examples:
Display the date and time on separate lines:
date 22 2 97
Set the system date and time to 16 May 1997, 4:30 pm:
date 1634
The following command, which illustrates the use of date -s, displays the date of
the last entry in the /usr/adm/syslog file (in this file, the first column of each
record is the time in seconds since the Epoch):
Files:
/var/log/wtmp If you change the data or time, and this file already exists, an
entry is added to it to log the change.
Environment variables:
TZ Specifies the local time zone. The value of TZ affects the conversion between
the system clock (UTC) and the local time.
Exit status:
0 The date was displayed or set successfully.
Caveats:
Some field descriptors are of unspecified format when not in the POSIX locale. As a
result, parsing the output of date may be difficult in other locales. QNX Neutrino
currently supports only the POSIX (i.e. C) locale.
See also:
phlocale, rtc, uptime
strftime() in the Library Reference
Syntax:
dcheck [options] drive
Runs on:
Neutrino
Options:
-B max_blks The maximum number of blocks to read at a time; max_blks can be
up to 32 (the default).
drive The name of the disk (e.g. /dev/fd0, /dev/hd0t77) or the root of
the filesystem.
Description:
The dcheck utility verifies that a disk has been correctly formatted, by attempting to
read every block on the drive. The block numbers of any blocks that can’t be read are
displayed (in hex) to standard output. A summary of the total number of bad blocks is
also displayed. You can use dcheck to check any formatted disk, including disks that
contain files. The files aren’t damaged.
If you don’t specify the number of blocks to verify, dcheck obtains this information
from the filesystem and checks all the blocks on the specified drive.
If a disk has been initialized for a QNX 4 filesystem, you should use the -m option to
remove any bad blocks from the disk-allocation bitmap (/.bitmap). This is
especially true for hard disks. When you specify the -m option, dcheck attempts to
read the file /.bad_blks from the disk. This file contains a list of all known bad
blocks, in sorted order. If /.bad_blks is found, dcheck reads it, and when it’s
finished checking the disk, dcheck updates the bitmap and recreates the /.bad_blks
file. Note that the dcheck utility only adds to, but never removes, bad block
information in this file.
Some blocks may be marginal, so if you run dcheck multiple times (see the -l and
-L options), you can increase the chance of recognizing these blocks and adding them
to the /.bad_blks file.
To help you find any marginal blocks, dcheck has a number of options to provide
additional checking of a disk. For example, the -r option checks the blocks in a
random order; each check consists of a random number of blocks between 1 and 32 (or
less, depending on the value specified in the -B option). The dcheck utility keeps
track of the checked blocks and checks each one only once. This option allows you to
find blocks that are bad due to a slight lag time in head movement.
The -l option makes dcheck continuously check the disk until you stop it. For this
option, -r is implicitly used and is toggled for each invocation. That is, for the first
loop, random checking is set on; for the second loop, it is off, etc. At the end of each
complete check, you’re prompted to stop the loop. If you don’t stop it within 15
seconds, dcheck is started again, etc. The -L option is identical to -l with an upper
limit to the number of loops.
The -w option makes dcheck rewrite each block on the device after reading it. This is
a nondestructive check that tests the write portion of the hardware. Note that, although
this is a more thorough test, it takes more time, depending on the hardware.
The -V option is similar to the -w option, in that dcheck rewrites each block after
reading it, but in this case dcheck also rereads each block after the rewrite check and
compares this second read with the first. Like the -w option, this test is nondestructive.
Note, however, that this is a more thorough test that takes longer.
Examples:
Check all blocks on the hard disk and mark bad blocks in the bitmap:
dcheck -m /
dcheck /dev/hd0t77
Files:
If you specify the -m (mark bad blocks) option, the block-special file being checked
must be a currently mounted QNX partition. The .bad_blks and .bitmap files on
that filesystem are updated if dcheck discovers any bad blocks.
Exit status:
0 No bad blocks were found.
Caveats:
The dcheck utility normally opens the disk in read-only mode. However, if you
specify the -m, -w, or -V option, the disk is opened in read/write mode. For read/write
access, there must be no open files on the disk, or else dcheck fails with a “Device or
resource busy” message. While dcheck is working in read/write mode, no other
utilities or programs is allowed to access the disk.
When using the -m option, if dcheck is terminated by a SIGBREAK or other signal,
any pending bad blocks may not be recorded. In any event, the results are
nondestructive.
See also:
chkfsys, dinit, fdformat, io-blk.so
Backing Up and Recovering Data in the Neutrino User’s Guide
Syntax:
dd [if=input_file] [of=output_file] [options]
Runs on:
Neutrino
Options:
if=input_file Read from input_file instead of the standard input.
bs=bytes Read and write bytes bytes at a time. Override ibs and obs.
conv=conversion[,conversion...]
Convert the file as specified by the conversion arguments.
Conversions are:
b Blocks (×512).
k Kbytes (×1024).
w Words (×2).
xm Multiply by m.
Description:
The dd utility copies a file (from the standard input to the standard output, by default)
with a user-selectable blocksize, while optionally performing conversions on it. It’s
meant for writing raw data directly to devices such as tape and disk or writing over the
network, with control over blocking factors and character set translations.
This utility is subject to the GNU Public License (GPL). We’ve included it for use on
development systems.
You can use this command for copying partial files. You can specify the block size,
skip count, and the number of blocks to copy. Sizes are in bytes by default; you can
append the letters w, b, or k to the number to indicate words (2 bytes), blocks (512
bytes), or K (1024 bytes). When dd is finished, it reports the number of full and partial
blocks read and written.
Examples:
Copy file file1 to file2, converting all text to lowercase letters:
Exit status:
>0 An error occurred.
Contributing author:
GNU
See also:
cat, cp, pax, head, tr
Syntax:
deflate [options] [filename]...
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
-b size The compression block size; one of 4K, 8K, 16K or 32K (default: 8K).
The K is assumed; you don’t need to specify it.
-t 1|2 The compression type; the default is 2. For a comparison of the types,
see below.
filename... The files to compress. If no files are given and the -i option is
specified, deflate reads from standard input and writes to standard
output, allowing it to be used as a filter.
Description:
The deflate utility compresses files for a flash filesystem. It’s intended to be used in
conjunction with the filter attribute for mkefs. It can also be used to precompress
files intended for a flash filesystem.
The compression types (specified with the -t option) are:
Examples:
Deflate all executables that are to be placed on an embedded target:
deflate -v /target/bin/* /target/lib/*
See also:
devf-*, inflator
Syntax:
Direct invocation (also causes a new io-audio process to start):
Runs on:
Neutrino
Targets:
x86
Options:
pci xx The PCI index of the card you want to attach to. If this option is not
specified, the driver will attempt to find the first unused card in the system.
Description:
The deva-ctrl-4dwave.so shared object is a device driver DLL used by the
io-audio manager. It uses the API described in the Audio Developer’s Guide.
While deva-ctrl-4dwave.so is running, you can use applications with sound, and
those that control the sound-system (e.g. mixer).
Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.
Examples:
Invoke deva-ctrl-4dwave.so directly from io-audio:
Files:
deva-mixer-ac97.so
Supports the mixer.
Errors:
When an error occurs, deva-ctrl-4dwave.so sends a description of the error to the
system logger (see slogger).
See also:
io-audio, mixer
Audio Developer’s Guide
Syntax:
Direct invocation (also causes a new io-audio process to start):
Runs on:
Neutrino
Targets:
x86, MIPS, and PPC
Options:
pci xx The PCI index of the card you want to attach to. If this option is not
specified, the driver will attempt to find the first unused card in the system.
Description:
The deva-ctrl-audiopci.so shared object is a device driver DLL used by the
io-audio manager. It uses the API described in the Audio Developer’s Guide.
While deva-ctrl-audiopci.so is running, you can use applications with sound,
and those that control the sound-system (e.g. mixer).
Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.
Examples:
Invoke deva-ctrl-audiopci.so directly from io-audio:
Files:
deva-mixer-ac97.so or deva-mixer-ak4531.so
Supports the mixer.
Errors:
When an error occurs, deva-ctrl-audiopci.so sends a description of the error to
the system logger (see slogger).
Contributing author:
This utility is based on software contributed to The NetBSD Foundation
by Lennart Augustsson <augustss@netbsd.org> and Charles M. Hannum.
License:
This utility is based on software from The NetBSD foundation; for licensing
information, see the Third Party License Terms List at
http://licensing.qnx.com/third-party-terms/.
See also:
io-audio, mixer
Audio Developer’s Guide
Syntax:
Direct invocation (also causes a new io-audio process to start):
Runs on:
Neutrino
Targets:
x86
Options:
pci xx The PCI index of the card you want to attach to. If this option is not
specified, the driver will attempt to find the first unused card in the system.
Description:
The deva-ctrl-cs4281.so shared object is a device driver DLL used by the
io-audio manager. It uses the API described in the Audio Developer’s Guide.
While deva-ctrl-cs4281.so is running, you can use applications with sound, and
those that control the sound-system (e.g. mixer).
Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.
Examples:
Invoke deva-ctrl-cs4281.so directly from io-audio:
Files:
deva-mixer-ac97.so
Supports the mixer.
Errors:
When an error occurs, deva-ctrl-cs4281.so sends a description of the error to the
system logger (see slogger).
See also:
io-audio, mixer
Audio Developer’s Guide
Syntax:
Direct invocation (also causes a new io-audio process to start):
Runs on:
Neutrino
Targets:
x86
Options:
pci xx The PCI index of the card you want to attach to. If this option is not
specified, the driver will attempt to find the first unused card in the system.
Description:
The deva-ctrl-ess1938.so shared object is a device driver DLL used by the
io-audio manager. It uses the API described in the Audio Developer’s Guide.
While deva-ctrl-ess1938.so is running, you can use applications with sound,
and those that control the sound-system (e.g. mixer).
Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.
Examples:
Invoke deva-ctrl-ess1938.so directly from io-audio:
Files:
deva-mixer-ac97.so
Supports the mixer.
Errors:
When an error occurs, deva-ctrl-ess1938.so sends a description of the error to
the system logger (see slogger).
See also:
io-audio, mixer
Audio Developer’s Guide
Syntax:
Direct invocation (also causes a new io-audio process to start):
Runs on:
Neutrino
Targets:
x86
Options:
pci xx The PCI index of the card you want to attach to. If this option is not
specified, the driver will attempt to find the first unused card in the system.
Description:
The deva-ctrl-geode.so shared object is a device driver DLL used by the
io-audio manager. It uses the API described in the Audio Developer’s Guide.
While deva-ctrl-geode.so is running, you can use applications with sound, and
those that control the sound-system (e.g. mixer).
Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.
Examples:
Invoke deva-ctrl-geode.so directly from io-audio:
Files:
deva-mixer-ac97.so
Supports the mixer.
Errors:
When an error occurs, deva-ctrl-geode.so sends a description of the error to the
system logger (see slogger).
Caveats:
You need a current BIOS to run deva-ctrl-geode.so. The BIOS VSA (Virtual
System Architecture) technology must be sufficiently up-to-date to enable the native
audio programming techniques used by this driver. If the BIOS is too old,
deva-ctrl-geode.so will exit and slogger will contain the exit message.
See also:
io-audio, mixer
Audio Developer’s Guide
Syntax:
Direct invocation (also causes a new io-audio process to start):
Runs on:
Neutrino
Targets:
x86
Options:
pci xx The PCI index of the card you want to attach to. If you don’t specify this
option, the driver attempts to find the first unused card in the system.
Description:
The deva-ctrl-i8x0.so shared object is a device driver DLL used by the
io-audio manager. It uses the API described in the Audio Developer’s Guide.
While deva-ctrl-i8x0.so is running, you can use applications with sound, and
those that control the sound-system (e.g. mixer).
Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.
Examples:
Invoke deva-ctrl-i8x0.so directly from io-audio:
Files:
deva-mixer-ac97.so
Supports the mixer.
Errors:
When an error occurs, deva-ctrl-i8x0.so sends a description of the error to the
system logger (see slogger).
See also:
deva-mixer-ac97.so, io-audio, mixer
Audio Developer’s Guide
Syntax:
Direct invocation (also causes a new io-audio process to start):
Runs on:
Neutrino
Targets:
x86
Options:
pci xx The PCI index of the card you want to attach to. If you don’t specify this
option, the driver attempts to find the first unused card in the system.
Description:
The deva-ctrl-intel_hda.so shared object is a device driver DLL used by the
io-audio manager. It uses the API described in the Audio Developer’s Guide.
While deva-ctrl-intel_hda.so is running, you can use applications with sound,
and those that control the sound system (e.g. mixer).
Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.
Examples:
Invoke deva-ctrl-intel_hda.so directly from io-audio:
Files:
deva-mixer-hda.so
Supports the mixer.
Errors:
When an error occurs, deva-ctrl-intel_hda.so sends a description of the error
to the system logger (see slogger).
See also:
deva-mixer-hda.so, io-audio, mixer
Audio Developer’s Guide
Syntax:
Direct invocation (also causes a new io-audio process to start):
Runs on:
Neutrino
Targets:
x86
Options:
pci xx The PCI index of the card you want to attach to. If you don’t specify this
option, the driver attempts to find the first unused card in the system.
Description:
The deva-ctrl-nmg6.so shared object is a device driver DLL used by the
io-audio manager. It uses the API described in the Audio Developer’s Guide.
While deva-ctrl-nmg6.so is running, you can use applications with sound, and
those that control the sound-system (e.g. mixer).
Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.
Examples:
Invoke deva-ctrl-nmg6.so directly from io-audio:
Files:
deva-mixer-ac97.so
Supports the mixer.
Errors:
When an error occurs, deva-ctrl-nmg6.so sends a description of the error to the
system logger (see slogger).
See also:
deva-mixer-ac97.so, io-audio, mixer
Audio Developer’s Guide
Syntax:
Direct invocation (also causes a new io-audio process to start):
Runs on:
x86 only (requires ISA bus)
Options:
dma=ch The primary DMA channel to be used. The value of ch may be 0, 1,
3, 5, 6, or 7. The default value is 1.
ioport=port Specifies the base I/O port for Sound Blaster commands. The value
of port is usually 0x220, 0x240, 0x260, or 0x280. The default
value is 0x220.
irq=req The interrupt request line specified by req cannot be shared. The
default value is 10.
Description:
The deva-ctrl-sb.so shared object is a DLL for the io-audio manager. It uses
the API described in the Audio Developer’s Guide.
While deva-ctrl-sb.so is running, you can use applications with sound, and those
that control the sound-system (e.g. mixer).
Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.
Errors:
When an error occurs, deva-ctrl-sb.so sends a description of the error to the
system logger (see slogger).
Caveats:
Some sound cards listed as being Sound Blaster compatible default to another mode
(e.g. some ESS 18xx series (not ESS 1869), OPTi 931, Yamaha OPL3-SA). These
cards will not work with this driver.
See also:
io-audio, mixer Audio Developer’s Guide
Syntax:
Direct invocation (also causes a new io-audio process to start):
Runs on:
Neutrino
Targets:
x86
Options:
pci xx The PCI index of the card you want to attach to. If this option is not
specified, the driver will attempt to find the first unused card in the system.
Description:
The deva-ctrl-via686.so shared object is a device driver DLL used by the
io-audio manager. It uses the API described in the Audio Developer’s Guide.
While deva-ctrl-via686.so is running, you can use applications with sound, and
those that control the sound-system (e.g. mixer).
Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.
Examples:
Invoke deva-ctrl-via686.so directly from io-audio:
Files:
deva-mixer-ac97.so
Supports the mixer.
Errors:
When an error occurs, deva-ctrl-via686.so sends a description of the error to the
system logger (see slogger).
See also:
io-audio, mixer
Audio Developer’s Guide
Syntax:
Direct invocation (also causes a new io-audio process to start):
Runs on:
Neutrino
Targets:
x86
Options:
pci xx The PCI index of the card you want to attach to. If this option is not
specified, the driver will attempt to find the first unused card in the system.
Description:
The deva-ctrl-vortex.so shared object is a device driver DLL used by the
io-audio manager. It uses the API described in the Audio Developer’s Guide.
While deva-ctrl-vortex.so is running, you can use applications with sound, and
those that control the sound-system (e.g. mixer).
Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.
Examples:
Invoke deva-ctrl-vortex.so directly from io-audio:
Files:
deva-mixer-ac97.so
Supports the mixer.
Errors:
When an error occurs, deva-ctrl-vortex.so sends a description of the error to the
system logger (see slogger).
Contributing author:
Aureal Semiconductor Inc.
See also:
io-audio, mixer
Audio Developer’s Guide
Syntax:
Direct invocation (also causes a new io-audio process to start):
Runs on:
Neutrino
Targets:
x86
Options:
pci xx The PCI index of the card you want to attach to. If this option is not
specified, the driver will attempt to find the first unused card in the system.
Description:
The deva-ctrl-ymfds1.so shared object is a device driver DLL used by the
io-audio manager. It uses the API described in the Audio Developer’s Guide.
While deva-ctrl-ymfds1.so is running, you can use applications with sound, and
those that control the sound-system (e.g. mixer).
Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.
Examples:
Invoke deva-ctrl-ymfds1.so directly from io-audio:
Files:
deva-mixer-ac97.so
Supports the mixer.
Errors:
When an error occurs, deva-ctrl-ymfds1.so sends a description of the error to the
system logger (see slogger).
Contributing author:
Aureal Semiconductor Inc.
See also:
io-audio, mixer
Audio Developer’s Guide
You can’t invoke this shared object. An audio driver (deva-ctrl-*) loads it if the
driver determines that your hardware needs it.
Syntax:
N/A
Runs on:
Neutrino
Options:
None.
Description:
The deva-mixer-ac97.so shared object provides an interface between the AC’97
standard codec and an audio driver.
Errors:
When an error occurs, deva-mixer-ac97.so sends a description of the error to the
system logger (see slogger).
See also:
io-audio, mixer
The Intel Corporation web site for the the Audio Codec ’97 specification
You can’t invoke this shared object. An audio driver (deva-ctrl-*) loads it if the
driver determines that your hardware needs it.
Syntax:
N/A
Runs on:
Neutrino
Options:
None.
Description:
The deva-mixer-ak4531.so shared object provides an interface between the
AK4531 CODEC and an audio driver.
Errors:
When an error occurs, deva-mixer-ak4531.so sends a description of the error to
the system logger (see slogger).
See also:
io-audio, mixer,
You can’t invoke this shared object. An audio driver (deva-ctrl-*) loads it if the
driver determines that your hardware needs it.
Syntax:
N/A
Runs on:
Neutrino
Options:
None.
Description:
The deva-mixer-hda.so shared object provides an interface between High
Definition Audio codecs and an audio driver.
The Dll has support for a subset of the codecs in production; your particular codec
may not yet be supported.
Errors:
When an error occurs, deva-mixer-hda.so sends a description of the error to the
system logger (see slogger).
See also:
io-audio, mixer
You don’t invoke this object directly; io-audio loads it on loading a new driver.
Syntax:
N/A
Runs on:
Neutrino
Targets:
ARM, MIPS, PPC, SH, x86
Options:
None.
Description:
When io-audio loads a new driver, it uses the deva-util-restore.so shared
object to restore the driver’s state, which consists of all the device settings, such as the
output volume level and the selected input connection. The state information is
restored from a configuration file that was updated the last time the driver ran.
This shared object is an optional component of the audio system. If io-audio can’t
load it, io-audio continues, but doesn’t restore the driver state. See also the
io-audio global option config_write_delay.
Errors:
When an error occurs, deva-util-restore.so sends a description of it to the
system logger, slogger.
See also:
io-audio, mixer
Driver Development Kits Audio Devices
Syntax:
devb-adpu320 [cam option[,option]...]
[cdrom option[,option]...]
[disk option[,option]...]
[optical option[,option]...]
[adpu320 option[,option]...]
[blk option[,option]...] &
Runs on:
Neutrino
Options:
Use commas (,) to separate the options. You can put the cam, cdrom, disk,
optical, adpu320, and blk groups of options in any order.
cam options
lun=mask Enable Logical Unit Number (LUN) scan for the devices specified in
mask. The mask is a hex bitmask specifying which IDs to scan for; the
default is 0x00.
cdrom options
The cdrom options control the driver’s interface to cam-cdrom.so. If specified, they
must follow the cdrom keyword.
disk options
The disk options control the driver’s interface to cam-disk.so. If specified, they
must follow the disk keyword.
optical options
The optical options control the driver’s interface to cam-optical.so. If specified,
they must follow the optical keyword.
adpu320 options
The adpu320 options control the driver’s interface to the U320 series controllers. If
you’ve installed multiple controllers, you can repeat these options for each controller.
Remember, however, to specify the adpu320 keyword before each controller’s set of
options.
pci=index The PCI index of the controller in the machine, where index is a value
between 0 and the number of adapters.
blk options
The blk options control io-blk.so. If specified, they must follow the blk keyword.
Description:
The devb-adpu320 driver is for SCSI adapters based on the Adaptec AIC-790X
chips.
Controllers supported by this driver include, but aren’t necessarily limited to:
Manufacturer Controller
Adaptec AIC-7901
Adaptec AIC-7902
Adaptec 29320A-R
If you have problems with the PCI adapter make sure that you have an up to date
version of the the adapter BIOS as well as system BIOS.
Controllers are numbered from 0 to n, in the order they’re found. For each controller,
the driver performs a scan, looking for installed units. All targets are scanned (0 to 7)
and for each target, each LUN (Logical Unit Number) is scanned (0 to 7). Devices are
numbered starting from 0, and each type of device is numbered separately.
The devb-adpu320 driver closes its standard input, standard output and standard
error immediately after completing its initializations. Error messages may be
produced during the initialization phase and are written to standard error.
Examples:
Assume an U320 controller, and list all connected devices:
devb-adpu320 &
Assume an U320 PCI controller with a PCI index of 1, and list all connected devices:
Files:
The devb-adpu320 driver causes io-blk.so to adopt various block special devices
under /dev. These devices are normally named hd n (or cd n for CD-ROMs), where n
is the physical unit number of the device. This driver could also require the following
shared objects:
Binary Required
cam-cdrom.so For CD-ROM access
cam-disk.so For hard-disk access
libcam.so Always
Exit status:
The devb-adpu320 driver terminates only if an error occurs during startup, or if it
has successfully forked itself upon startup because it hadn’t been initially started in the
background.
Caveats:
Unless overridden with the blk automount= option (see io-blk.so), devices are
mounted as:
While there’s no limit to the size of a disk or partition, I/O (i.e. the lseek(), read() and
write() functions) is currently limited to 2 gigabytes per partition (or disk). This I/O
limit has no effect on the partition size for mounted filesystems.
Known supported functions include:
Note that certain calls (such as pipe(), as well as read() and write() on FIFOs) may
require the pipe manager.
See also:
cam-*, devb-*, fs-*, io-blk.so
“Filesystems and block I/O (devb-*) drivers” in the Fine-Tuning Your System
chapter of the QNX Neutrino User’s Guide
Syntax:
devb-aha8 [cam option[,option]...]
[cdrom option[,option]...]
[disk option[,option]...]
[optical option[,option]...]
[aha8 option[,option]...]
[blk option[,option]...] &
Runs on:
Neutrino
Options:
Use commas (,) to separate the options. You can put the cam, cdrom, disk,
optical, aha8, and blk groups of options in any order.
cam options
lun=mask Enable Logical Unit Number (LUN) scan for the devices specified in
mask. The mask is a hex bitmask specifying which IDs to scan for; the
default is 0x00.
cdrom options
The cdrom options control the driver’s interface to cam-cdrom.so. If specified, they
must follow the cdrom keyword.
disk options
The disk options control the driver’s interface to cam-disk.so. If specified, they
must follow the disk keyword.
optical options
The optical options control the driver’s interface to cam-optical.so. If specified,
they must follow the optical keyword.
aha8 options
The aha8 options control the drivers interface to the AHA 8 series controllers. If
you’ve installed multiple controllers, you can repeat these options for each controller.
Remember, however, to specify the aha8 keyword before each controller’s set of
options.
pci=index The PCI index of the controller in the machine, where index is a value
between 0 and the number of adapters.
blk options
The blk options control io-blk.so. If specified, they must follow the blk keyword.
Description:
The devb-aha8 driver is for SCSI adapters based on the Adaptec AIC-7870 and
AIC-7880 chips. Controllers supported by this driver include, but aren’t necessarily
limited to:
Manufacturer Controller
Adaptec AIC-7870
Adaptec AIC-7880
Adaptec AHA-2940
Adaptec AHA-2940W
Adaptec AHA-3940
The devb-aha8 driver queries the BIOS for PCI card memory addresses.
If you have problems with the PCI adapter make sure that you have an up to date
version of the the adapter BIOS as well as system BIOS.
Examples:
Assume an AHA 8 controller, and list all connected devices:
devb-aha8 &
Assume an AHA 8 PCI controller with a PCI index of 1, and list all connected devices:
Files:
The devb-aha8 driver causes io-blk.so to adopt various block special devices
under /dev. These devices are normally named hdn (or cdn for CD-ROMs), where n
is the physical unit number of the device.
This driver could also require the following shared objects:
Binary Required
cam-cdrom.so For CD-ROM access.
cam-disk.so For hard-disk access.
libcam.so Always
Exit status:
The devb-aha8 driver terminates only if an error occurs during startup, or if it has
successfully forked itself upon startup because it hadn’t been initially started in the
background.
0 The devb-aha8 driver wasn’t started in the background and therefore forked
itself. The original process terminated with a zero exit status, the forked
process continued.
Caveats:
Unless overridden with the blk automount= option (see io-blk.so), devices are
mounted as:
continued. . .
While there’s no limit to the size of a disk or partition, I/O (i.e. the lseek(), read() and
write() functions) is currently limited to 2 gigabytes per partition (or disk). This I/O
limit has no effect on the partition size for mounted filesystems.
Known supported functions include:
Note that certain calls (such as pipe(), as well as read() and write() on FIFOs) may
require the pipe manager.
See also:
cam-*, devb-*, fs-*, io-blk.so
“Filesystems and block I/O (devb-*) drivers” in the Fine-Tuning Your System
chapter of the QNX Neutrino User’s Guide
Syntax:
devb-ahci [cam option[,option]...]
[ahci option[,option]...]
[blk option[,option]...] &
Runs on:
QNX Neutrino
Options:
Use commas (,) to separate the options. You can put the cam, ahci, and blk groups
of options in any order.
cam options
lun=mask Enable Logical Unit Number (LUN) scan for the devices specified in
mask. The mask is a hex bitmask specifying which IDs to scan for; the
default is 0x00.
ahci options
The ahci options control the driver’s interface to the AHCI controller. If you’ve
installed multiple controllers, you can repeat these options for each controller.
Remember, however, to specify the ahci keyword before each controller’s set of
options.
Interface-specific options:
pci=index The PCI index of the controller in the machine, where index is
a value between 0 and the number of adapters.
priority=prio Set the priority of the processing thread. The default is 21.
timeout=timeout Set the I/O request timeout, in seconds. The default is 10.
Device-specific options:
geometry=heads:cyl:sect
Specify the drive geometry.
blk options
The blk options control io-blk.so. If specified, they must follow the blk keyword.
Description:
The devb-ahci supports the Intel AHCI SATA controller with the following device
IDs:
Examples:
Detect all SATA controllers, and list all connected devices:
devb-ahci &
Files:
The devb-ahci driver causes io-blk.so to adopt various block special devices
under /dev. These devices are normally named hdn, where n is the physical unit
number of the device.
This driver could also require the following shared objects:
Binary Required
cam-disk.so For hard-disk access.
libcam.so Always
Exit status:
The devb-ahci driver terminates only if an error occurs during startup, or if it has
successfully forked itself upon startup because it hadn’t been initially started in the
background.
0 The devb-ahci driver wasn’t started in the background and therefore forked
itself. The original process terminated with a zero exit status, the forked
process continued.
Caveats:
Unless overridden with the blk automount= option (see io-blk.so), devices are
mounted as:
While there’s no limit to the size of a disk or partition, I/O (i.e. the lseek(), read() and
write() functions) is currently limited to 2 gigabytes per partition (or disk). This I/O
limit has no effect on the partition size for mounted filesystems.
Known supported functions include:
Note that certain calls (such as pipe(), as well as read() and write() on FIFOs) may
require the pipe manager.
See also:
cam-*, devb-*, fs-*, io-blk.so
“Filesystems and block I/O (devb-*) drivers” in the Fine-Tuning Your System
chapter of the QNX Neutrino User’s Guide
Syntax:
devb-btmm [cam option[,option]...]
[cdrom option[,option]...]
[disk option[,option]...]
[optical option[,option]...]
[btmm option[,option]...]
[blk option[,option]...] &
Runs on:
Neutrino
Options:
Use commas (,) to separate the options. You can put the cam, cdrom, disk,
optical, btmm, and blk groups of options in any order.
cam options
lun=mask Enable Logical Unit Number (LUN) scan for the devices specified in
mask. The mask is a hex bitmask specifying which IDs to scan for; the
default is 0x00.
cdrom options
The cdrom options control the driver’s interface to cam-cdrom.so. If specified, they
must follow the cdrom keyword.
disk options
The disk options control the driver’s interface to cam-disk.so. If specified, they
must follow the disk keyword.
optical options
The optical options control the driver’s interface to cam-optical.so. If specified,
they must follow the optical keyword.
btmm options
The btmm options control the drivers interface to the BusLogic/Mylex Multimaster
series controllers. If you’ve installed multiple controllers, you can repeat these options
for each controller. Remember, however, to specify the btmm keyword before each
controller’s set of options.
ioport=port The I/O port of the interface. By default, it’s detected automatically.
clone Use this for clones; the default is for the driver to attempt to verify
the type of card, and clone disables this check.
irq=req Assume that the controller is using this interrupt. Default is 11.
blk options
The blk options control io-blk.so. If specified, they must follow the blk keyword.
Description:
The devb-btmm driver is for the BusLogic/Mylex Multimaster and compatible SCSI
controllers.
Controllers supported by this driver include, but aren’t necessarily limited to:
Controller Description
BT-440C Bus master VL SCSI host adapter.
BT-445C Bus master VL SCSI host adapter with floppy controller.
BT-542B Bus master ISA SCSI host adapter with floppy controller.
BT-542D Bus master ISA-to-Fast SCSI host adapter with floppy controller.
BT-545C Bus master ISA SCSI host adapter with floppy controller.
BT-545S Bus master ISA-to-Fast SCSI host adapter with floppy controller.
BT-646S Bus master MCA SCSI host adapter.
BT-747S Bus master EISA SCSI host adapter.
BT-946C Bus master PCI-to-Fast SCSI host adapter with floppy controller.
The driver performs a scan, looking for installed units. All targets are scanned (0 to 7)
and for each target, each LUN (Logical Unit Number) is scanned (0 to 7). Devices are
numbered starting from 0, and each type of device is numbered separately.
The devb-btmm driver closes its standard input, standard output and standard error
immediately after completing its initializations. Error messages may be produced
during the initialization phase and are written to standard error.
Examples:
Start the Multimaster driver:
devb-btmm &
Start the Multimaster driver with an I/O port of 0x330 and an interrupt of 11:
Files:
The devb-btmm driver causes io-blk.so to adopt various block special devices
under /dev. These devices are normally named hdn (or cdn for CD-ROMs), where n
is the physical unit number of the device.
This driver could also require the following shared objects:
Binary Required
cam-cdrom.so For CD-ROM access
cam-disk.so For hard-disk access
libcam.so Always
Exit status:
The devb-btmm driver terminates only if an error occurs during startup, or if it has
successfully forked itself upon startup because it hadn’t been initially started in the
background.
0 The devb-btmm driver wasn’t started in the background and therefore forked
itself. The original process terminated with a zero exit status, the forked
process continued.
Caveats:
The BusLogic/Mylex Multimaster host adapter is compatible with the Adaptec
AIC-154x SCSI controller. On startup, the enumerators recognize this adapter as the
Adaptec card but devb-aha4 will fail unless it includes the clone option.
Unless overridden with the blk automount= option (see io-blk.so), devices are
mounted as:
While there’s no limit to the size of a disk or partition, I/O (i.e. the lseek(), read() and
write() functions) is currently limited to 2 gigabytes per partition (or disk). This I/O
limit has no effect on the partition size for mounted filesystems.
Known supported functions include:
Note that certain calls (such as pipe() as well as read() and write() on FIFOs) may
require the pipe manager.
See also:
cam-*, devb-*, fs-*, io-blk.so
“Filesystems and block I/O (devb-*) drivers” in the Fine-Tuning Your System
chapter of the QNX Neutrino User’s Guide
Syntax:
devb-eide [blk option[,option]...]
[cam option[,option]...]
[cdrom option[,option]...]
[disk option[,option]...]
[eide option[,option]...] &
Runs on:
Neutrino
Options:
Use commas (,) to separate the options. You can put the blk, cam, cdrom, disk, and
eide groups of options in any order.
blk options
The blk options control io-blk.so. If specified, they must follow the blk keyword.
cam options
quiet Be quiet: don’t display any information on startup.
verbose Be verbose.
cdrom options
The cdrom options control the driver’s interface to cam-cdrom.so. If specified, they
must follow the cdrom keyword.
disk options
The disk options control the driver’s interface to cam-disk.so. If specified, they
must follow the disk keyword.
eide options
The eide options control the driver’s interface to the EIDE controller. If you’ve
installed multiple controllers, you can repeat these options for each controller.
Remember, however, to specify the eide keyword before each controller’s set of
options.
Interface-specific options:
nobios Do not use BIOS transfer mode settings. The default is to use
them.
pci=index The PCI index of the controller in the machine, where index is
a value between 0 and the number of adapters.
priority=prio Set the priority of the processing thread. The default is 21.
stride=space Set the spacing offset between I/O ports (IDE command
registers). E.g. if the ports are located on 4-byte boundaries, set
space to 4. The default is 1.
timeout=timeout Set the I/O request timeout in seconds. The default is 10.
Device-specific options:
Description:
The devb-eide driver is for IDE (Integrated Drive Electronics), EIDE (Enhanced
IDE) and ATA (AT Attachment) hard disk interface, as well as the ATAPI (ATA Packet
Interface) CD-ROM interface. This driver autodetects all interfaces.
If you’re installing multiple operating systems on the drive, make sure they all use a
compatible mode. For example, if your drive is ≥ 528M and DOS will also be installed
on the drive, the driver should be configured to use LBA.
The devb-eide driver uses DMA by default. If you want to disable DMA, specify
the nobmstr command-line option.
By default, the driver uses LBA (Logical Block Addressing) modes if the drive
supports them. If you want the device programmed to CHS (Cylinder-Head-Sector)
mode, specify the chs option.
The devb-eide driver closes its standard input, standard output, and standard error
immediately after completing its initializations. Any error messages produced during
the initialization phase are written to standard error.
Examples:
Detect all IDE controllers, and list all connected devices:
devb-eide &
Detect an IDE controller at a specific I/O port address and IRQ number, and list all
connected devices:
devb-eide eide ioport=0x1f0,irq=14
For PCMCIA devices configured in contiguous I/O mapped addressing, you should
always specify the control block address of the interface by adding an offset (usually
12) to the base address of the port. This is not required for legacy addressing (0x1f0
or 0x170), where the driver adds the standard control block offset (0x200)
automatically.
Detect an IDE controller with a specific vendor and device identity, and list all
connected devices:
devb-eide eide vid=0x8086,did=0x2411,pci=0,chnl=0
Detect an IDE controller with a specific vendor ID, device ID, and channel number,
and disable ultra DMA on the master:
devb-eide eide vid=0x8086,did=0x2411,pci=0,chnl=1,master=udma=off
Pass cache and delwri options to io-blk.so, uid and gid options to fs-cd.so,
and vollabel option to fs-dos.so:
devb-eide blk cache=2m,delwri=2s cd uid=234,gid=120 dos \
vollabel=ignore &
The cd and dos options apply to any filesystems of those types that are mounted
(either by the automatic mounter or a later explicit mount).
You can also pass generic mount options (as described in io-blk.so) as follows:
devb-eide blk noatime dos hidden=show,noexec qnx4 ro &
This sets the ST_NOATIME mount bit for all filesystems, the ST_RDONLY bit for any
QNX 4 filesystem, and the ST_NOEXEC bit for any DOS filesystem. The mount
message also has these bits, which apply only to that mountpoint.
Files:
The devb-eide driver causes io-blk.so to adopt various block special devices
under /dev. These devices are normally named hdn (or cdn for CD-ROMs), where n
is the physical unit number of the device.
This driver could also require the following shared objects:
Binary Required
cam-cdrom.so For CD-ROM access
cam-disk.so For hard-disk access
libcam.so Always
Exit status:
The devb-eide driver terminates only if an error occurs during startup, or if it has
successfully forked itself upon startup because it hadn’t been initially started in the
background.
0 The devb-eide driver wasn’t started in the background and therefore forked
itself. The original process terminated with a zero exit status, the forked
process continued.
Caveats:
Unless overridden with the blk automount= option (see io-blk.so), devices are
mounted as:
While there’s no limit to the size of a disk or partition, I/O (i.e. the lseek(), read(), and
write() functions) is currently limited to 2 gigabytes per partition (or disk). This I/O
limit has no effect on the partition size for mounted filesystems.
Known supported functions include:
Note that certain calls (such as pipe(), as well as read() and write() on FIFOs) may
require the pipe manager.
See also:
cam-*, devb-*, fs-*, io-blk.so
Controlling How Neutrino Starts and Connecting Hardware chapters, and
“Filesystems and block I/O (devb-*) drivers” in the Fine-Tuning Your System
chapter of the QNX Neutrino User’s Guide
Syntax:
devb-fdc [cam option[,option]...]
[disk option[,option]...]
[fdc option[,option]...]
[blk option[,option]...] &
Runs on:
Neutrino
Targets:
x86
Options:
Use commas (,) to separate the options. You can put the cam, disk, fdc, and blk
groups of options in any order.
cam options
quiet Be quiet: don’t display any information on startup.
verbose Be verbose.
disk options
The disk options control the driver’s interface to cam-disk.so. If specified, they
must follow the disk keyword.
fdc options
The fdc options control the driver’s interface to the fdc controller. If you’ve installed
multiple controllers, you can repeat these options for each controller. Remember,
however, to specify the fdc keyword before each controller’s set of options.
blk options
The blk options control io-blk.so. If specified, they must follow the blk keyword.
Description:
The devb-fdc driver is for the floppy disk interface. It autodetects interfaces at
address 0x3f0, interrupt 6, dma channel 2 by default. If you have an interface at a
different address/interrupt/dma, specify them to the driver using the fdc options.
• The default cache size specified by io-blk.so is excessive for devb-fdc. You’ll
probably want to reduce it to something more reasonable:
devb-fdc blk cache=512k &
Examples:
Assume an FDC interface, and list all connected devices:
devb-fdc &
Mount a floppy drive that can access QNX or DOS floppy disks:
or:
Files:
The devb-fdc driver causes io-blk.so to adopt various block special devices under
/dev. These devices are normally named fdn, where n is the physical unit number of
the device.
This driver could also require the following shared objects:
Binary Required
cam-disk.so For floppy-disk access.
libcam.so Always
Exit status:
The devb-fdc driver terminates only if an error occurs during startup, or if it has
successfully forked itself upon startup because it hadn’t been initially started in the
background.
0 The devb-fdc driver wasn’t started in the background and therefore forked
itself. The original process terminated with a zero exit status, the forked
process continued.
Caveats:
While there’s no limit to the size of a disk or partition, I/O (i.e. the lseek(), read() and
write() functions) is currently limited to 2 gigabytes per partition (or disk). This I/O
limit has no effect on the partition size for mounted filesystems.
Known supported functions include:
Note that certain calls (such as pipe(), as well as read() and write() on FIFOs) may
require the pipe manager.
See also:
cam-*, devb-*, fdformat, fs-*, io-blk.so
Connecting Hardware chapter, and “Filesystems and block I/O (devb-*) drivers” in
the Fine-Tuning Your System chapter of the QNX Neutrino User’s Guide
Syntax:
devb-loopback [loopback loopback_option[,option]]
[blk option[,option]...] &
Runs on:
Neutrino
Options:
Use commas (,) to separate the options. You can put the blk and loopback groups
of options in any order.
loopback options
fd=path Specify a filename (a path registered by your resource manager) to
be presented as a block device by devb-loopback. This
pathname must support open(), close(), read(), write(), and fstat();
for more information, see “Driver support,” below.
Each pathname will result in the creation of a corresponding
block-special device (see prefix= below), the content of which
will be mirrored over the file descriptor using standard read/write
calls. You can then mount traditional block filesystems (such as
fs-dos.so and fs-qnx4.so) on top of these pseudo devices and
use them transparently.
You can specify multiple fd= pathnames; they’re managed by a
single devb-loopback process.
prefix=name The name by which the loopback pseudo block devices are
registered. The default is lo; thus each fd= entry named on the
command line will appear as /dev/lo0, /dev/lo1, and so on.
This is a global option, and applies to all fd= instances.
rw, ro Set the reading mode with which to open the underlying file
descriptor (corresponds to O_RDWR or O_RDONLY). If you
specify read-only, then in turn you can mount only read-only
filesystems onto the corresponding devb-loopback device (the
pseudo-device is advertised up as DEV_RDONLY). The default is
rw. This option applies to all subsequent instances of fd=.
sync, async Set the synchronous write mode with which to open the underlying
file descriptor (corresponds to O_SYNC). The effect of this
depends on the resource manager responsible for each file
(typically it’s ignored).
This option affects writes that are presented to the pseudo-device, and not the write
behavior of any mounted filesystems above this (that can be controlled via mount
options or blk delwri=... commit=...).
The default is sync.
denyno, denyrd, denywr, denyrw
The SH_DENY mode with which to open the underlying file
descriptor. A deny mode stops other processes from opening the
host file, thus preventing the content of it from being changed
behind the back of the devb-loopback filesystems, which will
prevent coherence issues. The default is denyrw. This option
applies to all subsequent instances of fd=.
seek, xtype Configure I/O onto the file descriptor using either an
LSEEK+READ combined message or via a
READ+XTYPE_OFFSET composite. By default,
devb-loopback probes the host filesystem as to whether it
supports the pread() and pwrite() API. The default is xtype. This
option applies to all subsequent instances of fd=.
blk options
The blk options are as for io-blk.so. If specified, they must follow the blk
keyword. For more information, see io-blk.so.
Since devb-loopback loads the standard block device DLLs, which will create a
buffer cache using the same default rules as for the disk filesystems, the cache is likely
to be too big for devb-loopback. You can reduce the cache size using blk
cache=size. Depending on the actual size of the device, and the level of caching
already implemented by its driver, a value of 128k may be sufficient.
Description:
The block filesystems in QNX Neutrino are implemented as a series of DLL modules
and a set of internal APIs. Thus it is possible to mount disk-based filesystems (such as
QNX or DOS) only onto released QNX devb-* drivers. The devb-loopback driver
implements a mapping between an arbitrary file descriptor and the block API,
allowing any resource manager to be used to host a disk filesystem.
Internal function calls, normally targeted at a SCSI/CAM driver, are translated into
standard read() and write() calls onto the host file descriptor, and are used to populate
the data content of a pseudo block device, which appears to the system as a disk.
Within this framework, any resource-manager or file-descriptor object can be viewed
as a block-special device and be mounted as a disk filesystem. For example, you can’t
normally directly use an ISO9660 image stored on a devf-* device, because devf-*
doesn’t load fs-*.so modules; by using devb-loopback to present this image file
as a block device, you can then mount it using fs-cd.so. For example:
devb-loopback fd=/devf/iso blk automount=lo0:/fs/iso:cd
devb-loopback
/devf/iso /dev/lo1
User io-blk.so
resource
manager
(e.g. devf-*) /fs/iso User
applications
fs-cd.so
Other uses might be to mount images from /dev/shmem, an image filesystem (IFS),
or over NFS.
The host file needs to be pregrown. For example, assuming that /fs/flash is a
mounted devf filesystem, you’d have to do the following setup first:
touch /fs/flash/q4.img
dinit -hq -S32m /fs/flash/q4.img
You could then use that file on flash as a read-write fs-qnx4.so filesystem:
devb-loopback blk cache=128k,auto=none loopback fd=/fs/flash/q4.img
mount -tqnx4 /dev/lo0 /q4flash
Using devb-loopback in this case adds functionality that a disk filesystem format
offers (access times, hard links, etc.) to the devf-* filesystem. In other cases,
devb-loopback lets you use the caching (e.g. names and sectors) that io-blk.so
supports, but that the resource manager underlying the host file might not.
Driver support
The resource manager(s) implementing the pathnames specified by fd= operands must
support the following standard interfaces:
open(), close() The device must be able to open and close a file descriptor to it.
The O_RDONLY and O_RDWR modes should be supported, as
should the SH_DENY share flags and O_SYNC modifier (if those
options are used from the devb-loopback command line); the
default libc iofunc open handler is suitable.
fstat() The device must support a stat method, which is used to
determine the size and geometry of the underlying device. The
default libc iofunc handler is suitable, provided there’s an
associated iofunc_mount_t which sets a suitable “blocksize”
(the default is 1 byte, which isn’t appropriate for use as a block
device; it must be one of 512, 1024, 2048, or 4096). See also
devctl() (below) and the loopback blksz= option (above).
read(), write() The device must support read and write callouts, which are used to
transfer “disk blocks” between the device and the filesystem buffer
cache. I/O is in units of the advertised block size and within the
bounds of the advertised device size. If the device supports the
_IO_XTYPE_OFFSET modifier (corresponding to pread() and
pwrite()), then that interface is used; otherwise a combined seek
plus normal read/write is made.
lseek() If _IO_XTYPE_OFFSET isn’t supported (above), then the device
must implement an lseek method. The default libc iofunc
callout is suitable.
devctl() The device may optionally implement the DCMD_CAM_DEVINFO
devctl() command (refer to the <sys/dcmd_cam.h> and
<sys/cam_device.h> header files). This allows the device to set
certain low-level fields to fine-tune emulation behavior. The
DCMD_ALL_GETFLAGS command is also used to probe the status
of a (removable) file descriptor. However, suitable defaults for both
these can be inferred from the fstat() query (above).
Mounting
You can mount the filesystem image via the loopback device (/dev/lo*) from the
command line with the mount command:
You can use umount to unmount the filesystem. The file descriptors to the underlying
host image files aren’t closed, and /dev/lo* remain present, until devb-loopback
is terminated.
See also:
cam-*, devb-*, fs-*, io-blk.so, mount, umount
close(), devctl() fstat(). open(), pread() pwrite() read(), stat() write() in the QNX
Neutrino Library Reference
Writing a Resource Manager
Syntax:
devb-mvSata [cam option[,option]...]
[mvSata option[,option]...]
[blk option[,option]...] &
Runs on:
QNX Neutrino
Options:
Use commas (,) to separate the options. You can put the cam, mvSata, and blk
groups of options in any order.
cam options
lun=mask Enable Logical Unit Number (LUN) scan for the devices specified in
mask. The mask is a hex bitmask specifying which IDs to scan for; the
default is 0x00.
mvSata options
The mvSata options control the driver’s interface to the mvSata controller. If you’ve
installed multiple controllers, you can repeat these options for each controller.
Remember, however, to specify the mvSata keyword before each controller’s set of
options.
Interface-specific options:
pci=index The PCI index of the controller in the machine, where index is
a value between 0 and the number of adapters.
priority=prio Set the priority of the processing thread. The default is 21.
timeout=timeout Set the I/O request timeout, in seconds. The default is 10.
cache_line=size Set the PCI cache line size (16, 32, 64, or 128 bytes). Default
pci config.
Device-specific options:
geometry=heads:cyl:sect
Specify the drive geometry.
blk options
The blk options control io-blk.so. If specified, they must follow the blk keyword.
Description:
The devb-mvSata driver is for Marvell 88SX50XX SATA interfaces. It supports
vendor ID 0x11ab with at least the following device IDs:
Device ID Chipset
5080 88SX5080
5081 88SX5081
5040 88SX5040
5041 88SX5041
6081 88SX6081
6041 88SX6041
Examples:
Detect all SATA controllers, and list all connected devices:
devb-mvSata &
Files:
The devb-mvSata driver causes io-blk.so to adopt various block special devices
under /dev. These devices are normally named hdn, where n is the physical unit
number of the device.
This driver could also require the following shared objects:
Binary Required
cam-disk.so For hard-disk access.
libcam.so Always
Exit status:
The devb-mvSata driver terminates only if an error occurs during startup, or if it has
successfully forked itself upon startup because it hadn’t been initially started in the
background.
Caveats:
Unless overridden with the blk automount= option (see io-blk.so), devices are
mounted as:
While there’s no limit to the size of a disk or partition, I/O (i.e. the lseek(), read() and
write() functions) is currently limited to 2 gigabytes per partition (or disk). This I/O
limit has no effect on the partition size for mounted filesystems.
Known supported functions include:
Note that certain calls (such as pipe(), as well as read() and write() on FIFOs) may
require the pipe manager.
See also:
cam-*, devb-*, fs-*, io-blk.so
“Filesystems and block I/O (devb-*) drivers” in the Fine-Tuning Your System
chapter of the QNX Neutrino User’s Guide
Syntax:
devb-ram [cam option[,option]...]
[disk option[,option]...]
[ram option[,option]...]
[blk option[,option]...] &
Runs on:
Neutrino
Options:
Use commas (,) to separate the options. You can put the cam, disk, ram, and blk
groups of options in any order.
cam options
quiet Be quiet: don’t display any information on startup.
verbose Be verbose.
disk options
The disk options control the driver’s interface to cam-disk.so. If specified, they
must follow the disk keyword. For more information, see cam-disk.so.
ram options
The ram options control the driver’s interface to RAM:
capacity=blocks Specify the capacity of the RAM drive in the blocks of the size
specified by the blksize option. The default is 4096 blocks (2
MB).
blk options
The blk options control io-blk.so. These options must follow the blk keyword
and must be specified after any general or disk options. For more information, see
io-blk.so.
Description:
The devb-ram driver creates a RAM disk interface. When the capacity option isn’t
specified, devb-ram creates a 2 MB RAM disk.
By default, devb-ram partitions the RAM disk, leaving one block for the partition
table itself, and making the remainder of the RAM disk (capacity minus 1) a t77
partition, which it then initializes (internally, not by spawning dinit) to have a blank
fs-qnx4.so filesystem on it. If you specify the nodinit option, you can later
manually format it, optionally partition the RAM disk with fdisk (but you can make
the whole thing a filesystem), and then mount it.
By default, io-blk.so allocates 15% of system RAM for cache. The devb-ram
system looks like a disk drive to io-blk.so, so it doesn’t know that the cache is
unnecessary. You should use the blk cache=512k option to reduce the cache size to
the minimum.
Because devb-ram is a block device which reads from and writes to RAM, its
operations go through a lot of layers before they actually get to RAM. For a RAM disk
with better performance, use the blk ramdisk=... option to io-blk.so. For more
information, see “RAM disks” in the Connecting Hardware chapter of the QNX
Neutrino User’s Guide.
Examples:
Create a 4 MB RAM drive:
Files:
The devb-ram driver causes io-blk.so to adopt various block special devices under
/dev. These devices are normally named hdn, where n is the physical unit number of
the device.
This driver could also require the following shared objects:
Binary Required
cam-disk.so For RAM disk access.
libcam.so Always
Exit status:
The devb-ram driver terminates only if an error occurs during startup, or if it has
successfully forked itself upon startup because it hadn’t been initially started in the
background.
0 The devb-ram driver wasn’t started in the background and therefore forked
itself. The original process terminated with a zero exit status, the forked
process continued.
Caveats:
While there’s no limit to the size of a disk or partition, I/O (i.e. the lseek(), read() and
write() functions) is currently limited to 2 gigabytes per partition (or disk). This I/O
limit has no effect on the partition size for mounted filesystems.
Known supported functions include:
Note that certain calls (such as pipe(), as well as read() and write() on FIFOs) may
require the pipe manager.
See also:
cam-*, devb-*, dinit, fdisk, fs-*, io-blk.so
“RAM disks” in the Connecting Hardware chapter, and “Filesystems and block I/O
(devb-*) drivers” in the Fine-Tuning Your System chapter of the QNX Neutrino
User’s Guide
In order to start this driver, you must be logged in as root, and the USB stack
(io-usb) needs to be running.
Syntax:
devb-umass [blk option[,option]...]
[cam option[,option]...]
[umass options[,option]...]
Runs on:
Neutrino
Options:
Use commas (,) to separate the options. You can put the blk, cam, and umass groups
of options in any order.
cam options
quiet Be quiet: don’t display any information on startup.
verbose Be verbose: display full information about units (devices) on startup.
pnp Enable CAM plug and play (i.e. don’t exit at startup when no devices
are found). The default is off.
umass options
The umass options control the driver’s interface to the USB device. If you’ve installed
multiple devices, you can repeat these options for each device. Remember, however, to
specify the umass keyword before each controller’s set of options.
wait=num Wait num of seconds for the USB stack. The default is 60
seconds.
vid=vid The vendor ID of the device.
did=did The device ID of the device.
busno=bus The bus number of the USB controller.
devno=dev The USB address of the device.
iface=if The particular interface number of the device.
priority=prio Set the priority of the processing thread. The default is 21.
ignore_csw Ignore the Command Status Wrapper. Some devices return
invalid data for the CSW.
blk options
The blk options control io-blk.so. If specified, they must follow the blk keyword.
For more information, see io-blk.so.
Description:
The devb-umass driver is the driver for a USB mass storage interface.
Examples:
Assume a USB controller, and list all connected devices:
devb-umass &
See also:
cam-*, devb-*, enum-usb, fs-*, io-blk.so, io-usb
Connecting Hardware chapter, and “Filesystems and block I/O (devb-*) drivers” in
the Fine-Tuning Your System chapter of the QNX Neutrino User’s Guide
Syntax:
devc-con [options] &
Runs on:
Neutrino
Targets:
x86
Options:
-C size Specify the size of the canonical buffer in bytes (default 256).
-I size Specify the size of the interrupt input buffer in bytes (default
2048).
-L [P][N][C][S] Set the initial state of the keyboard and its LEDs (default all off):
• C — turn CapsLock on.
• P — preserve the keyboard state. This overrides all the other
-L options.
• N — turn NumLock on.
• S — turn ScrollLock on.
-O size Specify the size of the interrupt output buffer in bytes (default
2048).
-r rate[,delay] Specify the initial keyboard typematic rate (in Hz) and, optionally,
the initial keyboard delay (in ms). The default values are 30 Hz
and 500 ms.
The keyboard typematic rate is the number of times per second
that a depressed key repeats. On a PC/AT-compatible system, this
ranges from 2 - 30 characters per second. If the option -r 0 is
specified, the keyboard typematic rate isn’t set by the driver.
The keyboard delay is defined as the time from when a key is first
pressed to when the start of the first repeated key is generated. On
a PC/AT-compatible system, the keyboard delay can range from
250 - 1000 milliseconds.
Description:
The devc-con manager provides an interface to the VGA console screen and
keyboard. It’s usually started as a system startup procedure (see diskboot).
When devc-con starts, it creates and manages the devices /dev/con1, /dev/con2,
and so on, up to the number of ports specified by the -n option.
The devc-con-hid manager is similar to devc-con, but works in conjunction with
io-hid and supports PS2, USB, and all other human-interface devices.
The devc-con-hid manager was added in QNX Momentics 6.3.0 Service Pack 3;
diskboot starts it instead of devc-con.
If you read from /dev/console, these managers return the characters typed on the
keyboard; if you write to /dev/console, the managers write to the screen.
If your application uses /dev/console, you should create a link from it to one of
/dev/con1, /dev/con2, . . . by adding a line like this to the buildfile used by mkifs:
The devc-con and devc-con-hid managers all emulate an 80×25 ANSI terminal.
Keyboard control
You can use the keyboard to switch between virtual consoles.
Each virtual console can run different applications that use the entire screen. The
keyboard is attached to the virtual console that’s currently visible. You can switch
from one virtual console to another — and thus from one application to another — by
entering the following keychords:
The + (plus) and - (minus) keys used in the console-switching keychords are those
found on the numeric keypad.
You can also jump to a specific console by using the Ctrl-Alt-n, where n is a numeric
digit that represents the console number of a virtual console. For instance:
Character sets
The devc-con and devc-con-hid managers let you choose the character sets in use
from a “palette” of character sets, each of which is independently programmable to
contain one of several builtin character sets.
The in-use range of characters is divided into four regions which span character
numbers (in hexadecimal) 0x00 through 0xff. Two of these regions are fixed sets of
control characters, while the other two are configurable to contain a choice of
character sets:
You can set each of the GL and GR in-use character sets to a choice of several
character sets from the G0, G1, G2 and G3 character sets.
The screen control codes to set GL and GR are as follows:
The {LS*} codes stand for “Locking Shift”. When character sets are selected by these
means, they remain in effect until another {LS*} code is sent.
The {SS*} codes stand for “Single Shift” and affect the next character only. After that
character, the character set in effect reverts to its previous setting. There are only two
{SS*} codes, {SS2} and {SS3} which maps G2 into GL and G3 into GL, respectively.
The G0 through G3 characters sets may each be set to any of the available builtin fonts.
The control code to do this is:
ESC g s
Where:
g: Sets:
( G0
) G1
* G2
+ G3
And:
s: Specifies:
B ASCII
0 Special (DEC Graphic)
< ISO-Latin1 Supplemental
U PC Character Set
Set the GL in-service character set (0x20-0x7f) to the PC character set through G1,
write some characters, then switch GL back to G0:
C0 control codes
continued. . .
You can do any 8-bit C1 code with 7-bit ESC followed by the 8-bit code minus 0x40
hex. For instance, you can represent the CSI (control sequence introducer) in 8-bit
mode as 0x9b, while in 7-bit mode you must express it as ESC [ (0x1b 0x5b).
continued. . .
In 7-bit mode, CSI is ESC [. In 8-bit mode, CSI is (hex)0x9B. Use the ANSI
specification to represent the variable n, e.g. to print two spaces:
printf( "%c%c", 0x9b, 0x32 ) ;
continued. . .
continued. . .
Graphic rendition
Number Meaning
0 All attributes off (except charset (10, 11, 12))
1 Bold
2 Half intensity (default to cyan on color screen)
4 Underline (default to red on color screen)
5 Blink
7 Reverse
9 Invisible
10 Exit alternate char set (GR & GL are restored)
11 Enter PC-lower char set (GR & GL are ASCII; C0 & C1 are PC_LO
except for ESC)
12 Enter PC-higher char set (GR, C1 & GL, C0 are PC_HI except for ESC)
21 Normal intensity (un-Bold)
22 Normal intensity (un-Half intensity)
continued. . .
Number Meaning
24 Disable underline
25 Disable blink
27 Disable reverse
29 Visible
30-37 Set foreground color (30+color_number, see below)
39 Set foreground to saved
40-47 Set background color (40+color_number, see below)
49 Set background to saved
Color numbers
color_number Description
0 Black
1 Red
2 Green
3 Brown
4 Blue
5 Violet
6 Cyan
7 White
Modes
continued. . .
continued. . .
continued. . .
This, like all other key combinations, is subject to configuration! However, it isn’t
possible to redefine compose sequences.
The keyboard-layout file’s structure is very simple and rigid. It must contain either
exactly 5 × 96 or exactly 6 × 96 hexadecimal entries, separated by whitespace,
newlines, or commas:
• If the file contains 5 × 96 entries, the left and right Alt keys are both treated as
regular Alt keys.
• If the file has 6 × 96 entries, the right Alt key is treated as an AltGr key, and the last
96 entries must define key codes for each key with AltGr pressed.
Entries must be no longer than 4 hex digits (16 bits) each. Comments start with a
number sign (#) and extend to the end of the line.
Each run of 96 entries defines the semantics of up to 96 different keys under certain
conditions:
The 96 entries in a run are indexed by keyboard scan codes. You’ll need to know those
scan codes in order to make up your own keyboard definition. Given below is the
scancode/symbol-mapping for a US-101 keyboard:
0 1 2 3 4 5 6 7 8 9 A B C D E F
, Esc, ’1’, ’2’, ’3’, ’4’, ’5’, ’6’ ’7’, ’8’, ’9’, ’0’, ’-’, ’=’, Rub, Tab ; 00
’q’, ’w’, ’e’, ’r’, ’t’, ’y’, ’u’, ’i’ ’o’, ’p’, ’[’, ’]’, Ent, Ctl, ’a’, ’s’ ; 10
’d’, ’f’, ’g’, ’h’, ’j’, ’k’, ’l’, ’;’ ’’’, ’’, Shf, ’\’, ’z’, ’x’, ’c’, ’v’ ; 20
’b’, ’n’, ’m’, ’,’, ’.’, ’/’, Rsh, ’*’ Alt, SP, Cap, F1, F2, F3, F4, F5 ; 30
F6, F7, F8, F9, F10, Num, Scr, Hom Up, PgU, K-, Lft, K5, Rig, K+, End ; 40
Dwn, PgD, Ins, Del, , , , F11 F12, , , , , , , ; 50
For every scan code, two bytes of data are given by the entries. The high byte defines a
number of flags for the key (see below), while the low byte usually carries the actual
data to be given to the user when the key is pressed. For Shift, Lock, and special keys,
the low byte carries additional, function-dependent information (see below).
The entries’ high bits are as follows:
• 00 — Data key
• 01 — Function key
• 02 — Shift key:
- 0201 — Shift
- 0202 — Ctrl
- 0204 — Alt
- 0208 — Rshift
• 04 — NumLock-dependent
• 08 — Lock key:
- 0801 — ScrollLock
- 0802 — NumLock
- 0804 — CapsLock
• 10 — Dead key
• 20 — CapsLock-dependent
• 40 — Special:
- 4001 — reboot (Ctrl-Alt-Del)
- 4002 — debug (Ctrl-Alt-Esc)
- 4003 — next console (Ctrl-Alt-+ or Ctrl-Alt-Enter)
- 4004 — previous console (Ctrl-Alt--)
- 4005 — console 1 (Ctrl-Alt-1)
- 4006 — console 2 (Ctrl-Alt-2)
...
- 400C — console 8 (Ctrl-Alt-8)
- 400D — console 9 (Ctrl-Alt-9)
- 400E — console 10 (Ctrl-Alt-0)
- 400F — increase font size (Ctrl-Alt->)
- 4010 — decrease font size (Ctrl-Alt-<)
- 4011 — help (Ctrl-Alt-?)
- 4012 — break (Ctrl-Break)
- 4013 — hang up (Ctrl-Alt-End)
- 4020 — print screen (Ctrl-Alt-PrtScn)
- 4021 — hot1 (Ctrl-Alt-F1)
- 4022 — hot2 (Ctrl-Alt-F2)
...
- 402B — reload (Ctrl-Alt-Space)
• 80 — invalid key
Examples:
Typical command line:
devc-con -n4
Files:
/dev/con1, /dev/con2, . . .
Console port devices.
Errors:
If an error occurs, the keyboard doesn’t work in text mode.
See also:
devc-*, io-hid, mkkbd
Using the Command Line and Controlling How Neutrino Starts in the Neutrino User’s
Guide
Syntax:
devc-par [options] &
Runs on:
Neutrino
Targets:
x86
Options:
-b port Which BIOS port to use (1-4). Don’t use this option with the -p
option.
-p address Base I/O address of the parallel port. The I/O port address may be
specified in hexadecimal form (e.g. 0x140) or octal form (e.g. 0140)
as well as in decimal. Don’t use this option with the -b option.
-N name Register the parallel devices using name as the name (defaults to
par, giving /dev/par).
-P priority Priority of the writer agent task. Because the writer agent polls the
parallel ports, it should run at a lower priority than most other tasks.
The default priority is 9.
Description:
The devc-par manager is a parallel port manager for QNX Neutrino. It can support
up to 4 parallel ports.
The devc-par driver polls the hardware to detect if a character has been sent.
If you don’t specify any ports (using the -p or -b options), devc-par tries to
interrogate the BIOS area to determine the number of parallel ports detected by the
BIOS. If no ports are found, devc-par silently exits.
You can use the -p option to override the use of the BIOS data area (at 0040:0008).
The only translation of output is the mapping of a newline character to a CR/LF if the
OPOST flag is set.
Reading from devc-par works the same as reading from /dev/null.
Examples:
Start devc-par, defaulting for all parallel ports found by the BIOS:
devc-par &
Or:
devc-par -b 1 &
See also:
Connecting Hardware in the Neutrino User’s Guide
Syntax:
devc-pty [options] &
Runs on:
Neutrino
Options:
-C size Specify the size of the canonical buffer in bytes (default 256).
Description:
The devc-pty manager is a small pseudo-tty manager for QNX Neutrino. It can
support up to 256 ptys, using the naming scheme:
The master and slave device pair share the same letter and hexadecimal digit.
Examples:
Start devc-pty with 32 ptys:
devc-pty -n 32 &
Syntax:
devc-ser8250 [[options]
[port[ˆshift][,intr]]]... &
Runs on:
Neutrino
Targets:
x86, PowerPC, and MIPS hardware with an 8250-compatible UART
Options:
The options are position-dependent and affect the subsequent ports.
-c clock[/divisor] Define a custom clock rate, in hertz, and divisor for the serial
port. The default (-c 1843200/16) is suitable for compatible
PC serial ports.
-I number The size of the interrupt input buffer in bytes (default 2048).
-O number The size of the interrupt output buffer in bytes (default 2048).
-T number Enable the transmit FIFO and set the number of characters to
be transmitted at each TX interrupt to 1, 4, 8, or 14. The
default is 0 (FIFO disabled).
port The hex I/O address (for x86 systems) or the physical memory
address (for PowerPC and MIPS) of a serial port.
intr The interrupt used by this port; specified in hex if prefixed with
0x, otherwise it’s decimal.
Description:
The devc-ser8250 manager is a small serial device manager for QNX Neutrino. It
can support any number of serial ports using 8250s, 14450s or 16550s. Each device
can be assigned its own interrupt, or share an interrupt if the hardware supports
interrupt sharing. If you don’t specify any I/O ports for devices on an x86 system,
devc-ser8250 assumes you want to use the standard PC ports of COM1 (3f8,4) and
COM2 (2f8,3).
The serial driver’s priority floats to the priority of the client. All internal events are
processed at priority 24 (inherited from the internal pulse). The event handling priority
is hard coded and isn’t configurable by any of the options listed. (The driver’s main.c
program would need modification in order to change the priority).
When the driver talks to a client application, it’s running at the priority of the client.
All other processing takes place either at priority 24r or at interrupt time.
Each device is given a name in the pathname space of /dev/sern, where n starts at 1
(unless changed via the -u option) and increases. If you use the default PC serial
ports, this results in:
If your application uses /dev/console, you should create a link from it to one of
/dev/ser1, /dev/ser2, . . . by adding a line like this to the buildfile used by mkifs:
All devices are fully interrupt driven and by default support standard hardware flow
control on input and output (RTS/CTS). This can be disabled by the -F option.
Min Return when this number of characters are in the input buffer.
If the Min value is greater than the size of the input buffer, the Min value is clipped to
the size of the buffer. To avoid this, the size of the input buffer can be changed with
the -I option.
These parameters are set using library routines (see tcgetattr(), tcsetattr(), readcond()
and TimerTimeout() in the Library Reference).
The devc-ser8250 manager supports both raw and edited modes, making it a real tty
device.
The following fields and flags are supported in the termios structure:
Examples:
Start devc-ser8250, defaulting for COM1 and COM2:
devc-ser8250 &
Start devc-ser8250, defaulting for COM1 and COM2, but change baud rate to
38400 from 57600 default:
Start devc-ser8250 with five ports (the last four preset to 38400 baud):
You can specify multiple -F and -f options; they’re position-dependent, and affect the
next serial port:
See also:
devc-*
Connecting Hardware in the Neutrino User’s Guide
Syntax:
devc-serpci [vid=vid,did=did[,pci=pci]] [options] &
Runs on:
Neutrino
Targets:
x86
Options:
-b number The initial baud rate (default 57600).
-C size The size of the canonical buffer in bytes (default 256).
-c clock[/divisor] Define a custom clock rate, in hertz, and divisor for the serial
port. The default (-c 1843200/16) is suitable for compatible
PC serial ports.
did=did The PCI device ID, in hexadecimal (0xXXXX).
-E Set options to “raw” (default).
-e Start in edited mode (default raw). Software flow control is
enabled by default.
-F Disable hardware flow control (default to hardware flow
control enabled). Hardware flow control is not supported in
edited mode.
-f Enable hardware flow control (default). Hardware flow control
is not supported in edited mode.
-I number The size of the raw input buffer in bytes (default 2048).
-O number (“Oh”) The size of the interrupt output buffer in bytes (default
2048).
pci=pci The PCI index, in decimal (XX).
-S|s Disable / enable software flow control. The default depends on
the mode: in raw mode (-E, the default), it’s disabled; in edited
mode (-e), it’s enabled.
The order in which you specify the -E or -e, and -S or -s
options matters:
-v Increase verbosity.
Description:
The devc-serpci manager is a small serial device manager for QNX Neutrino. This
driver supports 16Cxxx compatible Serial PCI cards.
The boards must use PCI I/O space for the registers, and the ports must be contiguous
in memory.
See also:
devc-serusb
Syntax:
devc-serusb [options]
Runs on:
Neutrino
Targets:
ARMLE, MIPSLE, PPCBE, SHLE, x86
Options:
-b number The initial baud rate (default 57600).
-I number The size of the raw input buffer in bytes (default 2048).
-O number (“Oh”) The size of the interrupt output buffer in bytes (default
2048).
The device-specific options that you can specify with the -d option are:
pindex=idx Set the port that the index options are to be applied to.
wait=num Wait num seconds for the USB stack. Default is 60 seconds.
Description:
The devc-serusb is a driver for USB-to-serial adaptors.
If you provide the vid, did, busno and devno arguments for device-specific options,
devc-serusb does not attach an insertion callback to detect newly inserted devices.
The driver will work only with the already-inserted device that corresponds to the
arguments specified on the command line. If you do not also specify the ign_remove
option, the driver is terminated when the device is removed.
The unit option has meaning only when the driver is started for a specific device by
using the vid, did, busno and devno arguments. If the driver is managing device
insertions, the default behavior always applies.
Because devc-serusb is a USB class driver, the USB stack (io-usb) must be
running before you start this driver.
See also:
devc-serpci, io-usb
Syntax:
devc-serzscc [[options]
[port[ˆshift][+offset][,intr]]]... &
Runs on:
Neutrino
Targets:
PPCBE, x86
Options:
The options are position-dependent and affect the subsequent ports.
-c clock[/divisor] Define a custom clock rate, in hertz, and divisor for the serial
port. The default is suitable for compatible serial ports.
-I number The size of the interrupt input buffer in bytes (default 2048).
-O number The size of the interrupt output buffer in bytes (default 2048).
Description:
The devc-serzscc manager is a small serial device manager for QNX Neutrino. It
supports the Zilog SCC chip.
All devices are fully interrupt driven and by default support standard hardware flow
control on input and output (RTS/CTS). This can be disabled by the -F option.
If your application uses /dev/console, you should create a link from it to one of
/dev/ser1, /dev/ser2, . . . by adding a line like this to the buildfile used by mkifs:
Min Return when this number of characters are in the input buffer.
If the Min value is greater than the size of the input buffer, the Min value is clipped to
the size of the buffer. To avoid this, the size of the input buffer can be changed with
the -I option.
These parameters are set using library routines (see tcgetattr(), tcsetattr(), readcond()
and TimerTimeout() in the Library Reference).
The devc-serzscc manager supports both raw and edited modes, making it a real tty
device.
The following fields and flags are supported in the termios structure:
Examples:
Start devc-serzscc in edited mode, specifying the clock rate, baud rate, and
inter-register access delay:
See also:
devc-*
Syntax:
devf-generic
[-a] [-b priority] [-d log_method] [-E] [-e auto]
[-f verifylevel] [-i arrayindex[,partindex]]
[-l] [-m mountover
[-p backgroundpercent[,superlimit]] [-R] [-r]
[-s base[,wsize[,aoffset[,asize[,usize[,bwidth[,ileave]]]]]]]
[-t threads] [-u update] [-V] [-v]
[-w buffersize]
Runs on:
Neutrino
Targets:
Most flash devices
Options:
-a Don’t automount filesystem partitions present on the media. If
you specify both the -a and -R options, the driver ignores the -R
option.
-d log_method Control the logging from the flash driver. The possible values for
log_method are:
• 0 — log to stdout (the default).
• 1 — log to slogger.
• 2 — log to both stdout and slogger.
-e auto Only enumerate the flash partitions, instead of doing a full scan
and mount. The flash driver automounts all partitions with a
partition number less than or equal to auto.
For example, assume we have a flash layout as follows:
• /dev/fs0p0 — raw
• /dev/fs0p1 — formatted
• /dev/fs0p2 — formatted
• /dev/fs0p3 — formatted
If you start the driver with -e 1, the driver creates all the raw
entries in /dev, but mounts only /dev/fs0p1 (/dev/fs0p0 is
raw, so it’s never mounted, regardless of the -e option)
-i arrayindex[,partindex]
Starting socket index and first partition index; 0 ≥ index ≥15. The
default is 0,0. Use this to give multiple drivers unique IDs. The -i
option is just a suggestion for the resource database manager; the
selected indexes can be larger.
-m mountover Override the mountpoints assigned to the file system that are
formatted with an empty (i.e. flashctl -p/dev/fs0p0 -f
-n "") mountpoint. The mountover argument can include two %X
format specifiers (like those for printf()) that are replaced by the
socket index and the partition index.
-p backgroundpercent[,superlimit]
Set the background-reclaim percentage trigger (stale space over
free space) and, optionally, the superseded extent limit before
reclaim. The default is 100,16.
You should always specify the -r option unless you’re trying to debug an issue
concerning flash corruption.
If you don’t specify -r, and a power failure occurs, the following
can happen:
• You can waste space. If an erasure was happening when the
power was cut off, there will be some “dangling” extents (i.e.
marked for deletion, but not actually deleted). If you specify
the -vv option, the driver prints dangle for every dangling
extent found. These extents will continue to occupy space
You can specify the base physical address, sizes, and offset in
octal (1000), hexadecimal (0x200), or decimal (512). The sizes
must be a power of two, and you can specify them with any of the
following suffixes:
• (nothing) — bytes
• k — kilobytes
• m — megabytes
-u update Specify the update level for timestamps. POSIX specifies that
timestamps be kept when you access, create, or modify a file.
FFSv3 is documented as not supporting the access timestamp, in
order to reduce wear on the hardware.
The values for update are:
• 0 — don’t update the modification time for files (the default).
• 1 — update the modification time for files according to the
POSIX rules.
• 2 — update the modification time for files, as well as for the
parent directory.
The -u2 option is very, very expensive and will cause many reclaims because the time
updates have to flow right up to the root directory, so one file update may cause many
directory updates.
-w buffersize Write (append) buffer size in bytes. The default buffersize is 512.
Using a larger write-buffer prevents the creation of very small
extents, reducing overhead. If buffersize is 0, appending is
disabled.
Description:
The devf-generic manager provides Flash filesystem support for any standard flash
device. Typically, all you need to do is to pass the address and size using the -s
option. The manager should detect the device automatically.
For information on creating a custom variant of devf-generic for your embedded
system, see the Customizing the Flash Filesystem chapter of Building Embedded
Systems
The default filenames are as follows (you can use the -i option to change the ID, n,
appended to /dev/fs):
You can specify the mountpoint above with the mount attribute of the mkefs
command, and override it with the -n option to flashctl. By default, it’s /fsnp0.
If you erase a raw partition or the raw array (socket), you might erase any boot
monitor, BIOS, or other data installed by the manufacturer. Check the documentation
for the board.
The driver probes the hardware to determine its block size. If you need to know the
block size, you can:
• Start the driver in verbose mode by specifying the -v option. In the output, U:
indicates the number of units (also known as blocks or sectors), and S: indicates
the block size. Both numbers are in hexadecimal.
Or:
• Start the driver, and then run flashctl, specifying the -i option.
Verbose output
If you specify the -v option, a devf-* driver provides some useful information. This
section describes the output that you get if you specify -vvv; at higher levels of
verbosity, the output also includes messages about the use of malloc() and free(), but
these aren’t likely to be useful to you.
The output starts with something like this:
These lines identify the source branch of the build, as well as the build times for
libfs-flash3.a and libmtd-flash.a.
The rest of the messages that the driver prints are variable; messages are printed as the
driver discovers things of interest. The general format of a message is
(devf tN ::function:line) Message string
where tN is the thread printing the message, function is the function emitting the
message, and line is the line number that emitted the message.
The standard messages include the following:
Examples:
Start devf-generic and automatically mount the flash filesystem partitions at the
base address 0xFF000 with a window size of 16 megabytes, with an initial fault
recovery process, most POSIX semantics enabled and background reclaim at priority
5:
devf-generic -s0,32m,,,64k -v -r
Create a 128 MB flash partition, with large block sizes (to speed formatting):
devf-generic -s0,128m,,,512k -v -r
Create a 4 MB partition:
devf-generic -s0,4m,,,64k -v -r
Create a 16 MB flash partition, from a given physical address, with a 128 KB unit size,
and a 16-bit wide data bus:
devf-generic -s0xa4000000,16m,,,128k,2 -v -r
Create a 16 MB flash partition, from a given physical address, with a 256 KB unit size,
and a 32-bit-wide data bus, with an interleave of two:
devf-generic -s0,16m,,,256k,4,2 -v -r
Caveats:
You must specify the -s option when using this driver.
Although the Flash filesystem supports most POSIX semantics, some functionality
isn’t implemented in order to keep the driver simple and efficient. The unsupported
POSIX semantics include:
• Hard links, and everything related to hard links (the . and .. directories don’t
exist, struct stat’s nlink member is hard-coded, and unlink() of directories
returns ENOTSUP).
• Access times aren’t updated on the media; they’re set to the modification time.
See also:
deflate, devf-ram, flashctl, inflator, mkefs
“Flash filesystems” in the Working With Filesystems chapter of the User’s Guide
Customizing the Flash Filesystem chapter of Building Embedded Systems
Syntax:
devf-ram
[-a] [-b priority]
[-E] [-f verifylevel] [-i arrayindex[,partindex]]
[-l] [-m mountover]
[-p backgroundpercent[,superlimit]] [-R] [-r]
[-s base[,wsize[,aoffset[,asize[,usize[,bwidth[,ileave]]]]]]]
[-t threads] [-u update] [-V] [-v]
[-w buffersize]
Runs on:
Neutrino
Targets:
MIPS, PowerPC, x86, SH, and ARM
Options:
-a Don’t automount filesystem partitions present on the media. If you
specify both the -a and -R options, the driver ignores the -R
option.
-f verifylevel Simulate flash verify; only provided for syntax compatibility with
real flash hardware (default=0, 0=none, write=1, erase=2, all=3).
-i arrayindex[,partindex]
Starting socket index and first partition index; 0 ≥ index ≥15. The
default is 0,0. Use this to give multiple drivers unique IDs. The -i
option is just a suggestion for the resource database manager; the
selected indexes can be larger.
-p backgroundpercent[,superlimit]
Set the background-reclaim percentage trigger (stale space over
free space) and, optionally, the superseded extent limit before
reclaim. The default is 100,16.
You should always specify the -r option unless you’re trying to debug an issue
concerning flash corruption.
If you don’t specify -r, and a power failure occurs, the following
can happen:
• You can waste space. If an erasure was happening when the
power was cut off, there will be some “dangling” extents (i.e.
marked for deletion, but not actually deleted). If you specify the
-vv option, the driver prints dangle for every dangling extent
found. These extents will continue to occupy space forever,
until they’re deleted. Using the -r option will cause them to be
reclaimed.
• The system may be marked as read-only. If the driver detects an
error in the structure of the filesystem, and you haven’t specified
the -r option, the driver marks the partition as read-only, so that
it can’t be further damaged.
• If a reclaim operation is interrupted by a power loss, the spare
block may be unusable. In this case, if you specify the -vv
option, the driver prints partial to the console. The partition
is still read-write, but reclaims are turned off; if you continue to
overwrite files, you’ll eventually fill the filesystem with stale
data.
-s base[,wsize[,aoffset[,asize[,usize[,bwidth[,ileave]]]]]]
Set socket options, normally the base physical address, window
size, array offset, array size, unit size, bus width, and interleave.
The format is left flexible for socket services with customized
drivers.
The arguments are:
For the devf-ram utility, the base argument carries a special meaning:
0 Allocate system memory.
Nonzero Use the exact physical address. You must
exercise caution here. See the caveats below.
wsize Size of the physically contiguous flash part.
aoffset For SRAM, the offset from the base address to the start of
the flash array.
asize For SRAM, the size of the flash array. The default is
equal to wsize.
usize The size of a physical erase sector. For SRAM, this
number can be any power of two. 64 KB should be the
minimum, for performance reasons.
bwidth The total width of the data bus, as seen from the
microprocessor’s perspective. This is the width of one
simulated flash chip multiplied by the interleave. This
value must be a power of 2 (1, 2, 4, or 8).
ileave The number of simulated flash chips arranged on the data
bus. This value must be a power of 2 (1, 2, 4, or 8).
You can specify the base physical address, sizes, and offset in octal
(0777), hexadecimal (0x1ff), or decimal (511). The sizes must
be a power of two, and you can specify them with any of the
following suffixes:
• (nothing) — bytes
• k — kilobytes
• m — megabytes
On ARM targets, devf-ram can’t resize the shared object /dev/shmem/fs*. If you
need to restart devf-ram with a new size, first unlink the old shared object:
rm /dev/shmem/fs*
-t threads The number of threads. The minimum is 1, the default is 2, and the
maximum is 100. Extra threads increase performance when
background reclaiming is enabled (with the -b option) and when
multiple chips and/or spare blocks are available.
-u update Specify the update level for timestamps. POSIX specifies that
timestamps be kept when you access, create, or modify a file.
FFSv3 is documented as not supporting the access timestamp, in
order to reduce wear on the hardware.
The -u2 option is very, very expensive and will cause many reclaims because the time
updates have to flow right up to the root directory, so one file update may cause many
directory updates.
-w buffersize Write (append) buffer size in bytes. The default buffersize is 512.
Using a larger write-buffer prevents the creation of very small
extents, reducing overhead. If buffersize is 0, appending is
disabled.
Description:
The devf-ram manager simulates flash filesystem in RAM using the following
default filenames (the ID, n, appended to /dev/fs can be changed via the -i option):
You can specify the mountpoint above with the mount attribute of the mkefs
command, and override it with the -n option to flashctl. By default, it’s /fsnp0.
Examples:
Start devf-ram with a 16 MB partition.
devf-ram -s0,16m
Start devf-ram and automatically mount the flash filesystem partitions, with an initial
fault recovery process, most POSIX semantics enabled and background reclaim at
priority 5 (default size: 1 MB):
You must format and erase a devf-ram partition before you can mount the flash
filesystem. See the caveats below.
If you specify a block size in your buildfile for DRAM-based flash filesystems, limit
the size to the default, which is 64 KB.
Caveats:
Although the flash filesystem supports most POSIX semantics, some functionality
isn’t implemented in order to keep the driver simple and efficient. The unsupported
POSIX semantics include:
• Hard links, and everything related to hard links (the . and .. directories don’t
exist, struct stat’s nlink member is hard-coded, and unlink() of directories
returns ENOTSUP).
• Access times aren’t updated on the media; they’re set to the modification time.
devf-ram -s0,16m
flashctl -p /dev/fs0p0 -e -f -m
If there’s insufficient RAM, when you try to create an nM size partition with -s0
option, the devf-ram driver returns without an error message. The partition isn’t
created.
See also:
deflate, devf-generic, flashctl, inflator, mkefs
“Flash filesystems” in the Working With Filesystems chapter of the User’s Guide
Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]
Runs on:
Neutrino
Targets:
x86, PowerPC, MIPS
Options:
For the io-display options that you can use with this driver, see io-display.
Description:
The devg-ati_rage128.so driver provides accelerated 2D support for the specified
graphics chipsets.
Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.
Supported chipsets
• ATI RAGE 128 GL
Acceleration features
Feature Provision
Solid fills Yes
Pattern fills Yes
Onscreen blitting Yes
continued. . .
Feature Provision
Offscreen blitting Yes
Chroma-keyed blitting Yes
Alpha blending No
Raster OPs Full
Bitmaps No
Other features
Feature Provision
Hardware Cursor Yes
TV Out No
Video capture No
DPMS (power saving) Yes
continued. . .
Display size (pixels): Refresh rate (Hz): Color depth (bits per pixel):
1600x1200 60, 70, 75, 85 8, 15, 16, 32
Files:
This driver needs the following at run time:
See also:
io-display
Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]
Runs on:
Neutrino
Targets:
SHLE, x86, PowerPC
Options:
For the general io-display options that you can use with this driver, see
io-display.
You can set configuration options that are specific to this driver by using the
modeopts setting in display.conf:
modeopts=config-file
The full path to the configuration file for the driver. For example,
carmine.conf is located in /usr/photon/config so that
modeopts=/usr/photon/config/carmine.conf.
Description:
The devg-carmine.so driver provides accelerated 2D and 3D support for the
Fujitsu Carmine graphics controller.
You can edit the configuration file to enable devg-carmine.so to run on your board.
Follow the editing instructions in the sample file,
/usr/photon/config/carmine.conf, to specify the correct configuration for the
required display mode. (For a more detailed explanation of the display settings, see the
appropriate Fujitsu documentation.)
If you use a configuration file for this driver, you must use the modeopts setting in
your display.conf configuration file to specify its location.
Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.
Supported chipsets
2D Acceleration features
Feature Provision
Solid fills Yes
Bresenham lines Yes
Pattern fills No
Polygons Yes
Onscreen blitting Yes
Offscreen blitting Yes
Chroma-keyed blitting Yes
Alpha blending Yes
Raster OP’s 16
Bitmaps Yes
Other features
Feature Provision
Hardware Cursor Yes
TV Out No
Video capture Yes
DPMS (power saving) Yes
Layers supported 8
Restrictions:
• You can use the configuration file to specify other resolutions and refresh rates.
• layer per-pixel blending mode: inline alpha vs. separate alpha layers
See the comments in the sample configuration file for more details.
• In the default mode, there is a single layer supporting per-pixel alpha (compared to
four alpha layers in the second mode). The alpha values are inlined with the RGB
values in this mode, as opposed to being on a separate alpha layer. However, this
inline alpha mode is supported only on one layer, which is GF layer index 2. This
mode provides flexibility: you can, for example, use the alpha values generated by
OpenGL ES to do some interesting effects.
• In the second mode, there are 4 special-purpose alpha layers, which are in addition
to the 8 color layers.
In the GF API, the gf_alpha_t alpha map is configured for blending with an
RGB layer as follows:
gf_alpha_t alpha;
memset(&alpha, 0, sizeof(alpha));
gf_layer_set_blending(fglayer, &alpha);
In the above example, the driver internally picks one of the four alpha layers (if
there is still one available) and uses it.
The two modes of alpha layer operation are mutually exclusive, and must be selected
via the carmine.conf configuration file. The mode of operation can’t be changed at
runtime. By default, the inline alpha mode is used. To use the other mode, specify this
option in the configuration file:
alphamap=1
Files:
This driver needs the following at run time:
See also:
io-display
/usr/photon/config/carmine.conf
Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]
Runs on:
Neutrino
Targets:
MIPSLE, PowerPC, SHLE, x86, ARMLE
Options:
For the general io-display options that you can use with this driver, see
io-display.
You can set configuration options that are specific to this driver by using the
modeopts setting in display.conf:
modeopts=config-file
The full path to the configuration file for the driver. For example chips.conf
is located in /usr/photon/config by default so that
modeopts=/usr/photon/config/chips.conf.
Description:
The devg-chips.so driver provides accelerated 2D support for Chips and
Technologies graphics chipsets.
You can edit the configuration file to enable devg-chips.so to run on your board.
For more information on the options available, see the sample configuration file,
/usr/photon/config/chips.conf.
If you use a configuration file for this driver, you must use the modeopts setting in
your display.conf to specify its location.
Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.
Supported chipsets
• 65550
• 65554
• 65555
• 69000
• 69030
Acceleration features
Feature Provision
Solid fills Yes
Bresenham lines No
Pattern fills Yes
Polygons No
Onscreen blitting Yes
Offscreen blitting Yes
Chroma-keyed blitting Yes
Alpha blending No
Raster OPs Full
Bitmaps No
Other features
Feature Provision
Hardware Cursor Yes
TV Out No
Video capture No
DPMS (power saving) Yes
Display size (pixels): Refresh rate(Hz): Color depth (bits per pixel):
640x480 60, 72, 75, 85 8, 15, 16, 24
800x600 60, 70, 75, 85 8, 15, 16, 24
1024x768 60, 70, 75, 85 8, 15, 16, 24
1152x864 60, 70, 75, 85 8, 15, 16, 24
1280x800 60, 72, 75, 85 8, 15, 16, 24
1280x1024 60, 72, 75, 85 8, 15, 16, 24
1440x900 60, 72, 75, 85 8, 15, 16, 24
1600x1200 60, 72, 75, 85 8, 15, 16, 24
Restrictions:
• These values are typical; the actual ones may depend on your BIOS and monitor
(x86 only).
• Higher resolution and color depths may require more video RAM.
Files:
This driver needs the following at run time:
See also:
io-display
/usr/photon/config/chips.conf
Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]
Runs on:
Neutrino
Targets:
ARMLE, PowerPC, SHLE, x86
Options:
For the general io-display options that you can use with this driver, see
io-display.
You can set configuration options that are specific to this driver by using the
modeopts setting in display.conf:
modeopts=config-file
The full path to the configuration file for the driver. For example, coral.conf
is located in /usr/photon/config so that
modeopts=/usr/photon/config/coral.conf.
Description:
The devg-coral.so driver provides accelerated 2D support for the Fujitsu Coral
graphics controller.
You can edit the configuration file to enable devg-coral.so to run on your board.
Follow the editing instructions in the sample file,
/usr/photon/config/coral.conf, to specify the correct configuration for the
required display mode. (For a more detailed explanation of the display settings, see the
appropriate Fujitsu documentation.)
If you use a configuration file for this driver, you must use the modeopts setting in
your display.conf to specify its location.
Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.
Supported chipsets
Acceleration features
Feature Provision
Solid fills Yes
Bresenham lines Yes
Pattern fills No
Polygons Yes
Onscreen blitting Yes
Offscreen blitting Yes
Chroma-keyed blitting Yes
Alpha blending Yes
Raster OPs Full
Bitmaps Yes
Other features
Feature Provision
Hardware Cursor Yes
TV Out No
Video capture Yes
DPMS (power saving) Yes
Layers supported 6
Restrictions:
• You can use the driver-configuration file to specify other resolutions and refresh
rates.
• The Coral-PA reference card does not support dual-display on its own, a special
adapter card is necessary.
• dmode — Dual Display mode (0 = single display, 1 = dual parallel mode, 2 = dual
multiplexed mode)
• dcm — Display Clock. This needs to be configured to twice the value as would be
required single display. For example, to run two 640x480 displays, change
dcm=0x700 to dcm=0x300
In the Coral-PA Documentation (section 7.10 Dual Display), you’ll see that the
SC0-en field of the Multi-Display Control register defines which layers and cursors are
included in screen 0, and the SC1-en field defines which layers and cursors are
included in screen 1. A layer or cursor can be included in one or both screens.
SC0en and SC1en are 8-bit values. The dlayers parameter is 16-bit with SC1 being the
top 8-bits. A 1 indicates the layer is included in the display.
The bit layout for the dlayers parameter is as follows:
bit description
0 L0 is included in screen 0
1 L1 is included in screen 0
2 L2 is included in screen 0
3 L3 is included in screen 0
4 L4 is included in screen 0
5 L5 is included in screen 0
6 Cursor0 is included in screen 0
7 Cursor1 is included in screen 0
8 L0 is included in screen 1
9 L1 is included in screen 1
10 L2 is included in screen 1
11 L3 is included in screen 1
12 L4 is included in screen 1
13 L5 is included in screen 1
14 Cursor 0 is included in screen 1
15 Cursor 1 is included in screen 1
To include all layers and cursors on both displays, set dlayers=0xFFFF (This is the
default). The driver default for dmode is 0 for single display.
There are two modes to output two screens. In parallel mode, one screen is output at
digital RGB while another is output at analog RGB. In multiplex mode, two screens
are multiplexed and output at digital RGB. Which version is used will depend on
hardware and requirements.
For example, to run in parallel mode with Layers 0, 1 and Cursor 0 on screen 0 and the
rest of the layers on screen 1 you would set:
dlayers=0xBC83
dmode=1
The application code needs to then connect and draw to the proper layers.
Files:
This driver needs the following at run time:
See also:
io-display
/usr/photon/config/coral.conf
Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]
Runs on:
Neutrino
Targets:
x86
Options:
For the general io-display options that you can use with this driver, see
io-display.
Description:
The devg-extreme2.so driver provides 2D and 3D support for the specified
graphics chipsets.
Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.
Supported chipsets
• Intel 82852
• Intel 82854
• Intel 82855
• Intel 82865
2D Acceleration features
Feature Provision
Solid fills Yes
Bresenham lines Yes
Pattern fills Yes
Polygons No
continued. . .
Feature Provision
Onscreen blitting Yes
Offscreen blitting Yes
Chroma-keyed blitting Yes
Alpha blending Yes
Raster OP’s Full
Bitmaps No
Scaled blitting Yes
Other features
Feature Provision
Hardware Cursor Yes
TV Out No
Video capture No
DPMS (power saving) Yes
Layers 4a
Restrictions:
• BIOS capability determines which of these resolutions and color depths are
available on your system.
Files:
This driver needs the following at run time:
See also:
io-display
Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]
Runs on:
Neutrino
Targets:
x86, PowerPC, ARMLE, MIPS, SHLE
Options:
For the general io-display options that you can use with this driver, see
io-display.
You can set configuration options that are specific to this driver by using the memopts
setting in display.conf:
memopts=config-file
The full path to the configuration file for the driver. For example, flat.conf is
located in /usr/photon/config and describes the supported options.
Description:
The devg-flat.so driver provides unaccelerated flat support for frame buffers.
Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.
Files:
This driver needs the following at run time:
See also:
io-display
Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]
Runs on:
Neutrino
Targets:
x86
Options:
For the general io-display options that you can use with this driver, see
io-display.
Description:
The devg-geode.so driver provides accelerated 2D support for the specified
graphics chipsets.
Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.
Supported chipsets
• Media GX
• Geode GX1
• Geode GXLV
• SC1200
Acceleration features
Feature Provision
Solid fills Yes
Pattern fills Yes
Onscreen blitting Yes
continued. . .
Feature Provision
Offscreen blitting Yes
Chroma-keyed blitting No
Alpha blending No
Raster OPs No
Bitmaps Yes
Feature Provision
YUV formats Yes (packed)
RGB formats Yes (RGB 565)
Up scaling Yes
Down scaling No
Other features
Feature Provision
Hardware Cursor Yes
TV Out No
Video capture No
DPMS (power saving) Yes
Display size (pixels): Refresh rate (Hz): Color depth (bits per pixel):
640x480 60 8, 15, 16
800x600 60 8, 15, 16
1024x768 60 8, 15, 16
1280x1024 60 8
Restrictions:
• These are typical values; the actual ones may depend on your video BIOS.
• Higher resolution and color depths may require more video RAM.
Files:
This driver needs the following at run time:
See also:
io-display
Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]
Runs on:
x86
Options:
For the general io-display options that you can use with this driver, see
io-display.
Description:
The devg-gma9xx.so driver provides 2D and 3D support for the specified graphics
chipsets.
Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.
Supported chipsets
• Intel 915G
• Intel 915GM
• Intel 945G
• Intel 915GM
2D Acceleration features
Feature Provision
Solid fills Yes
Bresenham lines Yes
Pattern fills Yes
Polygons No
Onscreen blitting Yes
Offscreen blitting Yes
Chroma-keyed blitting Yes
continued. . .
Feature Provision
Alpha blending Yes
Raster OP’s Full
Bitmaps No
Scaled blitting Yes
Other features
Feature Provision
Hardware Cursor Yes
TV Out No
Video capture No
DPMS (power saving) Yes
Layers 4a
Restrictions:
• BIOS capability determines which of these resolutions and color depths are
available on your system.
Files:
This driver needs the following at run time:
See also:
io-display
Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]
Runs on:
Neutrino
Targets:
x86
Options:
For the general io-display options that you can use with this driver, see
io-display.
Description:
The devg-i810.so driver provides accelerated 2D support for the specified graphics
chipsets.
Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.
Supported chipsets
• Intel 82810
• Intel 82810E
• Intel 82815
Acceleration features
Feature Provision
Solid fills Yes
Pattern fills Yes
Onscreen blitting Yes
continued. . .
Feature Provision
Offscreen blitting Yes
Chroma-keyed blitting Yes
Alpha blending No
Raster OPs Full
Bitmaps No
Feature Provision
YUV formats Yes (packed)
RGB formats Yes (RGB 555, 565)
Up scaling Yes
Down scaling Yes
Other features
Feature Provision
Hardware Cursor Yes
TV Out Yes (PAL and NTSC)
Video capture No
DPMS (power saving) Yes
Restrictions:
Display size (pixels): Refresh rate (Hz): Color depth (bits per pixel):
640x480 60, 70, 75, 85 8, 15, 16, 24
800x600 60, 70, 75, 85 8, 15, 16, 24
1024x768 60, 70, 75, 85 8, 15, 16, 24
continued. . .
Display size (pixels): Refresh rate (Hz): Color depth (bits per pixel):
1152x864 60, 70, 75, 85 8, 15, 16, 24
1280x800 60, 70, 75, 85 8, 15, 16, 24
1280x1024 60, 70, 75, 85 8, 15, 16, 24
1440x900 60, 70, 75, 85 8, 15, 16, 24
1600x1200 60, 70, 75, 85 8, 15, 16, 24
Files:
This driver needs the following at run time:
See also:
io-display
Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]
Runs on:
Neutrino
Targets:
x86
Options:
For the general io-display options that you can use with this driver, see
io-display.
Description:
The devg-i830.so driver provides accelerated 2D support for graphics chips.
Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.
Supported chipsets
• Intel 830
• Intel 845
• Intel 852
• Intel 855
• Intel 865
• Intel 915
• Intel 945
Acceleration features
Feature Provision
Solid fills Yes
Bresenham lines No
Pattern fills Yes
Polygons No
Onscreen blitting Yes
Offscreen blitting Yes
Chroma-keyed blitting Yes
Alpha blending No
Raster OPs Full
Bitmaps No
Feature Provision
YUV formats Yes
RGB formats No
Up scaling Yes
Down scaling Yes
Other features
Feature Provision
Hardware Cursor Yes
TV Out No
Video capture No
DPMS (power saving) Yes
Display size (pixels): Refresh rate(Hz): Color depth (bits per pixel):
640x480 60, 72, 75, 85 8, 15, 16, 32
800x600 60, 70, 75, 85 8, 15, 16, 32
1024x768 60, 70, 75, 85 8, 15, 16, 32
1152x864 60, 70, 75, 85 8, 15, 16, 32
1280x800 60, 72, 75, 85 8, 15, 16, 32
1280x1024 60, 72, 75, 85 8, 15, 16, 32
1440x900 60, 72, 75, 85 8, 15, 16, 32
1600x1200 60, 72, 75, 85 8, 15, 16, 32
Restrictions:
• These values are typical; the actual ones may depend on your BIOS and monitor.
• Higher resolutions and color depths may require more video RAM.
Files:
This driver needs the following at run time:
See also:
io-display
Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]
Runs on:
Neutrino
Targets:
x86
Options:
For the general io-display options that you can use with this driver, see
io-display.
Description:
The devg-intelhd.so driver provides accelerated 2D support for Intel Graphics
Media Accelerator (GMA) High Definition (HD) chips.
Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.
Supported chipsets
• Intel Core i3, i5, and i7
Acceleration features
Feature Provision
Solid fills Yes
Bresenham lines No
Pattern fills Yes
Polygons No
Onscreen blitting Yes
Offscreen blitting Yes
Chroma-keyed blitting Yes
continued. . .
Feature Provision
Alpha blending No
Raster OPs Full
Bitmaps No
Feature Provision
YUV formats No
RGB formats No
Up scaling No
Down scaling No
Other features
Feature Provision
Hardware Cursor Yes
TV Out No
Video capture No
DPMS (power saving) No
Display size (pixels): Refresh rate(Hz): Color depth (bits per pixel):
640x480 60, 72, 75, 85 16, 32
800x600 60, 70, 75, 85 16, 32
1024x768 60, 70, 75, 85 16, 32
1152x864 60, 70, 75, 85 16, 32
1280x1024 60, 72, 75, 85 16, 32
1600x1200 60, 72, 75, 85 16, 32
Restrictions:
• These values are typical; the actual ones may depend on your BIOS and monitor.
• Higher resolutions and color depths may require more video RAM.
Files:
This driver needs the following at run time:
See also:
io-display
Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]
Runs on:
Neutrino
Targets:
x86
Options:
For the io-display options that you can use with this driver, see io-display.
Description:
The devg-matroxg.so driver provides accelerated 2D support for the specified
graphics chipsets.
Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.
Supported chipsets
• Millennium G550 (dual-head output supported on dual-headed cards)
Acceleration features
Feature Provision
Solid fills Yes
Pattern fills Yes
Onscreen blitting Yes
continued. . .
Feature Provision
Offscreen blitting Yes
Chroma-keyed blitting Yes
Alpha blending No
Raster OPs Partial
Bitmaps No
Other features
Feature Provision
Hardware Cursor Yes
TV Out No
Video capture No
DPMS (power saving) Yes
continued. . .
Display size (pixels): Refresh rate (Hz): Color depth (bits per pixel):
1600x1200 60, 70, 75, 85 8, 15, 16, 32
Files:
This driver needs the following at run time:
See also:
io-display
Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]
Runs on:
Neutrino
Targets:
x86
Options:
For the general io-display options that you can use with this driver, see
io-display.
You can set configuration options that are specific to this driver by using the
modeopts setting in display.conf:
modeopts=config-file
The full path to the configuration file for the driver. For example,
poulsbo.conf is located in /usr/photon/config so that
modeopts=/usr/photon/config/poulsbo.conf.
Description:
The devg-poulsbo.so driver provides accelerated 2D and 3D support. You can edit
the configuration file to enable devg-poulsbo.so to run on your board.
Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.
Supported chipsets
• Intel Poulsbo System Controller Hub (SCH)
Acceleration features
Feature Provision
Solid fills Yes
continued. . .
Feature Provision
Bresenham lines Yes
Pattern fills Yes
Polygons Yes
Onscreen blitting Yes
Offscreen blitting Yes
Chroma-keyed blitting Yes
Alpha blending Yes
Raster OP’s Full
Bitmaps No
Scaled blitting Yes
Other features
Feature Provision
Hardware Cursor Yes
TV Out yes
Video capture No
DPMS (power saving) Yes
Layers 4a
Display size (pixels): Refresh rate (Hz): Color depth (bits per pixel):
800 x 600 60 15, 16, 32
1024 x 768 60 15, 16, 32
1280 x 1024 60 15, 16, 32
Restrictions:
• These are typical values; the actual ones may depend on your video BIOS.
• Higher resolution and color depths may require more video RAM.
• Other resolutions and refresh rates may be available, but may require you to modify
poulsbo.conf.
Files:
This driver needs the following at run time:
See also:
io-display
Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]
Runs on:
Neutrino
Targets:
x86, PowerPC
Options:
For the general io-display options that you can use with this driver, see
io-display.
Description:
The devg-radeon.so driver provides accelerated 2D support for the specified
graphics chipsets.
The DVI (digital video interface) is enabled by default, so you can connect LCD
panels to your Radeon cards. The only requirement is that you connect the LCD to the
DVI connector at boot time so the video BIOS can set up the digital output.
Dual-headed display is supported on cards with dual outputs (x86 only). The video
BIOS initializes both outputs at boot time. Ensure that both outputs are connected.
• If you use devg-radeon.so with two cards that have the same vendor and device
IDs, the driver fails.
• Graphics drivers run at a higher priority than applications, but they shouldn’t run at
a higher priority than the audio, or else breaks in the audio occur. You can use the
on command to adjust the priorities of the audio and graphics drivers.
Supported chipsets
• RADEON
• RADEON VE
• RADEON 7500
• RADEON 8500
• RADEON 9000
• RADEON 9200
• RADEON 9500
• RADEON 9600
• RADEON 9700
• RADEON 9800
• RADEON x300
• RADEON x600
• RADEON MOBILITY M6
• RADEON MOBILITY M7
• RADEON MOBILITY M9
Acceleration features
Feature Provision
Solid fills Yes
Pattern fills Yes
Onscreen blitting Yes
Offscreen blitting Yes
Chroma-keyed blitting Yes
Alpha blending No
Raster OPs Full
Bitmaps No
Other features
Feature Provision
Hardware Cursor Yes
continued. . .
Feature Provision
TV Out No
Video capture No
DPMS (power saving) Yes
Restrictions:
Files:
This driver needs the following at run time:
See also:
io-display
Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]
Runs on:
Neutrino
Targets:
x86
Options:
For the general io-display options that you can use with this driver, see
io-display.
Description:
The devg-rage.so driver provides accelerated 2D support for the specified graphics
chipsets.
Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.
Supported chipsets
• Mach 64 GT
• 3D RAGE
• 3D RAGE II
• 3D RAGE II+
• 3D RAGE PRO
• 3D RAGE PRO LT
• RAGE XL
• RAGE XC
• RAGE IIC
Acceleration features
Feature Provision
Solid fills Yes
Pattern fills Yes
Onscreen blitting Yes
Offscreen blitting Yes
Chroma-keyed blitting Yes
Alpha blending No
Raster OPs Partial
Bitmaps Yes
Feature Provision
YUV formats Yes (packed and planar)
RGB formats Yes (RGB 555, 565, 8888)
Up scaling Yes
Down scaling Yes
Other features
Feature Provision
Hardware Cursor Yes
TV Out Yes (PAL and NTSC)
Video capture No
DPMS (power saving) Yes
Restrictions:
Display size (pixels): Refresh rate (Hz): Color depth (bits per pixel):
640x480 60, 72, 75, 85 8, 15, 16, 24, 32
800x600 60, 72, 75, 85 8, 15, 16, 24, 32
1024x768 60, 70, 75, 85 8, 15, 16, 24, 32
1280x1024 60, 70, 75, 85 8, 15, 16, 24, 32
Restrictions:
• These are typical values; the actual ones may depend on your video BIOS.
• Higher resolution and color depths may require more video RAM.
Files:
This driver needs the following at runtime:
See also:
io-display
Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]
Runs on:
Neutrino
Targets:
x86
Options:
For the general io-display options that you can use with this driver, see
io-display.
Description:
The devg-s3_savage.so driver provides accelerated 2D support for the specified
graphics chipsets.
Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.
Supported chipsets
• S3 Savage4
• VIA Twister T
Acceleration features
Feature Provision
Solid fills Yes
Pattern fills No
Onscreen blitting Yes
Offscreen blitting Yes
Chroma-keyed blitting Yes
continued. . .
Feature Provision
Alpha blending No
Raster OPs Partial
Bitmaps No
Other features
Feature Provision
Hardware Cursor Yes
TV Out No
Video capture No
DPMS (power saving) Yes
Files:
This driver needs the following at runtime:
See also:
io-display
Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]
Runs on:
Neutrino
Targets:
x86
Options:
For the general io-display options that you can use with this driver, see
io-display.
You can set configuration options that are specific to this driver by using the
modeopts setting in display.conf as follows:
modeopts=BIOS
Use video BIOS to detect and set the graphics mode.
Description:
The devg-sis630.so driver provides accelerated 2D support for graphics chips.
Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.
Supported chipsets
• SiS 300
• SiS 630
Acceleration features
Feature Provision
Solid fills Yes
Bresenham lines Yes
Pattern fills Yes
continued. . .
Feature Provision
Polygons No
Onscreen blitting Yes
Offscreen blitting Yes
Chroma-keyed blitting Yes
Alpha blending No
Raster OPs Full
Bitmaps Yes
Other features
Feature Provision
Hardware Cursor Yes
TV Out No
Video capture No
DPMS (power saving) Yes
continued. . .
Display size (pixels): Refresh rate(Hz): Color depth (bits per pixel):
1600x1200 60, 72, 75, 85 8, 15, 16, 32
Restrictions:
• These values are typical; the actual ones may depend on your BIOS and monitor.
• Higher resolutions and color depths may require more video RAM.
Files:
This driver needs the following at run time:
See also:
io-display
Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]
Runs on:
Neutrino
Targets:
ARMLE, MIPSLE, PowerPC, SHLE, x86
Options:
For the general io-display options that you can use with this driver, see
io-display.
You can set configuration options that are specific to this driver by using the
modeopts setting in display.conf:
modeopts=config-file
The full path to the configuration file for the driver. For example smi5xx.conf
is located in /usr/photon/config by default so that
modeopts=/usr/photon/config/smi5xx.conf.
Description:
The devg-smi5xx.so driver provides accelerated 2D support for the Silicon Motion
SM501 graphics chip.
You can edit the configuration file to enable devg-smi5xx.so to run on your board.
Follow the editing instructions in the sample file,
/usr/photon/config/smi5xx.conf, to specify the correct configuration for the
required display mode. (For a more detailed explanation of the display settings, see the
appropriate Silicon Motion documentation.)
If you use a configuration file for this driver, you must use the modeopts setting in
your display.conf to specify its location.
Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.
Supported chipsets
Acceleration features
Feature Provision
Solid fills Yes
Bresenham lines Yes
Pattern fills Yes
Polygons No
Onscreen blitting Yes
Offscreen blitting Yes
Chroma-keyed blitting Yes
Alpha blending No
Raster OPs Full
Bitmaps Yes
Other features
Feature Provision
Hardware Cursor Yes
TV Out No
Video capture No
DPMS (power saving) Yes
Layers supported 4
continued. . .
Feature Provision
Dual display Yes
You can use the driver configuration file to configure other resolutions and refresh
rates.
Files:
This driver needs the following at run time:
See also:
io-display
/usr/photon/config/smi5xx.conf
Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]
Runs on:
Neutrino
Targets:
ARMLE, MIPS, PowerPC, x86, SH4
Options:
For the general io-display options that you can use with this driver, see
io-display.
You can set configuration options that are specific to this driver by using the
modeopts setting in display.conf:
modeopts=config-file
The full path to the configuration file for this driver. For example smi7xx.conf
is located in /usr/photon/config by default so that
modeopts=/usr/photon/config/smi7xx.conf.
Description:
The devg-smi7xx.so driver provides accelerated 2D support for the specified
graphics chipset.
You can edit the configuration file to enable devg-smi7xx.so to run on your board.
Follow the editing instructions in the sample file,
/usr/photon/config/smi7xx.conf, to specify the correct configuration for the
required display mode. (For a more detailed explanation of the display settings, see the
appropriate Silicon Motion documentation.)
If you use a configuration file for this driver, you must use the modeopts option in
your display.conf to specify its location.
Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.
Supported chipsets
• Lynx3DM+ (SM721/SM722)
Acceleration features
Feature Provision
Solid fills Yes
Pattern fills No
Onscreen blitting Yes
Offscreen blitting Yes
Chroma-keyed blitting Yes
Alpha blending No
Raster OPs Full
Other features
Feature Provision
Hardware Cursor Yes
TV Out No
Video capture No
DPMS (power saving) Yes
Layer Support 3 layers
Dual display No
Display size (pixels) Refresh rate(Hz) Color depth (bits per pixel)
640x480 60 8, 15, 16, 24
800x600 60 8, 15, 16, 24a
1024x768 60 8, 15, 16, 24a
Restrictions:
• These are typical values; the actual ones may depend on your BIOS (x86) and
monitor. You can use the configuration file to set up other resolutions and refresh
rates.
Files:
This driver needs the following at run time:
See also:
io-display
/usr/photon/config/smi7xx.conf
Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]
Runs on:
Neutrino
Targets:
PowerPC, SHLE, x86
Options:
For the general io-display options that can be used with this driver, see
io-display.
Description:
The devg-soft3d.so module provides 3D support in software. It is used
automatically by io-display when it loads graphics drivers that don’t have 3D
accelleration in hardware. For example, it is used for the devg-vmware.so and
devg-vesabios.so drivers.
Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.
Supported chipsets
• all chipsets that don’t have 3D accelleration support
Acceleration features
None
See also:
io-display
Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]
Runs on:
Neutrino
Targets:
ARMLE
Options:
For the general io-display options that can be used with this driver, see
io-display.
Description:
The devg-soft3d-fixed.so module provides 3D support in software using
fixed-point math.
Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.
Supported chipsets
• all chipsets that don’t have 3D accelleration support
Acceleration features
None
See also:
io-display
Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]
Runs on:
Neutrino
Targets:
x86
Options:
For the general io-display options that you can use with this driver, see
io-display.
Description:
The devg-svga.so driver provides support for the specified graphics chipsets.
• This is a “safe”, generic graphics driver. However, it can negatively impact the
timing of a system and affect realtime operations. We recommended you use an
accelerated driver instead, if at all possible.
• Graphics drivers run at a higher priority than applications, but they shouldn’t run at
a higher priority than the audio, or else breaks in the audio occur. You can use the
on command to adjust the priorities of the audio and graphics drivers.
Supported chipsets
• Super VGA chipsets compliant with Vesa 1.2 (or greater)
Acceleration features
None
Other features
Feature Provision
Hardware Cursor No
TV Out Yes (PAL and NTSC)
Video capture No
DPMS (power saving) Yes
Restrictions:
Display size (pixels): Refresh rate (Hz): Color depth (bits per pixel):
640x480 60 8, 15, 16
800x600 60 8, 15, 16
1024x768 60 8, 15, 16
1152x864 60 8, 15, 16
1280x1024 60 8, 15, 16
1600X1200 60 8, 15, 16
Restrictions:
• BIOS capability determines which of these resolutions and color depths are
available on your system.
Files:
This driver needs the following at run time:
See also:
io-display
Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]
Runs on:
Neutrino
Targets:
x86
Options:
For the general io-display options that you can use with this driver, see
io-display.
Description:
The devg-tnt.so driver provides accelerated 2D support for the specified graphics
chipsets.
Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.
Supported chipsets
• Riva 128
• Riva TNT
• Riva TNT 2
• GeForce
• GeForce2
• GeForce2 GO
Acceleration features
Feature Provision
Solid fills Yes
continued. . .
Feature Provision
Pattern fills Yes
Onscreen blitting Yes
Offscreen blitting Yes
Chroma-keyed blitting No
Alpha blending No
Raster OPs Full
Bitmaps No
Feature Provision
YUV formats Yes (packed)
RGB formats No
Up scaling Yes
Down scaling Yes
Restrictions:
• Video overlay is supported only on GeForce and GeForce2 chipsets (not including
GeForce2 GO).
Other features
Feature Provision
Hardware Cursor Yes
TV Out No
Video capture No
DPMS (power saving) No
Display size (pixels): Refresh rate (Hz): Color depth (bits per pixel):
640x480 60, 70, 75, 85 8, 15, 16, 32
800x600 60, 70, 75, 85 8, 15, 16, 32
1024x768 60, 70, 75, 85 8, 15, 16, 32
1152x864 60, 70, 75, 85 8, 15, 16, 32
1280x800 60, 70, 75, 85 8, 15, 16, 32
1280x1024 60, 70, 75, 85 8, 15, 16, 32
1440x900 60, 70, 75, 85 8, 15, 16, 32
1600X1200 60, 70, 75, 85 8, 15, 16, 32
Restrictions:
• For flat panel support with GeForce2 GO, make sure the refresh rate is 60 Hz (the
default). The video BIOS capability determines which of these resolutions and
color depths are available on your system.
Files:
This driver needs the following at run time:
See also:
io-display
Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]
Runs on:
Neutrino
Targets:
MIPSLE, SHLE, x86
Options:
For the general io-display options that you can use with this driver, see
io-display.
You can set configuration options that are specific to this driver by using the modeopts
setting in display.conf:
modeopts=config-file
The full path to the configuration file for the driver. For example, tvia.conf is
located in /usr/photon/config by default so that the sample file is
/usr/photon/config/tvia.conf.
Description:
The devg-tvia.so driver provides accelerated 2D support for TVIA graphics
chipset.
On non-x86 systems, install jumper JP3 on the reference adapter.
You can edit the configuration file to enable devg-tvia.so to run on your board. For
more information on the options available, see the sample configuration file,
/usr/photon/config/tvia.conf.
If you use a configuration file for this driver, you must use the modeopts in your
display.conf to specify its location.
Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.
Supported chipsets
• CyberPro 5200
• CyberPro 5250
• CyberPro 5300
• CyberPro 5305
• CyberPro 5350
• CyberPro 5355
Acceleration features
Feature Provision
Solid fills Yes
Bresenham lines No
Pattern fills Yes
Polygons No
Onscreen blitting Yes
Offscreen blitting Yes
Chroma-keyed blitting Yes
Alpha blending No
Raster OPs Full
Bitmaps Yes
Feature Provision
YUV formats Yes (Packed)
RGB formats Yes (RGB 555, 565, 888, 8888)
Up scaling Yes
Down scaling No
Other features
Feature Provision
Hardware Cursor Yes
TV Out (PAL and NTSC) Yes
Video capture No
DPMS (power saving) Yes
Display size (pixels): Refresh rate(Hz): Color depth (bits per pixel):
640x480 60, 72, 75, 85 8, 15, 16, 24, 32
800x600 60, 70, 75, 85 8, 15, 16, 24, 32
1024x768 60, 70, 75, 85 8, 15, 16, 24, 32
1152x864 60, 70, 75, 85 8, 15, 16, 24, 32
1280x800 60, 72, 75, 85 8, 15, 16, 24, 32
1280x1024 60, 72, 75, 85 8, 15, 16, 24, 32
1440x900 60, 72, 75, 85 8, 15, 16, 24, 32
1600x1200 60, 72, 75, 85 8, 15, 16, 24, 32
Restrictions:
• Higher resolution and color depths may require more video RAM.
• Resolutions above 1024x768 might not display data correctly because of an issue
with memory bandwidth.
Files:
This driver needs the following at run time:
See also:
io-display
/usr/photon/config/tvia.conf
Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]
Runs on:
Neutrino
Targets:
x86
Options:
For the general io-display options that you can use with this driver, see
io-display.
Description:
The devg-vesabios.so driver provides 2D support for the specified graphics
chipsets.
• This is a “safe”, generic graphics driver. However, it can negatively impact the
timing of a system and affect realtime operations. We recommended you use an
accelerated driver instead, if at all possible.
• Graphics drivers run at a higher priority than applications, but they shouldn’t run at
a higher priority than the audio, or else breaks in the audio occur. You can use the
on command to adjust the priorities of the audio and graphics drivers.
Supported chipsets
• Any video adapter compliant with VESA 2.0 (or greater)
Acceleration features
None
Other features
Feature Provision
Hardware Cursor No
TV Out Yes (see below)
Video capture No
DPMS (power saving) Yes
Restrictions:
Display size (pixels): Refresh rate (Hz): Color depth (bits per pixel):
640x480 60 8, 15, 16, 24, 32
800x600 60 8, 15, 16, 24, 32
1024x768 60 8, 15, 16, 24, 32
1152x864 60 8, 15, 16, 24, 32
1280x1024 60 8, 15, 16, 24, 32
1600X1200 60 8, 15, 16, 24, 32
Restrictions:
• BIOS capability determines which of these resolutions and color depths are
available on your system.
Files:
This driver needs the following at run time:
See also:
io-display
Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]
Runs on:
Neutrino
Targets:
x86
Options:
For the general io-display options that you can use with this driver, see
io-display.
Description:
The devg-vmware.so driver provides 2D support for machines running QNX
Neutrino on a VMware virtual machine.
• VirtualPC and VMWare require a Windows session that’s operating with 32-bit
graphics.
• Graphics drivers run at a higher priority than applications, but they shouldn’t run at
a higher priority than the audio, or else breaks in the audio occur. You can use the
on command to adjust the priorities of the audio and graphics drivers.
Supported chipsets
• VMware 5.0
Acceleration features
None
Other features
Feature Provision
Hardware Cursor No
TV Out No
Video capture No
DPMS (power saving) Yes
Display size (pixels): Refresh rate (Hz): Color depth (bits per pixel):
640x480 60 16, 24, 32
800x600 60 16, 24, 32
1024x768 60 16, 24, 32
1280x1024 60 16, 24, 32
1600X1200 60 16, 24, 32
Restrictions:
• BIOS capability determines which of these resolutions and color depths are
available on your system.
Files:
This driver needs the following at run time:
Caveats:
VMWare sessions default to resolution 1024x768 with color depth argb8888. This
setting is forced in the enumerator file located in the following folder:
/etc/system/enum/devices/graphics
To change the host’s default resolution setting, you can modify the value in the
enumerator file.
See also:
io-display
Syntax:
io-hid -d egalax [option[,option ...]] ... &
Runs on:
Neutrino
Options:
Use commas, not spaces, to separate the options.
Don’t use this option unless you’re certain that the default protocol your controller is
using is the Egalax protocol.
wait=num The number of seconds to wait for the USB stack to come up.
Description:
The Egalax touchscreens aren’t HID-compliant, so the devh-egalax.so DLL
converts Egalax native controller packets into generic HID packets, which devi-hid
then handles.
If you’re using this driver with the USB (devh-usb.so) module, you must specify
the igndev option to devh-usb.so, specifying the Egalax vendor and device IDs.
Examples:
Start io-hid using the Egalax driver, and then start devi-hid:
Start io-hid using the Egalax driver at high verbosity and with a new stack path:
Files:
devh-egalax.so
The devh-egalax.so DLL is normally found in /lib/dll.
See also:
devh-*, devh-usb.so, devi-hid, diskboot, io-hid
Syntax:
io-hid -d microtouch [option[,option ...]] ... &
Runs on:
Neutrino
Options:
Use commas, not spaces, to separate the options.
verbose=level Be verbose and specify the level of debug information (range 1-5).
wait=num The number of seconds to wait for the USB stack to come up.
Description:
The devh-microtouch.so DLL converts Microtouch EXII packets into generic
HID packets, which devi-hid then handles.
Examples:
Start io-hid using the Microtouch driver, and then start devi-hid:
io-hid -d microtouch &
devi-hid touch
Start io-hid using the Microtouch driver at high verbosity and with a new stack path
and a new device ID:
io-hid -d microtouch did=0x1234,verbose=5,upath=/dev/huxley-usb/ &
Files:
devh-microtouch.so
The devh-microtouch.so DLL is normally found in /lib/dll.
See also:
devh-*, devh-usb.so, devi-hid, diskboot, io-hid
Syntax:
io-hid -d ps2ser
protocol_module[,options]:device_module[,options]
[:protocol_module[,options]:device_module[,options]]...
[opts=v[v...]]
Runs on:
Neutrino
Options:
Colons (:) separate modules; commas (,) separate module options.
protocol_module[,options]
The input protocol module. You can specify multiple
protocol/device module pairs.
The protocol_module variable may be any one of the following
modules:
device_module[,options]
Device modules. The device_module variable depends on the
protocol_module specified. The following device modules are
supported:
mousedev[,options]...
For PS2 mouse. Options:
• f=filename — Create the named file and
collect all data passed to the protocol level
(debug only)
• i=irq — IRQ number (default 12)
• p=(ioport,add) — Port address (default
0x60), and a value to add to get the status
port address (default 4: 0x60 + 4 = 0x64)
• r — Reset the device on initiation
• P priority — The processing priority for
mouse events
Description:
The devh-ps2ser.so DLL provides io-hid with HID information. The DLL
collects raw data from a variety of legacy devices (e.g. PS2 keyboards, and PS2 and
serial mice), transforms it to unified USB HID report format, and then sends the data
to io-hid. The io-hid manager forwards the data to devi-hid.
The devh-ps2ser.so DLL is usually started by io-hid in the system startup
procedure (see diskboot).
• The devh-ps2ser.so DLL is the low-level part of the input channel. You have to
start devh-usb.so to provide any top-level services required.
• If you press several keys at once on some Microsoft keyboards, the keyboard
doesn’t produce any indication when you release the keys. As a result, the input
driver thinks you’re still holding the keys down. For more information, see
http://support.microsoft.com/kb/909528/en-us.
Examples:
Start a regular PS/2 mouse, a Microsoft/IntelliMouse serial mouse on COM1, and a
PS/2 keyboard:
Files:
devh-ps2ser.so
The devh-ps2ser.so Dll is normally found in /lib/dll.
Errors:
If an error occurs in devh-ps2ser.so, the keyboard will not work in text mode. If
you specify at least one v option, details of driver activity will be reported on the
console screen and will be appended to the system log; for more detail, increase the
verbosity level.
See also:
devh-*, devi-hid, devh-usb.so, diskboot, io-hid.
Syntax:
io-hid -d touchintl [option[,option ...]] ... &
Runs on:
Neutrino
Options:
Use commas, not spaces, to separate the options.
Description:
The Touch International touchscreens aren’t HID-compliant, so the
devh-touchintl.so DLL converts touchintl native controller packets into generic
HID packets, which devi-hid then handles.
Examples:
Start io-hid using the Touch International driver, and then start devi-hid:
io-hid -d touchintl &
devi-hid touch
Start io-hid using the Touch International driver at high verbosity and with a new
stack path and a new device ID, at a data rate of 100 packets per second:
io-hid -d egalax did=0x1234,rate=4,verbose=5,upath=/dev/payton-usb/ &
Files:
devh-touchintl.so
The devh-touchintl.so DLL is normally found in /lib/dll.
See also:
devh-*, devi-hid, devh-usb.so, diskboot, io-hid
Syntax:
io-hid -d usb [option[,option ...]] ... &
Runs on:
Neutrino
Options:
igndev=vid[:did]
Don’t attach to the HID device matching the given vendor and device
IDs. The vid and did must be hexadecimal vendor and product IDs
(e.g. igndev=0x1234:0x5678), as reported by the usb utility.
You can use the igndev option to ignore specific USB HID devices.
This allows another USB driver to attach and manage the device. You
can specify multiple igndev options.
The did also supports pattern matching to let you specify a range for
device IDs for a particular vendor; see the examples below.
verbose Be verbose.
wait=num The number of seconds to wait for the USB stack to come up.
Description:
The devh-usb.so is a DLL which is used with the io-hid manager. It connects to
the USB stack to give HID clients access to USB-compliant human interface devices.
Run the USB stack first. Please refer to io-usb for further information.
Examples:
Start io-hid using the USB HID driver and manage all USB HID devices:
io-hid -d usb &
or:
io-hid &
mount -Tio-hid devh-usb.so
See also:
devh-ps2ser.so. devh-*, hidview, io-hid, io-usb, usb
Syntax:
devi-dyna [general_opts]
protocol* [protocol_opts]*
device* [device_opts]*
filter* [filter_opts]*
Runs on:
Neutrino
Options:
When you use a devi-* driver for a touchscreen device, you need a calibration file.
The calibration file is generated from the output produced by the calib utility:
For more information, see the calib utility in the Utilities Reference, and
Touchscreens in the Neutrino User’s Guide.
General options:
Description:
The devi-dyna command starts the Dyna input manager for Photon.
Examples:
Connect the Dyna controller to the first serial port:
See also:
devi-*, inputtrap
Syntax:
devi-elo [general_opts]
protocol* [protocol_opts]*
device* [device_opts]*
filter* [filter_opts]*
Runs on:
Neutrino
Options:
When you use a devi-* driver for a touchscreen device, you need a calibration file.
The calibration file is generated from the output produced by the calib utility:
For more information, see the calib utility in the Utilities Reference, and
Touchscreens in the Neutrino User’s Guide.
General options:
-1 Use COM1.
-2 Use COM2.
-i irq The IRQ for the serial device (default 4).
-p ioport The port of the serial device (default 3f8).
Description:
The devi-elo command starts the Elographics input manager for Photon.
Examples:
Connect the Smartset controller to the first serial port. Use the serial manager to get
input data. Touching the screen emulates a right mouse button press:
See also:
devi-*, inputtrap
Syntax:
devi-hid [general_opts]
protocol* [protocol_opts]*
filter* [filter_opts]*
Runs on:
Neutrino
Targets:
Any supported platform that has io-hid running.
Options:
General options:
Description:
This manager is a universal Photon input daemon for keyboards and mice. It is a client
of io-hid, the HID server.
Usually, inputtrap starts devi-hid during the Photon startup procedure; for test
and other purposes, you may also start this manager in text mode as a resource
manager.
The io-hid resource manager must be running before devi-hid can start.
This manager doesn’t need information about the physical interfaces of real devices: it
relies on service from the io-hid resource manager and supplementary input
modules. The devi-hid daemon takes data in the form of HID reports, transforms
the data into Photon events, and then emits these events to Photon. It provides
multi-language support for keyboard input.
If you specify the verbosity option, activity messages are sent to the console screen
and to the system log. Data is normally sent to Photon, alternatively, in resource
manager mode (-r option), data can be sent to devices (by default,
/dev/devi/keyboard0 and /dev/devi/mouse0).
Examples:
Typical command line to start the keyboard and mouse manager:
Files:
devi-hid Normally in /usr/photon/bin.
Errors:
If an error occurs in starting devi-hid, the keyboard or mouse will not work in
Photon and Photon won’t be able to start. If you specify at least one v option, activity
details will be reported on the console screen and will be appended to the system log;
for more detail, increase the verbosity level.
See also:
inputtrap, mkkbd.
Syntax:
devi-hirun [-bdglPr] [-v[v]...]
protocol [protocol_opts...]
[protocol [protocol_opts...]]...
[device [device_opts...]]...
[filter [filter_opts...]]...
Runs on:
Neutrino
Options:
When you use a devi-* driver for a touchscreen, you need a calibration file. The
calibration file is generated from the output produced by the calib utility:
For more information, see the calib utility in the Utilities Reference, and
Touchscreens in the Neutrino User’s Guide.
protocol [protocol_opts...]
The protocols and their options are:
-f filename Create the given file and collect all data passed to
the filter level (for debug only).
-k rate[,delay] Keyboard rate (Hz), delay (ms). The default is
30Hz, 500ms).
The -k option works only in conjunction with the kbddev device module.
-p filename Create and open the given FIFO file and duplicate
all data passed to the filter level (for debug only)
-R Don’t reset the device while resetting the protocol.
-r Reset the keyboard (the default).
-s The device driver should supply valid symbols.
All serial devices use 8 data bits, 1 stop bit, and no parity.
device [device_opts...]
The devices and their options are:
-f filename Create the given file and collect all data passed
to the protocol level (for debug only).
-i irq IRQ (default: 12).
-P The processing priority of the mouse event.
-p ioport,add The port (default: 0x60) and a value to add to
get the status (default: 4).
-r Reset the mouse port. This is useful on
hardware with no BIOS (e.g. PowerPC, MIPS).
If you specify both kbddev and mousedev options in the command line, and you use
non-standard port numbers, you must define the same port number values for each
module.
uart [options] Accesses 8250/16450/16550 UART directly.
Options:
-1 Use COM1.
-2 Use COM2.
-i irq IRQ for serial device (default: 4).
-P The processing priority of the input event.
-p ioport Port of serial device (default: 3f8).
filter [filter_opts...]
The filters and their options are:
Description:
The devi-hirun driver serves as the “high-runner” (i.e. the most likely) input driver
for Photon. The inputtrap utility detects drivers and starts devi-hirun.
The devi-hirun driver is responsible for taking data from an input device such as a
mouse, or keyboard, interpreting the data, and then “doing” something with it. The
default behavior is to package the data as an event and inject it into the Photon event
space.
The devi-hirun driver uses a layered approach to driver design:
• filter layer
• protocol layer
• device layer
At each layer, data is interpreted/modified and passed up to the next layer until it’s
injected as an event into the Photon event space.
For each device devi-hirun talks to, there’s a separate path through the three layers
called an event bus line. An event bus line consists of modules, one representing each
layer, linked together by a software bus. As data is passed up the layers via the bus, the
data is manipulated by each module into a format recognizable by the next layer’s
module and so on.
It’s important to note that you can run as many instances of devi-hirun as you want,
one for each device. Or you can run one devi-hirun for all the devices. Choosing
which scenario to use is mostly a matter of convenience.
Examples:
If inputtrap detects a serial Microsoft mouse and a keyboard interfaced through the
file descriptor provided by opening /dev/kbd, it invokes devi-hirun like this:
If inputtrap detects a PS/2 mouse interfaced through the auxiliary port on the
keyboard controller (mousedev) and a keyboard interfaced through the primary
keyboard port on the keyboard controller (kbddev), it invokes devi-hirun like this:
See also:
devi-*, inputtrap
Connecting Hardware in the Neutrino User’s Guide
Syntax:
devi-microtouch [general_opts]
protocol* [protocol_opts]*
device* [device_opts]*
filter* [filter_opts]*
Runs on:
Neutrino
Options:
When you use a devi-* driver for a touchscreen device, you need a calibration file.
The calibration file is generated from the output produced by the calib utility:
For more information, see the calib utility in the Utilities Reference, and
Touchscreens in the Neutrino User’s Guide.
General options:
-r Start the resource manager interface (use this option only if you
aren’t using Photon).
-1 Use COM1.
-2 Use COM2.
-i irq The IRQ for the serial device (default 4).
-p ioport The port of the serial device (default 3f8).
If you want to specify the -l parameter in the touchdev module, you must place it
before any other parameter.
-n Work with a pen (the default).
-p ioport,add The port of the serial device (default 0x60), and a value to add
to get the status.
If you use the touchdev module, you must disable the standard mouse/keyboard
driver devi-hirun PS2 mouse module.
You can do this by creating a /etc/config/trap/input[.hostname] file with one
of the following strings:
- If you use a serial mouse, use:
kbd kbddev msoft fd -d /dev/serN
Description:
The devi-microtouch command starts the Microtouch input manager for Photon.
Examples:
Connect a Microtouch controller to first serial port:
See also:
devi-*, inputtrap
Syntax:
devi-semtech [general_opts]
protocol* [protocol_opts]*
device* [device_opts]*
filter* [filter_opts]*
Runs on:
Neutrino
Options:
When you use a devi-* driver for a touchscreen device, you need a calibration file.
The calibration file is generated from the output produced by the calib utility:
For more information, see the calib utility in the Utilities Reference, and
Touchscreens in the Neutrino User’s Guide.
General options:
-r Start the resource manager interface (only use if you aren’t using
Photon).
Description:
The devi-semtech command starts the Semtech input manager for Photon.
Examples:
Connect the Semtech controller to the first serial port:
See also:
devi-*, inputtrap
Syntax:
devi-zytronic [general_opts]
protocol* [protocol_opts]*
device* [device_opts]*
filter* [filter_opts]*
Runs on:
Neutrino
Options:
When you use a devi-* driver for a touchscreen device, you need a calibration file.
The calibration file is generated from the output produced by the calib utility:
For more information, see the calib utility in the Utilities Reference, and
Touchscreens in the Neutrino User’s Guide.
General options:
-r Start the resource manager interface (only use if you aren’t using
Photon).
-a averaging The number of frames for x-y averaging, in the range from 0
through 9. The default is 9. This effects the accuracy of each
touch (0 is less accurate, and 9 is more accurate).
-b baud Baud rate (default 9600).
-g thickness The glass thickness (0 = thin, 1 = medium, 2 = thick).
-R Don’t reset the device (the default is to reset it).
-t threshold The touch threshold (sensitivity); the range is from 0 through 44,
where 0 is very sensitive, and 44 is not sensitive. The default is
19.
Description:
The devi-zytronic command starts the Zytronic input manager for Photon.
Examples:
Connect the Zytronic controller to the first serial port:
See also:
devi-*, inputtrap
Syntax:
io-pkt-variant -d asix [option[,option ...]] ... &
Runs on:
Neutrino
Options:
Use commas, not spaces, to separate the options.
duplex=0|1 Half (0) or full (1) duplex mode. The default is automatically
detected on supported hardware. If you specify duplex, specify
speed as well; if duplex alone is specified, it is ignored and both
speed and duplex are autonegotiated.
mac=XXXXXXXXXXXX
The interface address of the controller. The default is
automatically detected on supported hardware.
priority=N The priority of the driver’s event thread. The default is 21.
promiscuous Enable the driver to pass all data packets received, regardless of
the address. By default, promiscuous mode is disabled.
verbose
verbose=N Be verbose. Specify num for more verbosity (num can be 1-4; the
higher the number, the more detailed the output). The default is
0. The output goes to slogger; invoke sloginfo to view it.
wait=num The number of seconds to wait for the USB stack. The default is
60 seconds.
Description:
The devn-asix.so driver controls the ASIX AX88172/AX88178/AX88772 USB
Ethernet dongle. This is a legacy io-net driver; its interface names are in the form
enX, where X is an integer.
If the device enumerators (see enum-devices) don’t recognize your device, try
explicitly specifying the device ID with the did option when you start the driver.
Some devices support hardware checksums, although some might do so in only one
direction; to determine if your device does, type:
ifconfig enX
and look for the following in the list of supported options:
You can then use ifconfig to enable or disable whichever of these options your
device supports.
Examples:
Start io-pkt-v6-hc using the ASIX driver:
Files:
/dev/io-net The directory where, by default, drivers and protocol modules add
entries. For more information, see the documentation for
io-pkt*.
See also:
devn-*, devnp-*, ifconfig, io-pkt*, nicinfo
Syntax:
io-pkt-variant -d crys8900 [option[,option ...]] ...
Runs on:
Neutrino
Options:
Use commas, not spaces, to separate the options.
connector=0|1|2|3
Network cable connector type:
0 BNC
1 UTP
2 AUI
3 FIBER
iorange=0xXXXXXXXX
I/O base address.
mac=XXXXXXXXXXXX
MAC address of the controller. The default is automatically
detected on supported hardware.
verbose
verbose=num Be verbose. Specify num for more verbosity (num can be 1-4, the
higher the number, the more detailed the output). The default is 0.
The output goes to slogger, invoke sloginfo to view.
Description:
The devn-crys8900.so driver controls Crystal 89xx Ethernet adapters. This is a
legacy io-net driver; its interface names are in the form enX, where X is an integer.
CAUTION: This driver can’t always detect the correct irq and ioport options,
! especially for ISA devices. To be sure, always specify irq and ioport when using
this driver.
Some devices support hardware checksums, although some might do so in only one
direction; to determine if your device does, type:
ifconfig enX
and look for the following in the list of supported options:
You can then use ifconfig to enable or disable whichever of these options your
device supports.
Examples:
Start io-pkt-v4-hc using the Crystal 89xx driver: stack:
io-pkt-v4-hc -d crys8900
ifconfig en0 10.1.0.184
Files:
/dev/io-net The directory where, by default, drivers and protocol modules add
entries. For more information, see the documentation for
io-pkt*.
See also:
devn-*, devnp-*, ifconfig, io-pkt*, nicinfo
Syntax:
io-pkt-variant -d dm9102 [option[,option ...]] ... &
where variant is one of v4, v4-hc, or v6-hc.
Runs on:
Neutrino
Options:
Use commas, not spaces, to separate the options. These options will override
auto-detected defaults.
duplex=0|1 Half (0) or full (1) duplex mode. The default is automatically
detected on supported hardware. If you specify duplex, specify
speed as well; if duplex alone is specified, it is ignored and both
speed and duplex are auto-negotiated.
mac=XXXXXXXXXXXX
MAC address of the controller. If no SROM is available, the
MAC will default to 00:00:00:00:00:00
phyaddr=num Override the mii routines and use the specified phy address.
pktque=num Limit the number of packets in the queue. The default is 100.
single Configure and run only the first DM9102 card that is found
(single instance).
speed=10|100 Media data rate (10 Mbit or 100 Mbit operation). The default is
automatically detected on supported hardware. If you specify
speed, specify duplex as well; if speed alone is specified, the
specified speed will be correctly set, but duplex will default to
half (0).
threshold=N The amount of packet data that must be in the TX FIFO before
transmission is initiated. The range is 0–4. The default is 3.
verbose Be verbose.
Description:
The devn-dm9102 driver controls Davicom DM9102 Ethernet adapters. This is a
legacy io-net driver; its interface names are in the form enX, where X is an integer.
If the device enumerators (see enum-devices) don’t recognize your device, try
explicitly specifying the device ID with the did option when you start the driver.
Some devices support hardware checksums, although some might do so in only one
direction; to determine if your device does, type:
ifconfig enX
and look for the following in the list of supported options:
You can then use ifconfig to enable or disable whichever of these options your
device supports.
Examples:
Start io-pkt-v4-hc using the DM9102 driver:
io-pkt-v4-hc -d dm9102
ifconfig en0 10.0.0.184
Files:
/dev/io-net The directory where, by default, drivers and protocol modules add
entries. For more information, see the documentation for
io-pkt*.
See also:
devn-*, devnp-*, ifconfig, io-pkt*, nicinfo
Syntax:
io-pkt-variant -d el509 [option[,option ...]] ... &
where variant is one of v4, v4-hc, or v6-hc.
Runs on:
Neutrino
Options:
Use commas, not spaces, to separate the options.
0 BNC
1 UTP
2 AUI
3 FIBER
mac=XXXXXXXXXXXX
MAC address of controller. The default is automatically
detected on supported hardware.
mtu=X Maximum transmission unit. The default is automatically
detected on supported hardware.
nomulticast Disables the driver from sending or receiving multicast
packets. By default, multicast is enabled.
pcmcia Flag to indicate a PCMCIA device to the driver.
promiscuous Enable promiscuous mode. The default is off.
verbose
verbose=num Be verbose. Specify num for more verbosity (num can be 1-4,
the higher the number, the more detailed the output). The
output goes to slogger, invoke sloginfo to view.
Description:
The devn-el509.so driver controls 3Com 509 ISA Ethernet adapters.
CAUTION: This driver can’t always detect the correct irq and ioport options,
! especially for ISA devices. To be sure, always specify irq and ioport when using
this driver.
Examples:
Start io-pkt-v6-hc using the 509 ISA Ethernet adapter driver:
Files:
/dev/io-net The directory where, by default, drivers and protocol modules add
entries. For more information, see the documentation for
io-pkt*.
See also:
devn-*, devnp-*, ifconfig, io-pkt*, nicinfo
Syntax:
io-pkt-variant -d el900 [option[,option ...]] ... &
where variant is one of v4, v4-hc, or v6-hc.
Runs on:
Neutrino
Options:
Use commas, not spaces, to separate the options.
connector=0|1|2|3
Network cable connector type:
0 BNC
1 UTP
2 AUI
3 FIBER
duplex=0|1 Half (0) or full (1) duplex mode. The default is automatically
detected on supported hardware. If you specify duplex, specify
speed as well; if duplex alone is specified, it is ignored and both
speed and duplex are auto-negotiated.
mac=XXXXXXXXXXXX
MAC address of controller. The default is automatically detected
on supported hardware.
verbose
verbose=num Be verbose. Specify num for more verbosity (num can be 1-4, the
higher the number, the more detailed the output). The output
goes to slogger; invoke sloginfo to view it.
Description:
The devn-el900.so driver controls 3Com 90x Network Interface Cards (NICs). The
IRQ of the interface is automatically detected on supported hardware. This is a legacy
io-net driver; its interface names are in the form enX, where X is an integer.
If the device enumerators (see enum-devices) don’t recognize your device, try
explicitly specifying the device ID with the did option when you start the driver.
Some devices support hardware checksums, although some might do so in only one
direction; to determine if your device does, type:
ifconfig enX
and look for the following in the list of supported options:
You can then use ifconfig to enable or disable whichever of these options your
device supports.
Examples:
Start io-pkt-v6-hc using the 90x NIC driver:
io-pkt-v6-hc -d el900 verbose
ifconfig en0 10.1.0.184
Files:
/dev/io-net The directory where, by default, drivers and protocol modules add
entries. For more information, see the documentation for
io-pkt*.
See also:
devn-*, devnp-*, ifconfig, io-pkt*, nicinfo
Syntax:
io-pkt-variant -d epic [option[,option ...]] ... &
where variant is one of v4, v4-hc, or v6-hc.
Runs on:
Neutrino
Options:
Use commas, not spaces, to separate the options.
connector=0|1|3
Network cable connector type:
0 BNC
1 UTP
3 FIBER
duplex=0|1 Half (0) or full (1) duplex mode. The default is automatically
detected on supported hardware. If you specify duplex, specify
speed as well; if duplex alone is specified, it is ignored and
both speed and duplex are auto-negotiated.
mac=XXXXXXXXXXXX
MAC address of controller. The default is automatically
detected on supported hardware.
single Use this option if you have multiple Epic cards in your system
and want to configure them differently. The single option tells
the driver to stop after configuring the first Epic card it finds.
The order of the search can’t be determined because it depends
on the PCI server and PCI BIOS used. After the first card has
been configured, when the driver is invoked again, it will find
and configure the next card in order, and so on until all Epic
cards have been configured. The default is to enable all Epic
cards found.
Description:
The devn-epic.so driver controls SMC 9432 (EPIC) Ethernet adapters. This is a
legacy io-net driver; its interface names are in the form enX, where X is an integer.
If the device enumerators (see enum-devices) don’t recognize your device, try
explicitly specifying the device ID with the did option when you start the driver.
Some devices support hardware checksums, although some might do so in only one
direction; to determine if your device does, type:
ifconfig enX
and look for the following in the list of supported options:
You can then use ifconfig to enable or disable whichever of these options your
device supports.
Examples:
Start io-pkt-v6-hc using the EPIC driver:
Files:
/dev/io-net The directory where, by default, drivers and protocol modules add
entries. For more information, see the documentation for
io-pkt*.
See also:
devn-*, devnp-*, ifconfig, io-pkt*, nicinfo
Syntax:
io-pkt-variant -d fd fd=device[,option[,option ...]] ... &
Runs on:
Neutrino
Options:
Use commas, not spaces, to separate the options.
fd=device The device on which to open the file descriptor to read or write
packet data. You must specify this option.
mac=XXXXXXXXXXXX
The MAC address of the controller. There is no default.
verbose
verbose=num Be verbose. Specify num for more verbosity (num can be 1-4, the
higher the number, the more detailed the output). The default is 0.
The output goes to slogger, invoke sloginfo to view.
Description:
The devn-fd.so driver uses file-descriptor based I/O (i.e. open(), read(), write(), and
so on) to receive and transmit packets. It provides the Network Manager (io-pkt*)
with reliable data transfer over any media supported by a file-descriptor-based server
process.
For example, you could use devn-fd.so to connect two machines with a null-modem
RS-232 serial cable. By using file-descriptor I/O to the serial devices, devn-fd.so
would implicitly use a serial driver and set up a logical network link.
This is a legacy io-net driver; its interface names are in the form enX, where X is an
integer.
Examples:
Start io-pkt-v4-hc using the FD driver:
io-pkt-v4-hc -d fd fd=/dev/ser1,mac=0023456789AB,ahdlc
ifconfig en0 10.0.184
Files:
/dev/io-net The directory where, by default, drivers and protocol modules add
entries. For more information, see the documentation for
io-pkt*.
Caveats:
You must specify the fd option when using this driver.
See also:
devn-*, devnp-*, ifconfig, io-pkt*, nicinfo
Syntax:
io-pkt-variant -d /lib/dll/devn-i82544.so
[option[,option ...]] ... &
where variant is one of v4, v4-hc, or v6-hc.
Runs on:
Neutrino
Options:
Use commas, not spaces, to separate the options.
did=0xXXXX Detect only devices with the given PCI device ID. The default is
automatically detected on supported hardware.
duplex=0|1 Half (0) or full (1) duplex mode. The default is automatically
detected on supported hardware. If you specify duplex, specify
speed as well; if you specify duplex alone, it’s ignored, and
both speed and duplex are auto-negotiated.
flowcontrol=0|1
Disable (0) or enable (1) hardware flow control.
mac=XXXXXXXXXXXX
MAC address of controller. The default is automatically
detected on supported hardware.
pauseignore Ignore pause frames with respect to full duplex flow control.
pausesuppress Suppress pause frames with respect to full duplex flow control.
Description:
The devn-i82544.so driver manages the Intel 82540, 82541, 82542, 82543, 82544,
82545, 82546, 82547, 82571, 82572, and 82573 Gigabit Ethernet LAN adapters, and
the ICH8 and ICH9 I/O Controller Hubs. This is a legacy io-net driver; its interface
names are in the form enX, where X is an integer.
If the device enumerators (see enum-devices) don’t recognize your device, try
explicitly specifying the device ID with the did option when you start the driver.
Some devices support hardware checksums, although some might do so in only one
direction; to determine if your device does, type:
ifconfig enX
and look for the following in the list of supported options:
• ip4csum, ip4csum-rx, ip4csum-tx
• tcp4csum, tcp4csum-rx, tcp4csum-tx
• tcp6csum, tcp6csum-rx, tcp6csum-tx
• udp4csum, udp4csum-rx, udp4csum-tx
• udp6csum, udp6csum-rx, udp6csum-tx
You can then use ifconfig to enable or disable whichever of these options your
device supports.
Examples:
Start io-pkt-v4-hc using the devn-i82544.so driver:
io-pkt-v4-hc -d /lib/dll/devn-i82544.so
ifconfig en0 10.1.0.184
Files:
/dev/io-net The directory where, by default, drivers and protocol modules add
entries. For more information, see the documentation for io-pkt*
See also:
devn-*, devnp-*, ifconfig, io-pkt*, nicinfo
Syntax:
io-pkt-variant -d micrel8841 [option[,option ...]] ... &
Runs on:
Neutrino
Options:
Use commas, not spaces, to separate the options.
duplex=0|1 Half (0) or full (1) duplex mode. The default is automatically
detected on supported hardware. If you specify duplex, specify
speed as well; if duplex alone is specified, it is ignored and both
speed and duplex are autonegotiated.
multicast Enable the receipt of all multicast packets, all ports. By default,
the receipt of multicast packets is disabled.
port0=num 1 means power down port 0 PHY (the default is 0, power on).
port1=num 1 means power down port 1 PHY (the default is 0, power on) on
the 8842 (2 port).
priority=N The priority of the driver’s event thread. The default is 21.
promiscuous Allow the driver to pass all data packets received, regardless of
the address. By default, promiscuous mode is disabled.
This is very dangerous if you loop the network because of the resulting packet storms.
verbose
verbose=N Be verbose. Specify num for more verbosity (num can be 1-4; the
higher the number, the more detailed the output). The default is
0. The output goes to slogger; invoke sloginfo to view it.
Description:
The devn-micrel8841.so driver controls Micrel 8841 (1 port) or 8842 (2 port)
Ethernet controllers. This is a legacy io-net driver; its interface names are in the
form enX, where X is an integer.
This driver supports only PCI versions of the Micrel 8841 (1 port) and 8842 (2 port)
Ethernet controllers.
This driver supports hardware checksum calculations for both Tx and Rx of IP and
TCP packets (UDP isn’t supported). To enable hardware checksumming, use
ifconfig like this, after starting the driver:
Examples:
Start io-pkt-v6-hc using the devn-micrel8841.so driver and Qnet with 1024
transmit descriptors, and 1024 receive descriptors to avoid packet loss due to
scheduling latency on slow processors:
Files:
/dev/io-net The directory where, by default, drivers and protocol modules add
entries. For more information, see the documentation for
io-pkt*.
See also:
devn-*, devnp-*, ifconfig, io-pkt*, nicinfo
Syntax:
io-pkt-variant -d ne2000 [option[,option ...]] ...
Runs on:
Neutrino
Options:
Use commas, not spaces, to separate the options.
ioport=num I/O port of the interface. The port parameter must be a hex
address (e.g. 0x320). The default is automatically detected on
supported hardware (but see caution below).
mac=XXXXXXXXXXXX
MAC address of the controller. The default is automatically
detected on supported hardware.
verbose
verbose=num Be verbose. Specify num for more verbosity (num can be 1-4, the
higher the number, the more detailed the output). The output goes
to slogger, invoke sloginfo to view.
Description:
The devn-ne2000.so driver controls NE-2000-compatible Ethernet adapters.
CAUTION: This driver can’t always detect the correct irq and ioport options,
! especially for ISA devices. To be sure, always specify irq and ioport when using
this driver.
This is a legacy io-net driver; its interface names are in the form enX, where X is an
integer.
If the device enumerators (see enum-devices) don’t recognize your device, try
explicitly specifying the device ID with the did option when you start the driver.
Some devices support hardware checksums, although some might do so in only one
direction; to determine if your device does, type:
ifconfig enX
and look for the following in the list of supported options:
You can then use ifconfig to enable or disable whichever of these options your
device supports.
Examples:
Start io-pkt-v4-hc using the NE-2000 driver:
Files:
/dev/io-net The directory where, by default, drivers and protocol modules add
entries. For more information, see the documentation for
io-pkt*.
Caveats:
If you’re running a PCMCIA NE2000-compatible adapter, you may need to specify
the -w8 command-line option of devp-pccard.
See also:
devn-*, devnp-*, devp-pccard, ifconfig, io-pkt*, nicinfo
Syntax:
io-pkt-variant -d pcnet [option[,option ...]] ...
Runs on:
Neutrino
Options:
Use commas, not spaces, to separate the options.
connector=0|1|2|3
Network cable connector type:
0 BNC
1 UTP
2 AUI
3 FIBER
deviceindex=0xXXXX
Only attach to device with this PCI index.
duplex=0|1 Half (0) or full (1) duplex mode. The default is automatically
detected on supported hardware. If you specify duplex, specify
speed as well; if duplex alone is specified, it is ignored and
both speed and duplex are auto-negotiated.
iorange=0xXXXXXXXX
The I/O base address.
mac=XXXXXXXXXXXX
MAC address of the controller. The default is automatically
detected on supported hardware.
media=num Media type (from <hw/nicinfo.h>). The default is
NIC_MEDIA_802_3.
memrange=0xXXXXXXXX
Register base physical memory address.
mmap Use memory-mapped registers. The default is IO mapped.
mru=num Maximum receive unit. The default is 1514.
mtu=num Maximum transmission unit. The default (1514) is
automatically detected on supported hardware.
nomulticast Disables the driver from sending or receiving multicast packets.
By default, multicast is enabled.
pci=0xXXXX PCI index of the controller. The default is automatically
detected on supported hardware.
phy=num Address of the connected PHY device.
priority=N Priority of the driver event-thread. The default is 21.
probe_phy=0|1 Select whether or not to probe the PHY at regular intervals. For
the default value of 0, the PHY is polled only at regular
intervals when the interface is down or doesn’t receive any
packets over the polling interval. If you specify 1, the PHY is
always probed at regular intervals to see if the duplex and/or
speed of the connection has changed.
promiscuous Enable promiscuous mode. The default is off.
receive=num Set the number of receive descriptors/buffers. The default is 64.
speed=10|100 Media data rate (10Mbit or 100Mbit operation). The default is
automatically detected on supported hardware. If you specify
speed, specify duplex as well; if speed alone is specified, the
specified speed will be correctly set, but duplex will default to
half (0).
transmit=num Number of transmit descriptors/buffers. The default is 128.
uptype=name Interface name. The default is “en”.
verbose
verbose=num Be verbose. Specify num for more verbosity (num can be 1-4,
the higher the number, the more detailed the output). The
default is 0. The output goes to slogger; invoke sloginfo to
view it.
Description:
The devn-pcnet.so driver controls AMD PCNET (AMD-79c97x) compatible
Ethernet adapters. This is a legacy io-net driver; its interface names are in the form
enX, where X is an integer.
• If the device enumerators (see enum-devices) don’t recognize your device, try
explicitly specifying the device ID with the did option when you start the driver.
• This driver doesn’t support Fiber PCNET cards with the AM79C971KC chip.
Some devices support hardware checksums, although some might do so in only one
direction; to determine if your device does, type:
ifconfig enX
and look for the following in the list of supported options:
You can then use ifconfig to enable or disable whichever of these options your
device supports.
Examples:
Start io-pkt-v4-hc using the AMD PCNET driver:
io-pkt-v4-hc -d pcnet
ifconfig en0 10.1.0.184
Files:
/dev/io-net The directory where, by default, drivers and protocol modules add
entries. For more information, see the documentation for
io-pkt*.
See also:
devn-*, devnp-*, ifconfig, io-pkt*, nicinfo
Syntax:
io-pkt-variant -d pegasus [option[,option ...]] ...
where variant is one of v4, v4-hc, or v6-hc.
Runs on:
Neutrino
Options:
Use commas, not spaces, to separate the options.
mac=XXXXXXXXXXXX
MAC address of the controller. You must set the MAC address
for this controller.
probe_phy=0|1 Select whether or not to probe the PHY at regular intervals. For
the default value of 0, the PHY is polled only at regular
intervals when the interface is down or doesn’t receive any
packets over the polling interval. If you specify 1, the PHY is
always probed at regular intervals to see if the duplex and/or
speed of the connection has changed.
verbose
verbose=num Be verbose. Specify num for more verbosity (num can be 1-4,
the higher the number, the more detailed the output). The
default is 0. The output goes to slogger; invoke sloginfo to
view it.
wait=num Wait num seconds for the USB stack. The default wait time is
60 seconds.
Description:
The devn-pegasus.so driver controls the SMC EZ Connect USB Ethernet adapter
and other USB Ethernet adapters based on the Pegasus chipset. This is a legacy
io-net driver; its interface names are in the form enX, where X is an integer.
Some devices support hardware checksums, although some might do so in only one
direction; to determine if your device does, type:
ifconfig enX
and look for the following in the list of supported options:
You can then use ifconfig to enable or disable whichever of these options your
device supports.
Examples:
Start io-pkt-v6-hc using the Pegasus driver:
io-pkt-v6-hc -d pegasus
ifconfig en0 10.1.0.184
Files:
/dev/io-net The directory where, by default, drivers and protocol modules add
entries. For more information, see the documentation for
io-pkt*.
Caveats:
Start the USB stack before using this driver (see devu-ohci.so or devu-uhci.so)
See also:
devn-*, devnp-*, devu-ohci.so, devu-uhci.so, ifconfig, io-pkt*,
nicinfo
Syntax:
io-pkt-variant -d rtl [option[,option ...]] ...
where variant is one of v4, v4-hc, or v6-hc.
Runs on:
Neutrino
Options:
Use commas, not spaces, to separate the options.
connector=0|1|2|3
Network cable connector type:
0 BNC
1 UTP
2 AUI
3 FIBER
deviceindex=0xXXXX
PCI index of the controller. Only attach to device with this PCI
index.
duplex=0|1 Half (0) or full (1) duplex mode. The default is automatically
detected on supported hardware. If you specify duplex, specify
speed as well; if duplex alone is specified, it is ignored and
both speed and duplex are auto-negotiated.
iorange=0xXXXXXXXX
The I/O base address. The 0xXXXXXXXX parameter must be a
hex address (e.g. 0x320). The default is automatically detected
on supported hardware.
mac=XXXXXXXXXXXX
MAC address of controller. The default is automatically
detected on supported hardware.
memrange=0xXXXXXXXX
Register base physical memory address.
probe_phy=0|1 Select whether or not to probe the PHY at regular intervals. For
the default value of 0, the PHY is polled only at regular
intervals when the interface is down or doesn’t receive any
packets over the polling interval. If you specify 1, the PHY is
always probed at regular intervals to see if the duplex and/or
speed of the connection has changed.
verbose
verbose=num Be verbose. Specify num for more verbosity (num can be 1-4,
the higher the number, the more detailed the output). The
default is 0. The output goes to slogger; invoke sloginfo to
view it.
Description:
The devn-rtl.so driver controls Realtek 8139 PCI cards. This is a legacy io-net
driver; its interface names are in the form enX, where X is an integer.
If the device enumerators (see enum-devices) don’t recognize your device, try
explicitly specifying the device ID with the did option when you start the driver.
Some devices support hardware checksums, although some might do so in only one
direction; to determine if your device does, type:
ifconfig enX
and look for the following in the list of supported options:
You can then use ifconfig to enable or disable whichever of these options your
device supports.
Examples:
Start io-pkt-v4-hc using the Realtek 8139 PCI card driver:
io-pkt-v4-hc -d rtl
ifconfig en0 10.1.0.184
Files:
/dev/io-net The directory where, by default, drivers and protocol modules add
entries. For more information, see the documentation for
io-pkt*.
See also:
devn-*, devnp-*, ifconfig, io-pkt*, nicinfo
Syntax:
io-pkt-variant -d rtl8150 [option[,option ...]] ...
Runs on:
Neutrino
Options:
Use commas, not spaces, to separate the options.
On the SH platform, the lan= option gets overridden. As a workaround, fully specify
the vendor ID, device ID, bus number, and device number to the driver when starting
(e.g. vid=0x0bda,did=0x8150,busnum=1,devnum=2,lan=2).
mac=XXXXXXXXXXXX
The MAC address of the adapter. The default is automatically
detected on supported hardware.
Description:
The devn-rtl8150.so driver controls the Realtek 8150 Ethernet dongle, which is
included in SMC2208 USB/Ethernet adapters. This is a legacy io-net driver; its
interface names are in the form enX, where X is an integer.
• If the device enumerators (see enum-devices) don’t recognize your device, try
explicitly specifying the device ID with the did option when you start the driver.
Some devices support hardware checksums, although some might do so in only one
direction; to determine if your device does, type:
ifconfig enX
and look for the following in the list of supported options:
• ip4csum, ip4csum-rx, ip4csum-tx
• tcp4csum, tcp4csum-rx, tcp4csum-tx
• tcp6csum, tcp6csum-rx, tcp6csum-tx
• udp4csum, udp4csum-rx, udp4csum-tx
• udp6csum, udp6csum-rx, udp6csum-tx
You can then use ifconfig to enable or disable whichever of these options your
device supports.
Examples:
Start io-pkt-v6-hc using the Realtek driver:
Files:
/dev/io-net The directory where, by default, drivers and protocol modules add
entries. For more information, see the documentation for
io-pkt*.
See also:
devn-*, devnp-*, ifconfig, io-pkt*, nicinfo
Syntax:
io-pkt-variant -d sis9 [option[,option ...]] ... &
where variant is one of v4, v4-hc, or v6-hc.
Runs on:
Neutrino
Options:
Use commas, not spaces, to separate the options.
connector=0|1|2|3
Network cable connector type:
0 BNC
1 UTP
2 AUI
3 FIBER
deviceindex=0xXXXX
PCI index of the controller. Only attach to device with this PCI
index.
duplex=0|1 Half (0) or full (1) duplex mode. The default is automatically
detected on supported hardware. If you specify duplex, specify
speed as well; if duplex alone is specified, it is ignored and
both speed and duplex are auto-negotiated.
iorange=0xXXXXXXXX
The I/O base address. The 0xXXXXXXXX parameter must be a
hex address (e.g. 0x320). The default is automatically detected
on supported hardware.
mac=XXXXXXXXXXXX
MAC address of controller. The default is automatically
detected on supported hardware.
memrange=0xXXXXXXXX
Register base physical memory address.
verbose
verbose=N Be verbose. Specify num for more verbosity (num can be 1-4,
the higher the number, the more detailed the output). The default
is 0. The output goes to slogger, invoke sloginfo to view.
Description:
The devn-sis9.so driver controls the SiS900 Ethernet controller and compatibles.
You can use ifconfig to enable hardware checksums if supported.
Examples:
Start io-pkt-v6-hc using the SiS900 driver:
io-pkt-v6-hc -d sis9
ifconfig en0 10.1.0.184
Files:
/dev/io-net The directory where, by default, drivers and protocol modules add
entries. For more information, see the documentation for
io-pkt*.
See also:
devn-*, devnp-*, ifconfig, io-pkt*, nicinfo
Syntax:
io-pkt-variant -d smc9000 [,option[,option ...]] ...
where variant is one of v4, v4-hc, or v6-hc.
Runs on:
Neutrino
Options:
Use commas, not spaces, to separate the options.
connector=0|1|2
Network cable connector type:
0 BNC
1 UTP
2 AUI
duplex=0|1 Half (0) or full (1) duplex mode. The default is automatically
detected on supported hardware. If you specify duplex,
specify speed as well; if duplex alone is specified, it is ignored
and both speed and duplex are auto-negotiated.
iorange=0xXXXXXXXX
The I/O base address. The 0xXXXXXXXX parameter must be a
hex address (e.g. 0x320). The default is automatically detected
on supported hardware (but see caution below).
mac=XXXXXXXXXXXX
MAC address of the controller. You must set the MAC address
for this controller.
pktque=num Set the maximum number of packets that will be queued for
transmission in system RAM. The default is 100.
pmmparent=string Override the parent component of the path to register for Power
Management.
txcap=num Set the maximum number of packets that will be queued for
transmission in on-chip SRAM. On the 91c111 the default is 1,
since the amount of on-chip memory is limited to 4 packets.
Limiting the number of transmit packets prevents packet
transmission from using up all the SRAM, and makes more
SRAM available for receive. This prevents packet overruns on
receive. For other chips with more on-chip SRAM, the limit is
32 packets.
verbose
verbose=num Be verbose. Specify num for more verbosity (num can be 1-4,
the higher the number, the more detailed the output). The
default is 0. The output goes to slogger; invoke sloginfo to
view it.
width=8|16|32 I/O access width (8, 16, or 32 bits). The default is 16.
! CAUTION: An incorrect width size can lock up the card or the platform CPU.
If you specify the variant option, the width option may be ignored.
Description:
The devn-smc9000.so driver controls SMC 91c9x/91c1xx compatible Ethernet
adapters. This is a legacy io-net driver; its interface names are in the form enX,
where X is an integer.
CAUTION: This driver can’t always detect the correct irq and iorange options,
! especially for ISA devices. To be sure, always specify irq and iorange when using
this driver.
Some devices support hardware checksums, although some might do so in only one
direction; to determine if your device does, type:
ifconfig enX
and look for the following in the list of supported options:
You can then use ifconfig to enable or disable whichever of these options your
device supports.
Examples:
Start io-pkt-v4-hc using the SMC9000 driver:
Files:
/dev/io-net The directory where, by default, drivers and protocol modules add
entries. For more information, see the documentation for
io-pkt*.
Caveats:
You must specify the mac option when using this driver.
See also:
devn-*, devnp-*, ifconfig, io-pkt*, nicinfo
Syntax:
io-pkt-variant -d /lib/dll/devn-speedo.so
[[index:option[,[index:option ...]] ... &
Runs on:
Neutrino
Options:
Use commas, not spaces, to separate the options.
did=0xXXXX Device ID. Only attach to device with this PCI index. The
default is automatically detected on supported hardware.
duplex=0|1 Half (0) or full (1) duplex mode. The default is automatically
detected on supported hardware. If you specify duplex, specify
speed as well; if duplex alone is specified, it is ignored and
both speed and duplex are auto-negotiated.
mac=XXXXXXXXXXXX
MAC address of controller. The default is automatically
detected on supported hardware.
probe_phy=0|1 Select whether or not to probe the PHY at regular intervals. For
the default value of 0, the PHY is polled only at regular
intervals when the interface is down or doesn’t receive any
packets over the polling interval.
If you specify 1, the PHY is always probed at regular intervals
to see if the duplex and/or speed of the connection has changed.
This results in reduced performance due to lost packets under
heavy load, but guarantees the NIC is always in sync with the
media.
speed=10|100 Media data rate (10Mbit or 100Mbit operation). The default (0)
is automatically detected on supported hardware. If you specify
speed, specify duplex as well; if speed alone is specified, the
specified speed will be correctly set, but duplex will default to
half (0).
verbose
verbose=num Be verbose. Specify num for more verbosity (num can be 1-4,
the higher the number, the more detailed the output). The output
goes to slogger, invoke sloginfo to view.
vid=0xXXXX The PCI vendor ID of the controller. Only attach to devices with
this PCI vendor ID. The default is automatically detected on
supported hardware.
Description:
The devn-speedo.so driver manages the Intel 82557, 82558, and 82559 Fast
Ethernet LAN adapters. This is a legacy io-net driver; its interface names are in the
form enX, where X is an integer.
If the device enumerators (see enum-devices) don’t recognize your device, try
explicitly specifying the device ID with the did option when you start the driver.
Some devices support hardware checksums, although some might do so in only one
direction; to determine if your device does, type:
ifconfig enX
and look for the following in the list of supported options:
You can then use ifconfig to enable or disable whichever of these options your
device supports.
Examples:
Start io-pkt-v6-hc using the devn-speedo.so driver:
io-pkt-v6-hc -d /lib/dll/devn-speedo.so
ifconfig en0 10.1.0.184
For the second instance of the device in the system, start io-pkt-v6-hc using the
devn-speedo.so driver. Use increased verbosity and override the default #MAC
address:
Files:
/dev/io-net The directory where, by default, drivers and protocol modules add
entries. For more information, see the documentation for io-pkt*
See also:
devn-*, devnp-*, ifconfig, io-pkt*, nicinfo
Syntax:
io-pkt-variant -d tigon3 [option[,option ...]] ...&
where variant is one of v4, v4-hc, or v6-hc.
Runs on:
Neutrino
Options:
Use commas, not spaces, to separate the options.
0 BNC
1 UTP
3 FIBER
duplex=dup Half (0) or full (1) duplex mode. The default is automatically
detected on supported hardware. If you specify duplex,
specify speed as well; if duplex alone is specified, it’s ignored,
and both speed and duplex are autonegotiated.
mac=XXXXXXXXXXXX
The MAC address of the controller. The default is
automatically detected on supported hardware.
promiscuous=0|1 If set to 1, enable the driver to pass all data packets received,
regardless of address. The default is 0.
speed=10|100|1000
The media data rate, in megabits per second. The default is
automatically detected on supported hardware. If you specify
speed, specify duplex as well; if speed alone is specified, the
specified speed will be correctly set, but duplex will default to
half (0).
verbose
verbose=num Be verbose. Specify num for more verbosity (num can be 1-4;
the higher the number, the more detailed the output). The
output goes to slogger; invoke sloginfo to view it.
Description:
The devn-tigon3.so driver is the Ethernet controller for the Broadcom BCM570X.
This is a legacy io-net driver; its interface names are in the form enX, where X is an
integer.
• If the device enumerators (see enum-devices) don’t recognize your device, try
explicitly specifying the device ID with the did option when you start the driver.
• This driver on the Dell PowerEdge 850 board runs only up to 100 Mbit/s, and not
1000 Mbit/s. Other boards work well at 1000 Mbit/s.
Some devices support hardware checksums, although some might do so in only one
direction; to determine if your device does, type:
ifconfig enX
and look for the following in the list of supported options:
You can then use ifconfig to enable or disable whichever of these options your
device supports.
Examples:
Start io-pkt-v4 using the TIGON3 driver:
Files:
/dev/io-net The directory where, by default, drivers and protocol modules add
entries. For more information, see the documentation for
io-pkt*.
See also:
devn-*, devnp-*, ifconfig, io-pkt*, nicinfo
Syntax:
io-pkt-variant -d tulip [option[,option ...]] ... &
where variant is one of v4, v4-hc, or v6-hc.
Runs on:
Neutrino
Options:
Use commas, not spaces, to separate the options.
connector=0|1|2|3
Network cable connector type:
0 BNC
1 UTP
2 AUI
3 FIBER
duplex=0|1 Half (0) or full (1) duplex mode. The default is automatically
detected on supported hardware. If you specify duplex, specify
speed as well; if duplex alone is specified, it is ignored and
both speed and duplex are auto-negotiated.
mac=XXXXXXXXXXXX
MAC address of the controller. If no SROM is available, the
MAC will default to 00:00:00:00:00:00.
nosrom Informs the driver that there is no valid connected SROM: the
driver will default to using media independent interface (MII),
physical media interface (PHY) auto-negotiation. (A valid MAC
address must be supplied on the command line.)
phyaddr=num Override the MII routines and use the specified PHY address.
pktque=num Limit the number of packets in the queue. The default is 100.
promiscuous Enable the driver to pass all data packets received, regardless of
address. By default, promiscuous mode is disabled.
single Use this option if you have multiple Tulip cards in your system
and want to configure them differently. The single option tells
the driver to stop after configuring the first Tulip card it finds.
The order of the search can’t be determined because it depends
on the PCI server and PCI BIOS used. After the first card has
been configured, when the driver is invoked again, it will find
and configure the next card in order, and so on until all Tulip
cards have been configured. The default is to enable all Tulip
cards found.
verbose
verbose=num Be verbose. Specify num for more verbosity (num can be 1-4,
the higher the number, the more detailed the output). The output
goes to slogger, invoke sloginfo to view.
Description:
The devn-tulip.so driver controls DEC 21x4x (Tulip) compatible Ethernet
adapters. This is a legacy io-net driver; its interface names are in the form enX,
where X is an integer.
When you start a single instance of the Tulip driver on a multiport board (using the
pci= option), the board might not function unless this instance is on the first interface.
On NICs with multiple interfaces sharing a single SROM, the first NIC is the only one
that can read the SROM.
Some devices support hardware checksums, although some might do so in only one
direction; to determine if your device does, type:
ifconfig enX
and look for the following in the list of supported options:
You can then use ifconfig to enable or disable whichever of these options your
device supports.
Examples:
Start io-pkt-v6-hc using the Tulip driver:
io-pkt-v6-hc -d tulip
ifconfig en0 10.0.0.184
Files:
/dev/io-net The directory where, by default, drivers and protocol modules add
entries. For more information, see the documentation for
io-pkt*.
See also:
devn-*, devnp-*, ifconfig, io-pkt*, nicinfo
Syntax:
io-pkt-variant -d via-rhine [option[,option ...]] ...
where variant is one of v4, v4-hc, or v6-hc.
Runs on:
Neutrino
Options:
Use commas, not spaces, to separate the options.
connector=0|1|2|3
Network cable connector type.
0 BNC
1 UTP
2 AUI
3 FIBER
deviceindex=0xXXXX
Only attach to a device with this PCI index.
duplex=0|1 Half (0) or full (1) duplex mode. The default is automatically
detected on supported hardware. If you specify duplex, specify
speed as well; if duplex alone is specified, it is ignored and
both speed and duplex are auto-negotiated.
iorange=0xXXXXXXXX
The IO base address.
mac=XXXXXXXXXXXX
MAC address of controller. The default is automatically
detected on supported hardware.
memrange=0xXXXXXXXX
Register base physical memory address.
promiscuous=0|1
If set to 1, enable the driver to pass all data packets received,
regardless of address. The default is 0.
verbose
verbose=num Be verbose. Specify num for more verbosity (num can be 1-4,
the higher the number, the more detailed the output). The output
goes to slogger, invoke sloginfo to view.
Description:
The devn-via-rhine.so driver controls VIA Rhine Network Interface Cards
(NICs). This is a legacy io-net driver; its interface names are in the form enX, where
X is an integer.
If the device enumerators (see enum-devices) don’t recognize your device, try
explicitly specifying the device ID with the did option when you start the driver.
Some devices support hardware checksums, although some might do so in only one
direction; to determine if your device does, type:
ifconfig enX
and look for the following in the list of supported options:
You can then use ifconfig to enable or disable whichever of these options your
device supports.
Examples:
Start io-pkt-v4-hc using the VIA Rhine NIC driver:
io-pkt-v4-hc -d via-rhine
ifconfig en0 10.1.0.184
Files:
/dev/io-net The directory where, by default, drivers and protocol modules add
entries. For more information, see the documentation for
io-pkt*.
See also:
devn-*, devnp-*, ifconfig, io-pkt*, nicinfo
Syntax:
io-pkt-variant -d ath ... &
Runs on:
Neutrino
Options:
None
Description:
The devnp-ath.so driver supports wireless network adapters based on the Atheros
AR5210, AR5211, AR5212, and AR5213 chips. Chip-specific support is provided by
the Atheros Hardware Access Layer (HAL) (which isn’t available in source format).
This is a ported NetBSD driver; its interface names are in the form athX, where X is
an integer.
Supported features include 802.11 and 802.3 frames, power management, BSS, IBSS,
and host-based access point operation modes. All host/device interaction is via DMA.
The devnp-ath.so driver encapsulates all IP and ARP traffic as 802.11 frames,
however it can receive either 802.11 or 802.3 frames. Transmit speed and operating
mode are selectable, depending on your hardware.
AR5210-based devices support 802.11a operation with transmit speeds of 6 Mbps, 9
Mbps, 12 Mbps, 18 Mbps, 24 Mbps, 36 Mbps, 48 Mbps, and 54 Mbps.
AR5211-based devices support 802.11a and 802.11b operation with transmit speeds as
above for 802.11a operation and 1Mbps, 2Mbps, 5.5 Mbps and 11Mbps for 802.11b
operation.
AR5212-based and AR5213-based devices support 802.11a, 802.11b, and 802.11g
operation with transmit speeds appropriate to each.
The actual transmit speed used is dependent on signal quality and the “rate control”
algorithm employed by the driver. All chips support WEP encryption. AR5211 and
AR5212 support the AES, TKIP, and Michael cryptographic operations required for
WPA, but at this time the driver doesn’t support them. To enable encryption, use
ifconfig.
By default, the devnp-ath.so driver configures the card for BSS operation (also
known as infrastructure mode). This mode requires the use of an access point (base
station).
The devnp-ath.so driver also supports the standard IBSS point-to-point mode,
where stations can communicate amongst themselves without the aid of an access
point.
You can also configure the driver to operate in hostap mode. In this mode, a host may
function as an access point (base station). Access points are different from operating
in IBSS mode. They operate in BSS mode. They allow for easier roaming and bridge
all Ethernet traffic such that machines connected via an access point appear to be on
the local Ethernet segment.
To choose the mode of operation, specify the appropriate mediaopt value to
ifconfig. To view a list of media types and options supported by the card, try
ifconfig -m device. For example, ifconfig -m ath0.
For more information on configuring this device, see ifconfig.
Native io-pkt and ported NetBSD drivers don’t put entries into the /dev/io-net
namespace, so a waitfor command for such an entry won’t work properly in
buildfiles or scripts. Use if_up -p instead; for example, instead of waitfor
/dev/io-net/ath0, use if_up -p ath0.
See also:
devn-*, devnp-*, ifconfig, io-pkt, nicinfo
Syntax:
io-pkt-variant -d axe ... &
Runs on:
Neutrino
Options:
None
Description:
The devnp-axe.so driver supports USB (2.0) Ethernet adapters based on the ASIX
AX88172 chip. This is a ported NetBSD driver; its interface names are in the form
axeX, where X is an integer.
• The version of this driver that we ship is compiled for x86 only. If you want to use
it on other platforms, download the source code for it from Foundry27.
• The USB-Ethernet dongle sometimes drops packets when used on slow systems or
with UHCI. If you encounter problems with this driver, use the legacy
devn-asix.so driver instead.
The chip contains a 10/100 Ethernet MAC with MII interface and is designed to work
with both Ethernet and HomePNA transceivers. The chip also supports USB 2.0,
thereby accommodating 100 Mb/s data rates.
The devnp-axe.so driver supports the following media types:
10baseT/UTP Set 10Mbps operation. You can also use the mediaopt option to
enable full-duplex operation. Not specifying full duplex implies
half-duplex mode.
100baseTX Set 100Mbps (fast Ethernet) operation. You can also use the
mediaopt option to enable full-duplex operation. Not specifying
full duplex implies half-duplex mode.
Native io-pkt and ported NetBSD drivers don’t put entries into the /dev/io-net
namespace, so a waitfor command for such an entry won’t work properly in
buildfiles or scripts. Use if_up -p instead; for example, instead of waitfor
/dev/io-net/axe0, use if_up -p axe0.
See also:
devn-*, devnp-*, ifconfig, io-pkt, nicinfo
Syntax:
io-pkt-variant -d bce ... &
Runs on:
Neutrino
Options:
None
Description:
The devnp-bce.so driver manages the Broadcom BCM440x 10/100 Ethernet
controllers. This is a ported NetBSD driver; its interface names are in the form bceX,
where X is an integer.
Some devices support hardware checksums, although some might do so in only one
direction; to determine if your device does, type:
ifconfig bceX
and look for the following in the list of supported options:
You can then use ifconfig to enable or disable whichever of these options your
device supports.
Native io-pkt and ported NetBSD drivers don’t put entries into the /dev/io-net
namespace, so a waitfor command for such an entry won’t work properly in
buildfiles or scripts. Use if_up -p instead; for example, instead of waitfor
/dev/io-net/bce0, use if_up -p bce0.
Examples:
Start the v4 TCP/IP variant of io-pkt using the devnp-bce.so driver:
io-pkt-v4 -d bce
ifconfig bce0 10.184
See also:
devn-*, devnp-*, ifconfig, io-pkt, nicinfo
Syntax:
io-pkt-variant -d bcm1250 \
memrange=0xXXXXXXXX,irq=0xYYYYYYYY,\
mac=ZZZZZZZZZZZZ[,option[,option ...]] ... &
where variant is one of v4, v4-hc, or v6-hc.
Runs on:
Neutrino
Options:
Use commas, not spaces, to separate the options. These options override the
autodetected defaults.
cluster=X The size of the Rx descriptor data buffers, in bytes. The default
is 2048; 4096 is a good value with the appropriate io-pkt
binary.
duplex=0|1 Half (0) or full (1) duplex mode. The default is automatically
detected on supported hardware. You can also use ifconfig
-m and ifconfig bcmX media to set this.
mac=XXXXXXXXXXXX
The interface address of the controller. You must specify this
option if you aren’t using the syspage option.
memrange=XXXXXXXXXXXX
Register base physical memory address.
probe_phy=0|1 Disable (0) or force (1) periodic PHY probing when idle.
speed=10|100|1000
The media data rate in megabits/second. The default is
automatically detected on supported hardware. You can also use
ifconfig -m and ifconfig bcmX media to set this.
verbose
verbose=N Be verbose. Specify num for more verbosity (num can be 1-4;
the higher the number, the more detailed the output). The
default is 0. The output goes to slogger; invoke sloginfo to
view it.
Description:
The devnp-bcm1250.so driver controls Broadcom BCM1250 10/100/1000 Mbit
Ethernet controllers. This is a native io-pkt driver; its interface names are in the
form bcmX, where X is an integer.
Some devices support hardware checksums, although some might do so in only one
direction; to determine if your device does, type:
ifconfig bcmX
and look for the following in the list of supported options:
You can then use ifconfig to enable or disable whichever of these options your
device supports.
Native io-pkt and ported NetBSD drivers don’t put entries into the /dev/io-net
namespace, so a waitfor command for such an entry won’t work properly in
buildfiles or scripts. Use if_up -p instead; for example, instead of waitfor
/dev/io-net/bcm0, use if_up -p bcm0.
Examples:
Start the v4 TCP/IP variant of io-pkt using the devnp-bcm1250.so driver on
BCM91480A eth0:
io-pkt-v4 -d /proc/boot/devnp-bcm1250.so \
memrange=0x10064000,irq=0x80050024,mac=001122334455
ifconfig bcm0 10.184
See also:
devn-*, devnp-*, ifconfig, io-pkt, nicinfo
Syntax:
io-pkt-variant -d bcm43xx [option[,option ...]] ... &
where variant is one of v4, v4-hc, or v6-hc.
Runs on:
Neutrino
Options:
Use commas (,), not spaces, to separate the options.
mac=XXXXXXXXXXXX
The MAC address of controller. The default is automatically
detected on supported hardware.
pio Run the driver in PIO mode; the default is bus master.
verbose
verbose=num Be verbose. Specify num for more verbosity (num can be 1-4, the
higher the number, the more detailed the output). The output goes
to slogger; invoke sloginfo to view it.
Description:
The devnp-bcm43xx.so driver controls the Broadcom-based 802.11b/g wireless
Ethernet controller. This is a native io-pkt driver; its interface names are in the form
bcmX, where X is an integer.
The devnp-bcm43xx.so driver is fully integrated with the 802.11 layer in the stack.
It supports both infrastructure client and access point modes of operation. For further
information, see ifconfig, wpa_supplicant, and hostapd.
Some devices support hardware checksums, although some might do so in only one
direction; to determine if your device does, type:
ifconfig bcmX
and look for the following in the list of supported options:
You can then use ifconfig to enable or disable whichever of these options your
device supports.
Native io-pkt and ported NetBSD drivers don’t put entries into the /dev/io-net
namespace, so a waitfor command for such an entry won’t work properly in
buildfiles or scripts. Use if_up -p instead; for example, instead of waitfor
/dev/io-net/bcm0, use if_up -p bcm0.
Examples:
Start the v6 variant of io-pkt using the Broadcom 43xx driver:
io-pkt-v6-hc -d bcm43xx
See also:
devn-*, devnp-*, hostapd, ifconfig, io-pkt, nicinfo, wpa_supplicant
Syntax:
io-pkt-variant -d bge ... &
Runs on:
Neutrino
Options:
None
Description:
The devnp-bge.so driver manages the Broadcom 57xx Tigon3 10/100/1000 Mbit
Ethernet controllers. This is a ported NetBSD driver; its interface names are in the
form bgeX, where X is an integer.
Some devices support hardware checksums, although some might do so in only one
direction; to determine if your device does, type:
ifconfig bgeX
and look for the following in the list of supported options:
You can then use ifconfig to enable or disable whichever of these options your
device supports.
Native io-pkt and ported NetBSD drivers don’t put entries into the /dev/io-net
namespace, so a waitfor command for such an entry won’t work properly in
buildfiles or scripts. Use if_up -p instead; for example, instead of waitfor
/dev/io-net/bge0, use if_up -p bge0.
Examples:
Start the v4 TCP/IP variant of io-pkt using the devnp-bge.so driver:
io-pkt-v4 -d bge
ifconfig bge0 10.184
See also:
devn-*, devnp-*, ifconfig, io-pkt, nicinfo
Syntax:
io-pkt-variant -d e1000 [option[,option ...]] ... &
where variant is one of v4, v4-hc, or v6-hc.
Runs on:
Neutrino
Options:
Use commas, not spaces, to separate the options.
did=0xXXXX Detect only devices with this specific PCI Device ID. The
default is automatically detected on supported hardware.
duplex=0|1 Half (0) or full (1) duplex mode. The default is automatically
detected on supported hardware. If you specify duplex, specify
speed as well; if duplex alone is specified, it is ignored and
both speed and duplex are auto-negotiated.
You can also use ifconfig -m and ifconfig wmX media
to set this.
irq=N IRQ of the interface. The default is automatically detected on
supported hardware.
mac=XXXXXXXXXXXX
The MAC address of the controller. The default is automatically
detected on supported hardware.
mtu=N The maximum transmission unit. The default is 1514.
nomulticast Disable the driver from sending or receiving multicast packets.
By default, multicast is enabled.
pauseignore Ignore pause frames with respect to full duplex flow control.
pausesuppress Suppress pause frames with respect to full duplex flow control.
pci=0xXXXX Detect only devices at this specific PCI index.
priority=N The priority of the driver’s event-handler thread (default 21).
receive=num The number of receive descriptors; the default is 64.
speed=N Force the link speed (specified in Mbits/second). If you specify
speed, specify duplex as well; if speed alone is specified, the
specified speed is correctly set, but duplex defaults to half (0).
You can also use ifconfig -m and ifconfig wmX media
to set this.
verbose
verbose=num Be verbose. Specify num for more verbosity (num can be 1-4;
the higher the number, the more detailed the output). The output
goes to slogger; invoke sloginfo to view it.
vid=0xXXXX Detect only devices with this specific PCI Vendor ID.
Description:
The devnp-e1000.so driver manages all current Intel Gigabit devices. This is a
native io-pkt driver; its interface names are in the form wmX, where X is an integer.
The devnp-e1000.so and devnp-i82544.so drivers are similar:
If the device enumerators (see enum-devices) don’t recognize your device, try
explicitly specifying the device ID with the did option when you start the driver.
Some devices support hardware checksums, although some might do so in only one
direction; to determine if your device does, type:
ifconfig wmX
and look for the following in the list of supported options:
You can then use ifconfig to enable or disable whichever of these options your
device supports.
Native io-pkt and ported NetBSD drivers don’t put entries into the /dev/io-net
namespace, so a waitfor command for such an entry won’t work properly in
buildfiles or scripts. Use if_up -p instead; for example, instead of waitfor
/dev/io-net/wm0, use if_up -p wm0.
The SQE (Squelch Test Errors) counter — one of the fields reported by nicinfo —
isn’t applicable to devnp-e1000.so, so this driver uses it in a non-standard way. You
can lose packets because:
• you ran out of descriptors (the NIC was able to buffer the packet, but there was no
CPU RAM available)
or:
• the NIC was unable to buffer the packet because it overran its internal Rx FIFO
Other drivers add the two together, but this driver uses the SQE counter for internal Rx
FIFO overruns, which generally indicate excessive bus latency, perhaps misconfigured
link-level flow control, or even misconfigured Rx FIFO watermarks.
Examples:
Start io-pkt using the devnp-e1000.so driver and the full TCP/IP stack:
io-pkt -d e1000
ifconfig wm0 192.168.0.10
See also:
devn-*, devnp-*, ifconfig, io-pkt, nicinfo
Syntax:
io-pkt-variant -d i80579 [option[,option...]] ... &
where variant is one of v4, v4-hc, or v6-hc.
Runs on:
QNX Neutrino
Options:
did=X Detect only devices with this specific PCI Device ID (e.g.
0x5041, 0x5045, or 0x5049).
verbose=N Set the verbosity level. The default is zero; a larger value for N
yields more output. The output is sent to slogger; invoke
sloginfo to view it.
Description:
The devnp-i80579.so driver manages the Intel Tolapai 80579 Gigabit Ethernet
controller. This is a native io-pkt driver; its interface names are in the form gbeX,
where X is an integer.
Some devices support hardware checksums, although some might do so in only one
direction; to determine if your device does, type:
ifconfig gbeX
and look for the following in the list of supported options:
You can then use ifconfig to enable or disable whichever of these options your
device supports.
Native io-pkt and ported NetBSD drivers don’t put entries into the /dev/io-net
namespace, so a waitfor command for such an entry won’t work properly in
buildfiles or scripts. Use if_up -p instead; for example, instead of waitfor
/dev/io-net/gbe0, use if_up -p gbe0.
Examples:
Start the v4 TCP/IP variant of io-pkt using the devnp-i80579.so driver:
io-pkt-v4 -d i80579
ifconfig gbe0 10.1
ping -n 10.2
See also:
devn-*, devnp-*, ifconfig, io-pkt, nicinfo
Syntax:
io-pkt-variant -d i82544 [option[,option ...]] ... &
Runs on:
Neutrino
Options:
Use commas, not spaces, to separate the options.
did=0xXXXX Detect only devices with this specific PCI Device ID. The default
is automatically detected on supported hardware.
duplex=0|1 Half (0) or full (1) duplex mode. The default is automatically
detected on supported hardware. If you specify duplex, specify
speed as well; if duplex alone is specified, it is ignored and both
speed and duplex are auto-negotiated.
You can also use ifconfig -m and ifconfig wmX media to
set this.
pause_rx_enable
Always act on received pause (flow control) frames.
pause_tx_disable
Never transmit pause (flow control) frames.
pause_tx_enable
Always transmit pause (flow control) frames.
rx_abs=X The receive interrupt absolute delay time multiplier. The default
is 92, and the maximum is 200.
rx_delay=X The receive interrupt delay time multiplier (×1.024 ns). The
default is 23, and the maximum is 50.
speed=10|100|1000
The media data rate (10Mbit, 100Mbit, or Gigabit operation).
The default is automatically detected on supported hardware. If
you specify speed, specify duplex as well; if speed alone is
specified, the specified speed is correctly set, but duplex defaults
to half (0).
You can also use ifconfig -m and ifconfig wmX media to
set this.
verbose
verbose=num Be verbose. Specify num for more verbosity (num can be 1-4; the
higher the number, the more detailed the output). The output
goes to slogger; invoke sloginfo to view it.
vid=0xXXXX Detect only devices with this specific PCI Vendor ID.
Description:
The devnp-i82544.so driver manages the Intel 82540, 82541, 82544, 82545,
82546, 82547, 82571, and 82572 Gigabit Ethernet LAN adapters. This is a native
io-pkt driver; its interface names are in the form wmX, where X is an integer.
The devnp-e1000.so and devnp-i82544.so drivers are similar:
Transmit Segmentation Offload (TSO) allows the stack to send very large TCP buffers
down to the driver, and the driver takes care of carving them up into individual IP
packets of the right size. This can greatly reduce the CPU usage for transmitting large
amounts of data.
If the device enumerators (see enum-devices) don’t recognize your device, try
explicitly specifying the device ID with the did option when you start the driver.
Some devices support hardware checksums, although some might do so in only one
direction; to determine if your device does, type:
ifconfig wmX
and look for the following in the list of supported options:
You can then use ifconfig to enable or disable whichever of these options your
device supports.
Native io-pkt and ported NetBSD drivers don’t put entries into the /dev/io-net
namespace, so a waitfor command for such an entry won’t work properly in
buildfiles or scripts. Use if_up -p instead; for example, instead of waitfor
/dev/io-net/wm0, use if_up -p wm0.
The SQE (Squelch Test Errors) counter — one of the fields reported by nicinfo —
isn’t applicable to devnp-i82544.so, so this driver uses it in a non-standard way.
You can lose packets because:
• you ran out of descriptors (the NIC was able to buffer the packet, but there was no
CPU RAM available)
or:
• the NIC was unable to buffer the packet because it overran its internal Rx FIFO
Other drivers add the two together, but this driver uses the SQE counter for internal Rx
FIFO overruns, which generally indicate excessive bus latency, perhaps misconfigured
link-level flow control, or even misconfigured Rx FIFO watermarks.
Examples:
Start io-pkt using the devnp-i82544.so driver and the full TCP/IP stack:
See also:
devn-*, devnp-*, ifconfig, io-pkt, nicinfo
This driver is shipped only with the BSPs that need it.
Syntax:
io-pkt-variant -d mpcsec [option[,option ...]] ... &
Runs on:
Neutrino
Options:
Use commas, not spaces, to separate the options. Use these options to override the
defaults.
irq=N IRQ of the interface. The driver will attempt to autodetect the
IRQ; if that doesn’t work, you can specify it manually using this
option. Note that the 85xx sec interrupt is 29 (decimal), and the
83xx sec interrupt is 11 (decimal).
Description:
The devnp-mpcsec.so shared object is a Hardware Crypto Engine driver. This is a
native io-pkt driver; its interface names are in the form tsecX, where X is an integer.
Some devices support hardware checksums, although some might do so in only one
direction; to determine if your device does, type:
ifconfig tsecX
and look for the following in the list of supported options:
You can then use ifconfig to enable or disable whichever of these options your
device supports.
Native io-pkt and ported NetBSD drivers don’t put entries into the /dev/io-net
namespace, so a waitfor command for such an entry won’t work properly in
buildfiles or scripts. Use if_up -p instead; for example, instead of waitfor
/dev/io-net/tsec0, use if_up -p tsec0.
Examples:
On the 85xx, start the v6 TCP/IP variant of io-pkt, using the devnp-mpcsec.so
SEC driver and the TSEC Ethernet driver with IPsec enabled in the stack:
io-pkt-v6-hc -d /proc/boot/devnp-mpcsec.so verbose=2 -p tcpip-v6 \
ipsec -d /proc/boot/devnp-mpc85xx.so mac=00112233AABBCC
# config the (2nd) ethernet port
ifconfig tsec1 10.42.110.239
# config md5-hmac ah and des-cbc esp for IPsec to peer 10.42.110.212
setkey -c << EOF
add 10.42.110.212 10.42.110.239 ah 9877 -A hmac-md5 "1234567890123456";
add 10.42.110.239 10.42.110.212 ah 9878 -A hmac-md5 "1234567890123456";
add 10.42.110.212 10.42.110.239 esp 9881 -E des-cbc "12345678";
add 10.42.110.239 10.42.110.212 esp 9882 -E des-cbc "12345678";
spdadd 10.42.110.239 10.42.110.212 any -P out ipsec esp/transport//use ah/transport//use;
EOF
See also:
devn-*, devnp-*, ifconfig, io-pkt, nicinfo
This driver is shipped only with the BSPs that need it.
Syntax:
io-pkt-variant -d mpc85xx mac=ZZZZZZZZZZZZ
[option[,option...]] ... &
Runs on:
Neutrino
Options:
Use commas, not spaces, to separate the options. These options override the
autodetected defaults.
duplex=0|1 Half (0) or full (1) duplex mode. The default is automatically
detected on supported hardware. You can also use ifconfig
-m and ifconfig tsecX media to set this.
etsec=0|1 Use the older TSEC (0) or newer eTSEC (1). The default is
automatically detected on supported hardware.
loopback Place the MAC into loopback mode for testing purposes.
mac=XXXXXXXXXXXX
The interface address of the controller. You must specify this
option if you aren’t using the syspage option.
phy_incr=X The PHY address increment to add to get the address for the
next interface.
probe_phy=0|1 Disable (0) or force (1) periodic PHY probing when idle.
rx_delay=X Set the Rx interrupt coalescing timer threshold. Valid values are
1 through 65,535; the default is zero (disabled). If you set
rx_delay, you must also set rx_frame.
speed=10|100|1000
The media data rate in megabits/second. The default is
automatically detected on supported hardware. You can also use
ifconfig -m and ifconfig tsecX media to set this.
verbose
verbose=N Be verbose. Specify num for more verbosity (num can be 1-4;
the higher the number, the more detailed the output). The
default is 0. The output goes to slogger; invoke sloginfo to
view it.
Description:
The devnp-mpc85xx.so driver controls Freescale MPC85XX TSEC Ethernet
controllers. This is a native io-pkt driver; its interface names are in the form tsecX,
where X is an integer.
Some devices support hardware checksums, although some might do so in only one
direction; to determine if your device does, type:
ifconfig tsecX
and look for the following in the list of supported options:
You can then use ifconfig to enable or disable whichever of these options your
device supports.
Native io-pkt and ported NetBSD drivers don’t put entries into the /dev/io-net
namespace, so a waitfor command for such an entry won’t work properly in
buildfiles or scripts. Use if_up -p instead; for example, instead of waitfor
/dev/io-net/tsec0, use if_up -p tsec0.
Examples:
Start the v4 TCP/IP variant of io-pkt using the devnp-mpc85xx.so driver:
See also:
devn-*, devnp-*, ifconfig, io-pkt, nicinfo
Syntax:
io-pkt-variant -d msk ... &
Runs on:
Neutrino
Options:
None
Description:
The devnp-msk.so driver supports the Marvell Yukon-2 based Gigabit Ethernet
adapters, including the following:
This is a ported NetBSD driver; its interface names are in the form mskX, where X is
an integer.
Support for jumbo frames is provided via the interface MTU setting. Selecting an
MTU larger than 1500 bytes with the ifconfig utility configures the adapter to
receive and transmit jumbo frames. Using jumbo frames can greatly improve
performance for certain tasks, such as file transfers and data streaming.
Hardware TCP/IP checksum offloading for IPv4 is supported.
The following media types and options (as given to ifconfig) are supported:
media autoselect
Enable the autoselection of the media type and options. You can manually
override the autoselected mode.
media 1000baseSX mediaopt full-duplex
Set 1000Mbps (Gigabit Ethernet) operation on fiber and force full-duplex mode.
For more information on configuring this device, see ifconfig. To view a list of
media types and options supported by the card, try ifconfig -m device. For
example, ifconfig -m msk0.
Native io-pkt and ported NetBSD drivers don’t put entries into the /dev/io-net
namespace, so a waitfor command for such an entry won’t work properly in
buildfiles or scripts. Use if_up -p instead; for example, instead of waitfor
/dev/io-net/msk0, use if_up -p msk0.
See also:
devn-*, devnp-*, ifconfig, io-pkt, nicinfo
Syntax:
io-pkt-variant -d ral ... &
io-pkt-variant -d ural ... &
Runs on:
Neutrino
Options:
None
Description:
The devnp-ral.so driver supports PCI/CardBus wireless adapters based on the
Ralink RT2500, RT2501, and RT2600 chipsets. The devnp-ural.so driver supports
USB 2.0 wireless adapters based on the Ralink RT2500USB chipset. These are ported
NetBSD drivers; their interface names are in the form ralX and uralX, where X is an
integer.
The RT2500 chipset is the first generation of 802.11b/g adapters from Ralink. It
consists of two integrated chips, an RT2560 or RT2570(USB) MAC/BBP and an
RT2525 or RT2526(USB) radio transceiver.
The RT2501 chipset is the second generation of 802.11b/g adapters from Ralink. It
consists of two integrated chips, an RT2561 MAC/BBP and an RT2527 radio
transceiver. This chipset provides support for the IEEE 802.11e standard with multiple
hardware transmission queues and allows scatter/gather for efficient DMA operations.
The RT2600 chipset consists of two integrated chips, an RT2661 MAC/BBP and an
RT2529 radio transceiver. This chipset uses the MIMO (multiple-input
multiple-output) technology with multiple antennas to extend the operating range of
the adapter and to achieve higher throughput.
These drivers can operate in these modes:
BSS mode Also known as infrastructure mode, this is used when associating
with an access point, through which all traffic passes. This mode is
the default.
IBSS mode Also known as IEEE ad-hoc mode or peer-to-peer mode. This is
the standardized method of operating without an access point.
Stations associate with a service set. However, actual connections
between stations are peer-to-peer.
Host AP In this mode, the driver acts as an access point (base station) for
other cards.
Monitor mode In this mode, the driver is able to receive packets without
associating with an access point. This disables the internal receive
filter and enables the card to capture packets from networks which
it wouldn’t normally have access to, or to scan for access points.
chan n Set the channel (radio frequency) to be used by the driver based
on the given channel ID n.
-chan Unset the desired channel to be used by the driver. The driver
automatically selects a channel in this mode, which is the
default.
-mediaopt opts Disable the specified media options on the driver and return it to
the default mode of operation (BSS).
nwid id Set the network ID. The id can either be any text string up to 32
characters in length, or a series of hexadecimal digits up to 64
digits. An empty ID string (the default) allows the interface to
connect to any available access points. Note that network ID is
synonymous with Extended Service Set ID (ESSID).
nwkey key Enable WEP encryption using the specified key. The key can
either be a string, a series of hexadecimal digits (preceded by
0x), or a set of keys of the form n:k1,k2,k3,k4, where n specifies
which of the keys to use for transmitted packets, and the four
keys, k1 through k4, are configured as WEP keys. If a set of keys
is specified, a comma (,) within the key must be escaped with a
backslash.
If you use multiple keys, their order must be the same within the network. These
drivers can use both 40-bit (5 characters or 10 hexadecimal digits) or 104-bit (13
characters or 26 hexadecimal digits) keys.
Native io-pkt and ported NetBSD drivers don’t put entries into the /dev/io-net
namespace, so a waitfor command for such an entry won’t work properly in
buildfiles or scripts. Use if_up -p instead; for example, instead of waitfor
/dev/io-net/ral0, use if_up -p ral0.
See also:
devn-*, devnp-*, ifconfig, io-pkt, nicinfo
Syntax:
io-pkt-variant -d rtl8169 [option[,option ...]] ... &
Runs on:
Neutrino
Options:
Use commas, not spaces, to separate the options.
duplex=0|1 Half (0) or full (1) duplex mode. The default is automatically
detected on supported hardware. If you specify duplex, specify
speed as well; if duplex alone is specified, it is ignored and both
speed and duplex are autonegotiated.
iorange=0xXXXXXXXX
The I/O base address.
mac=XXXXXXXXXXXX
The interface address of the controller. The default is
automatically detected on supported hardware.
priority=N The priority of the driver’s event thread. The default is 21.
speed=10|100|1000
The media data rate in megabits/second.
verbose
verbose=N Be verbose. Specify num for more verbosity (num can be 1-4; the
higher the number, the more detailed the output). The default is
0. The output goes to slogger; invoke sloginfo to view it.
Description:
The devnp-rtl8169.so driver controls Realtek 8169 Gigabit Ethernet controllers.
This is a native io-pkt driver; its interface names are in the form rtX, where X is an
integer.
If the device enumerators (see enum-devices) don’t recognize your device, try
explicitly specifying the device ID with the did option when you start the driver.
Some devices support hardware checksums, although some might do so in only one
direction; to determine if your device does, type:
ifconfig enX
and look for the following in the list of supported options:
You can then use ifconfig to enable or disable whichever of these options your
device supports.
Native io-pkt and ported NetBSD drivers don’t put entries into the /dev/io-net
namespace, so a waitfor command for such an entry won’t work properly in
buildfiles or scripts. Use if_up -p instead; for example, instead of waitfor
/dev/io-net/rt0, use if_up -p rt0.
Examples:
Start io-pkt-v4 using the Realtek driver:
io-pkt-v4 -d rtl8169
ifconfig rt0 10.184
See also:
devn-*, devnp-*, ifconfig, io-pkt*, nicinfo
Syntax:
io-pkt-variant -d rum ... &
Runs on:
Neutrino
Options:
None
Description:
The devnp-rum.so driver supports USB 2.0 wireless adapters based on the Ralink
RT2501USB and RT2601USB chipsets. This is a ported NetBSD driver; its interface
names are in the form rumX, where X is an integer.
The RT2501USB chipset is the second generation of 802.11a/b/g adapters from
Ralink. It consists of two integrated chips, an RT2571W MAC/BBP and an RT2528 or
RT5226 radio transceiver.
The RT2601USB chipset consists of two integrated chips, an RT2671 MAC/BBP and
an RT2527 or RT5225 radio transceiver. This chipset uses the MIMO (multiple-input
multiple-output) technology with multiple antennas to extend the operating range of
the adapter and to achieve higher throughput.
This driver can operate in the following modes:
BSS mode Also known as infrastructure mode, this is used when associating
with an access point, through which all traffic passes. This mode is
the default.
IBSS mode Also known as IEEE ad-hoc mode or peer-to-peer mode. This is
the standardized method of operating without an access point.
Stations associate with a service set. However, actual connections
between stations are peer-to-peer.
Host AP In this mode, the driver acts as an access point (base station) for
other cards.
Monitor mode In this mode, the driver is able to receive packets without
associating with an access point. This disables the internal receive
filter and enables the card to capture packets from networks which
it wouldn’t normally have access to, or to scan for access points.
The devnp-rum.so driver supports software WEP. Wired Equivalent Privacy (WEP)
is the de facto encryption standard for wireless networks. It can be typically
chan n Set the channel (radio frequency) to be used by the driver based
on the given channel ID n.
-chan Unset the desired channel to be used by the driver. The driver
automatically selects a channel in this mode, which is the
default.
-mediaopt opts Disable the specified media options on the driver and return it to
the default mode of operation (BSS).
nwid id Set the network ID. The id can either be any text string up to 32
characters in length, or a series of hexadecimal digits up to 64
digits. An empty ID string (the default) allows the interface to
connect to any available access points. Note that network ID is
synonymous with Extended Service Set ID (ESSID).
nwkey key Enable WEP encryption using the specified key. The key can
either be a string, a series of hexadecimal digits (preceded by
0x), or a set of keys of the form n:k1,k2,k3,k4, where n specifies
which of the keys to use for transmitted packets, and the four
keys, k1 through k4, are configured as WEP keys. If a set of keys
is specified, a comma (,) within the key must be escaped with a
backslash.
If you use multiple keys, their order must be the same within the network. The
devnp-rum.so driver can use both 40-bit (5 characters or 10 hexadecimal digits) or
104-bit (13 characters or 26 hexadecimal digits) keys.
Native io-pkt and ported NetBSD drivers don’t put entries into the /dev/io-net
namespace, so a waitfor command for such an entry won’t work properly in
buildfiles or scripts. Use if_up -p instead; for example, instead of waitfor
/dev/io-net/rum0, use if_up -p rum0.
See also:
devn-*, devnp-*, ifconfig, io-pkt, nicinfo
Syntax:
io-pkt-variant -d shim "io-net_drvr [drvr_opt,...]"
Runs on:
Neutrino
Options:
None.
Description:
The devnp-shim.so shared object is a “shim” driver that lets io-pkt support
devn-* drivers that were written for io-net.
Explicitly loading the shim driver is usually unnecessary; io-pkt loads the shim
automatically. For example, if you type:
io-pkt -d some_driver
io-pkt -d /lib/dll/devn-some_driver.so
then io-pkt notices that the driver is an io-net one and loads it via the shim.
• Shim drivers name their interface entries enX, but native drivers use a naming
scheme that depends on the chipset.
• You can tell if the shim has been loaded by using pidin me.
Examples:
io-pkt -d shim devn-speedo.so
io-pkt -d shim "/lib/dll/devn-speedo.so transmit=1024,receive=1024"
See also:
devn-*, devnp-*, ifconfig, io-pkt, nicinfo
Syntax:
io-pkt-variant -d speedo [[index:option[,[index:option ...]] ... &
where variant is one of v4, v4-hc, or v6-hc.
Runs on:
Neutrino
Options:
Use commas, not spaces, to separate the options.
did=0xXXXX Device ID. Only attach to device with this PCI index. The default
is automatically detected on supported hardware.
duplex=0|1 Half (0) or full (1) duplex mode. The default is automatically
detected on supported hardware. If you specify duplex, you
must also specify speed.
speed=10|100 The media data rate (10 Mbit or 100 Mbit operation). The default
(0) is automatically detected on supported hardware. If you
specify speed, you must also specify duplex.
verbose
verbose=num Be verbose. Specify num for more verbosity (num can be 1-4; the
higher the number, the more detailed the output). The output
goes to slogger; invoke sloginfo to view it.
vid=0xXXXX Attach only to devices with this PCI vendor ID. The default is
0x8086.
Description:
The devnp-speedo.so driver manages the Intel 82557, 82558, and 82559 Fast
Ethernet LAN adapters. This is a native io-pkt driver; its interface names are in the
form fxpX, where X is an integer.
If the device enumerators (see enum-devices) don’t recognize your device, try
explicitly specifying the device ID with the did option when you start the driver.
Some devices support hardware checksums, although some might do so in only one
direction; to determine if your device does, type:
ifconfig fxpX
and look for the following in the list of supported options:
You can then use ifconfig to enable or disable whichever of these options your
device supports.
Native io-pkt and ported NetBSD drivers don’t put entries into the /dev/io-net
namespace, so a waitfor command for such an entry won’t work properly in
buildfiles or scripts. Use if_up -p instead; for example, instead of waitfor
/dev/io-net/fxp0, use if_up -p fxp0.
Examples:
Start io-pkt using the devnp-speedo.so driver and the full TCP/IP stack:
For the second instance of the device in the system, start io-pkt using the
devnp-speedo.so driver and the full TCP/IP stack. Use increased verbosity and
override the default #MAC address:
See also:
devn-*, devnp-*, ifconfig, io-pkt, nicinfo
Syntax:
devp-pccard [Card Services options] [ss Socket Services options]...
Runs on:
Neutrino
Options:
Card Services Options:
-i irq The IRQ to be used for status interrupts. The default is no interrupts —
the adapter is polled every second for status changes (recommended).
-l (“el”) Override PCMCIA IRQ for socket(s). E.g. -l5 will assign IRQ 5
to the card in socket 0; -l5,7 will assign IRQ5 to the card in socket 0
and IRQ 7 to the card in socket 1.
-w Force the width for a PCMCIA socket (8 or 16 bits). E.g. -w8 will force
an 8-bit width for socket 0; -w16,8 will force a 16-bit width for socket 0
and an 8-bit width for socket 1. This is needed by some Ethernet
adapters that report themselves as 16-bit, but work only in 8-bit mode.
-x index Select the PCMCIA configuration index to use. Some PCMCIA cards
have multiple configuration indexes. This option can be used to select
one of them.
-n Set hardware interrupt routing on PCI bus. Note: This may not
work with some BIOSes.
-p Set the IRQ mode (0 - 3) as follows:
Mode Sets
0 Parallel PCI interrupts only
1 Parallel IRQ and parallel PCI interrupts
2 IRQ serialized interrupts and parallel PCI interrupts
3 IRQ and PCI serialized interrupts
Description:
The devp-pccard server provides support under QNX Neutrino for PCMCIA and
CardBus host adapter chips. The host adapters chips currently supported are
(PCMCIA) Intel 82365, Cirrus CL-PD67xx, Vadem VG-46x, (CardBus) TI-11xx,
TI-12xx, and TI-14xx, Ricoh R5C47x, O2 Micro OZ68xx, and Toshiba Topic97. Other
CardBus adapters work only in legacy (PCMCIA) mode.
The server manages host resources (memory windows, I/O ports and IRQs) and
assigns resources to PCMCIA cards as they’re inserted. CardBus resources are
managed by the pci-bios server, which interfaces to the pccard server. The
devp-pccard server also supports dual-function PC Cards and assigns separate
resources to each function. The only common resource assigned to dual-function PC
Cards is the IRQ.
Utilities are provided to start and stop processes (as cards are inserted and removed),
display server status and display card CIS (Card Information Structure) data.
The executables involved in PC Card support are:
pccard-launch A manager that starts and stops processes as cards are inserted
and removed.
CardBus
CardBus resources are assigned by the pci-bios server, as all CardBus devices are
considered to be PCI devices. Some manufacturers’ PCI BIOSes allow separate IRQs
to be assigned to each socket on a CardBus adapter, while others allow only a single
IRQ for both sockets. When a CardBus PC Card is inserted in a socket, devp-pccard
requests the pci-bios server to rescan its bus and allocate resources to the card.
Examples:
Start devp-pccard and force the ioports to be used in each socket:
devp-pccard -a 0x300,0x340
devp-pccard -l10 ss -m
See also:
pccard-launch, pci-bios, pin
Connecting Hardware in the Neutrino User’s Guide
Syntax:
io-usb -d ehci [option[,option...]] &
Runs on:
Neutrino
Targets:
x86, MIPS, ARM, PPC, and SH
Options:
int_thresh=num
Interrupt microframe threshold. Valid values are 1,2,4,8,16,32,64.
The default value is 8, which is a 1ms interrupt rate. The chip will
interrupt after a 1ms period (USB frame) if there are completed
transactions. Setting the value to 1 lets the chip interrupt after
125us (USB microframe) if there are completed transactions.
ioport=addr Register the base address. The default is to scan the PCI bus.
Description:
The devu-ehci.so server provides support for computers that have Enhanced Host
Controller Interface (EHCI) USB controllers. This server creates the
/dev/io-usb/devu-ehci.so device.
Examples:
Scan PCI bus for all available controllers.
io-usb -dehci
If you specify arguments you’ll need to include pindex arguments for all controllers
you wish to use. The value for the pindex argument should start from 0. Attach to the
1st and 3rd controller instance and set the verbose argument on the 1st, as follows:
See also:
devu-ohci.so, devu-uhci.so, io-usb, usb
Connecting Hardware in the Neutrino User’s Guide
You must be logged in as root, and start a USB stack (see io-usb) before you start
this driver.
Syntax:
devu-kbd [options*] &
Runs on:
Neutrino
Options:
-n name The device name to use. The default is /dev/usbkbd0.
-v Be verbose.
-w secs Wait sec seconds for the USB stack (default: 60 seconds).
Description:
The devu-kbd class driver manages USB keyboards.
See devu-mouse for information on USB mice.
Examples:
devu-kbd &
See also:
io-usb, usb
Connecting Hardware in the Neutrino User’s Guide
You must be logged in as root, and start a USB stack (see io-usb) before you start
this driver.
Syntax:
devu-mouse [options*] &
Runs on:
Neutrino
Options:
-n name The device name to use. The default is /dev/usbmouse0.
-v Be verbose.
-w secs Wait sec seconds for the USB stack (default: 60 seconds).
Description:
The devu-mouse class driver manages USB mice.
See devu-kbd for information on USB keyboards.
Examples:
devu-mouse &
See also:
io-usb, usb
Connecting Hardware in the Neutrino User’s Guide
Syntax:
io-usb -d ohci [option[,option...]] &
Runs on:
Neutrino
Targets:
x86, MIPS, ARM, PPC, and SH
Options:
ioport=addr Register the base address of the USB controller. The default is to
scan the PCI bus.
irq=num The interrupt request number.
nosmm Don’t disable system management. The default is to disable it.
num_ed=num The number of endpoint descriptors to preallocate. The number
specified is added to the minimum number of endpoint
descriptors needed to set up the USB chip.
num_td=num The number of transfer descriptors to preallocate. The number
specified is added to the minimum number of transfer descriptors
needed to set up the USB chip.
pindex=num Instance of controller on PCI bus to apply argument.
verbose=num Set verbosity level.
Description:
The devu-ohci.so server provides support for computers that have Open Host
Controller Interface (OHCI) USB controllers. This server creates the
/dev/io-usb/devu-ohci.so device.
Examples:
Scan PCI bus for all available controllers.
io-usb -dohci
If you specify arguments you’ll need to include pindex arguments for all controllers
you wish to use. The value for the pindex argument should start from 0. Attach to the
1st and 3rd controller instance and set the verbose argument on the 1st, as follows:
io-usb -dohci pindex=0,verbose=4,pindex=2 &
See also:
devu-ehci.so, devu-uhci.so, io-usb, usb
Connecting Hardware in the Neutrino User’s Guide
You must be logged in as root and start a USB stack (see io-usb) before you start
this driver.
Syntax:
devu-prn [-m size] [-n name] [-s stack] [-v] [-w secs] &
Runs on:
Neutrino
Targets:
ARM, MIPS, PPC, x86
Options:
-m size Specify the size, in bytes, of the maximum output buffer used to write
data to the USB stack. The default is 4096 bytes. Larger values may be
limited by the I/O buffer limits of the USB chipset you’re using.
-v Be verbose.
Description:
The devu-prn class driver manages USB printers.
Examples:
Start devu-prn with a maximum output buffer of 8192 bytes:
See also:
devi-hid, devu-ohci.so, devu-uhci.so, io-usb, usb
Connecting Hardware and Printing in the Neutrino User’s Guide
Syntax:
io-usb -d uhci [option[,option...]] ... &
Runs on:
Neutrino
Targets:
x86, MIPS, ARM, PPC, and SH
Options:
ioport=addr Register the base address of the USB controller. The default is to
scan the PCI bus.
Description:
The devu-uhci.so server provides support for computers that have Universal Host
Controller Interface (UHCI) USB controllers. This server creates the
/dev/io-usb/devu-uhci.so device.
Examples:
Scan PCI bus for all available controllers.
io-usb -duhci
If you specify arguments, you must include a pindex argument for all controllers you
wish to use. The value of the pindex argument starts from 0.
Attach to the 1st and 3rd controller instance and set the verbose argument on the 1st
controller instance as follows:
io-usb -duhci pindex=0,verbose=4,pindex=2 &
See also:
devu-ehci.so, devu-ohci.so, io-usb, usb
Connecting Hardware in the Neutrino User’s Guide
Syntax:
df [-ghknP] [device|directory|file]*
Runs on:
Neutrino
Options:
-g Display all statvfs() information.
Description:
The df utility displays the amount of free disk space for the given devices, directories,
and files.
By default, df reports its figures in 512-byte units. If you specify the -k option, it uses
1024-byte units; if you specify -h, it uses bytes.
Any block counts reported by the filesystem are rounded into 512- or 1024-byte units,
and df always rounds down (i.e. to reflect whole blocks available). For a filesystem
that doesn’t use native 512-byte (or multiples thereof) blocks, this will result in
round-off errors.
Examples:
Display the sizes in 512-byte units:
$ df -P
Filesystem 512-blocks Used Available Capacity Mounted on
/dev/hd0t178 37190440 4378680 32811760 12% /
/dev/hd0t177 122881088 4198452 118682636 4% /fs/hd0-qnx6-2/
/dev/cd0 0 0 0 100% (/fs/cd0/)
/dev/hd0 160086528 160086528 0 100%
See also:
statvfs() in the QNX Neutrino Library Reference
Syntax:
dhcp.client [-abdmnR] [-A num] [-D ident] [-h hostname]
[-I num] [-i interface]
[-P port] [-p port] [-s host]
[-T secs] [-t num] [-u] &
Runs on:
Neutrino
Options:
-A num The dhcp.client declines addresses if they fail an ARP probe
(see RFC 2131 and RFC 5227). This option sets the number of
consecutive ARP probe tests of the assigned address that can fail
before dhcp.client gives up. The default is 5; a value of 0 turns
off ARP probing.
-b Request the DHCP server to send its response packets only to the
client where appropriate (default is to request the server to
broadcast).
-D ident Specify the client identifier. The default identifier is the MAC
address.
-i interface Name of the interface to configure (e.g. en0, en1). The default is
the first interface found.
-s host Accept packets from this server only; ignore responses from other
servers. If you set the Server IP for a DHCP connection in phlip,
that IP address is passed to dhcp.client with this option.
-T sec Specify the time, in seconds, to wait for the client to complete
(server ACK) its negotiation with the server. This is applied every
time the client returns to the initialize (DISCOVER) state. If a
timeout occurs, dhcp.client terminates with an exit status of 3.
-t num Attempt to reach the server num times before giving up and
terminating (the default is forever). Each attempt lasts 1 minute.
You’re likely to use this option in combination with the -u option so
that dhcp.client times out after a specified number of attempts.
Description:
The dhcp.client obtains the TCP/IP configuration parameters dynamically from a
DHCP (Dynamic Host Configuration Protocol) server, then automatically configures
your TCP/IP host. You don’t have to provide an IP address or any configuration
parameters, or run any configuration utilities.
In a self-hosted QNX Neutrino system, dhcp.client is typically started by
netmanager; you can use phlip to specify the ID and server IP address.
This utility needs to have the setuid (“set user ID”) bit set in its permissions. If you use
mkefs, mketfs, or mkifs on a Windows host to include this utility in an image, use
the perms attribute to specify its permissions explicitly, and the uid and gid
attributes to set the ownership correctly.
• Broadcast address
• Domain
• Hostname
• IP address
• Nameserver
• Netmask
/etc/dhcp/dhcp-up
If this file exists, it is run after a DHCP server has been contacted and the
configuration options above have been applied. This file can be a binary program or a
script and must be executable (see chmod). If the file is a script, the first line must be
the command interpreter. For example:
#!/bin/sh
Environment variables, which contain the configuration that was obtained from the
server, are passed to this file. When the file is spawned, it doesn’t inherit the full
environment. For example, the PATH environment variable isn’t available. To
determine which variables are available, you can create a dhcp-up script like this:
#!/bin/sh
IPADDRESS The client IP address that was obtained from the server (e.g.
IPADDRESS=10.0.0.1).
NETMASK The client netmask that was obtained from the server (e.g.
NETMASK=255.0.0.0).
BROADCAST The client broadcast address that was obtained from the server
(e.g. BROADCAST=10.255.255.255).
NAMESERVER1,
NAMESERVER2 The nameserver that the client is to use (e.g.
NAMESERVER1=10.0.0.4).
LEASEOBTAINED
The time at which the lease was obtained (e.g.
LEASEOBTAINED=Mon Oct 30 16:46:10 2000).
The following options are available but not applied by the dhcp.client process:
Any other options are defined as environment variables OPTIONx, where x is the
option number. If the option is known, dhcp.client tries to format it as readable
information. If the option isn’t known, dhcp.client displays each octet as
hexadecimal (e.g. OPTION200= F1 AA 56 42).
Currently, dhcp.client is aware of options 1 to 61.
/etc/dhcp/dhcp-options
This file defines the DHCP options that the client wishes to obtain from the DHCP
server. You need this file only if you’re adding custom DHCP option handling to the
/etc/dhcp/dhcp-up file. If you add code to the dhcp-up script to handle an
option, you must also add this option to /etc/dhcp/dhcp-options. The options
listed in dhcp-options file are sent to the server in addition to the options:
• 1 — subnet mask
• 12 — hostname
• 15 — domain name
• 3 — gateway
• 28 — broadcast address
200
150
#This is a comment
90
Specify each option on its own line, listing them in order of priority. Comments must
be on a separate line; they can be up to 80 characters long.
Files:
The dhcp.client utility requires the libsocket.so shared library.
Exit status:
0 Success.
1 An error occurred.
3 No server responded.
Errors:
Errors that occur during configuration are reported to the system log.
See also:
dhcp.client, dhcpd, /var/state/dhcp/dhcpd.leases, /etc/dhcpd.conf,
io-pkt*, lsm-autoip.so, netmanager, phlip, syslogd
Based on RFC 2131
Syntax:
dhcpd [options...] &
Runs on:
QNX Neutrino
Options:
-a Apply the assigned IP address as an alias instead of overwriting the
current configuration.
-D ident Specify the client identifier. The default identifier is the MAC
address.
-d Debug option. Do not move to the background and log to stderr. The
default logs errors to syslogd.
-h hostname The host name of the client. The default is supplied by server if
available.
-I num The number of times to poll waiting for the interface to become
available. Polls every 2 seconds (default 5).
-i interface The name of the interface to configure. The default is the first
interface found.
-P port Specify the server port. The default is the dhcp port or port 67.
-p port Specify the client port. The default is the dhcpc port or port 68.
-s host Specify the preferred server; accept packets only from this server.
-T sec Specify in seconds the time to wait for the client to complete (server
ACK) its negotiation with the server. This is applied every time the
client returns to the initialize (DISCOVER) state. The
dhcp.client terminates on timeout with exit status 3.
-t num Attempt to reach the server num times before giving up and
terminating. Each attempt lasts 1 minute. The default is to attempt
forever.
Description:
The dhcpd utility normally runs as a daemon in the background. It responds to
requests for IP addresses and network information from clients on a TCP/IP network.
The utility uses Dynamic Host Configuration Protocol (DHCP) or, with some
restrictions, the Internet Bootstrap Protocol (BOOTP).
In order to support multiple interfaces, you should use io-pkt* with the
reuseport_unicast option.
# touch /var/state/dhcp/dhcpd.leases
• dynamic-bootp-lease-cutoff date;
• dynamic-bootp-lease-length length;
OMAPI
The DHCP server lets you modify some of its configuration while it’s running.
Without stopping the server, you can modify database files, and then restart it. This
capability is currently provided using OMAPI — an API for manipulating remote
objects. OMAPI clients connect to the server using TCP/IP, authenticate, and can then
examine the server’s current status and make changes to it.
Rather than implement the underlying OMAPI protocol directly, your programs
should use the dhcpctl() API or OMAPI (API) itself. The dhcpctl() is a wrapper that
handles some of the housekeeping chores that OMAPI doesn’t do automatically.
OMAPI exports objects, which can then be examined and modified. The DHCP server
exports the following objects: lease, host, failover-state, and group. Each object has a
number of methods: lookup, create, and destroy. In addition, it’s possible to look at
attributes that are stored on objects, and in some cases to modify those attributes.
Lease object
Leases can’t be created or destroyed, but you can examine and modify their state.
Leases have the following attributes:
host handle examine Host declaration associated with this lease, if any acquired its
lease.
hardware-type integer examine, update
Type of network interface that the client reported when it
acquired its lease.
ends time examine Time when the lease’s current state ends, as understood by the
client.
tstp time examine Time when the lease’s current state ends, as understood by the
server.
tsfp time examine Time when the lease’s current state ends, as understood by the
failover peer (if there is no failover peer, this value is
undefined).
cltt time examine Time of the last transaction with the client on this lease.
Host object
Hosts can be created, destroyed, looked up, examined, and modified. If a host
declaration is created or deleted using OMAPI, that information is recorded in the
dhcpd.leases file. You can delete host declarations that are declared in the
dhcpd.conf file.
Hosts have the following attributes:
Named groups can be created, destroyed, looked up, examined and modified. If a
group declaration is created or deleted using OMAPI, that information will be
recorded in the dhcpd.leases file. You can delete group declarations that are
declared in the dhcpd.conf file.
Named groups currently can be associated only with hosts — this lets you attach set of
statements efficiently to more than one host declaration.
Groups have the following attributes:
name data Name of the group. All groups that are created using OMAPI
must have names; the names must be unique among all groups.
statements data List of statements in the format of the dhcpd.conf file that will
be executed whenever a message from a client whose host
declaration references this group is processed.
Control object
The control object allows you to shut the server down. If the server is doing failover
with another peer, it’ll make a clean transition into the shutdown state and notify its
peer, so that the peer can go into partner down, and then record the “recover” state in
the lease file so that when the server is restarted, it’ll automatically resynchronize with
its peer.
On shutdown, the server will also attempt to cleanly shut down all OMAPI
connections. If these connections don’t go down cleanly after five seconds, they are
shut down preemptively. It can take as much as 25 seconds from the beginning of the
shutdown process to the time that the server actually exits.
To shut the server down, open its control object and set the state attribute to 2.
Failover-state object
The failover-state object tracks the state of the failover protocol as it’s being managed
for a given failover peer. The failover object has the following attributes (please also
see the description for the dhcpd.conf file)
1 Partner down.
2 Normal.
3 Communications interrupted.
4 Resolution interrupted.
5 Potential conflict.
6 Recover.
7 Recover done.
8 Shutdown.
9 Paused.
10 Startup.
11 Recover wait.
In general it isn’t a good idea to change this state. However, in the case that the
failover partner is known to be down, it can be useful to set the DHCP server’s
failover state to partner down. At this point the DHCP server will take over
service of the failover partner’s leases as soon as possible, and will give out
normal leases, not leases that are restricted by MCLT. If you do put the DHCP
server into the partner-down state when the other DHCP server is not in that
state, but isn’t reachable, IP address assignment conflicts are possible, even
likely. Once a server has been put into partner-down mode, its failover partner
must not be brought back online until communication is possible between the
two servers.
partner-state integer examine
Indicates the present state of the failover partner.
Examples:
Start dhcpd using defaults:
dhcpd &
dhcpd -i en0
Files:
/etc/dhcpd.conf
Default configuration file.
/var/state/dhcp/dhcpd.leases
Contains information about leases.
/var/run/dhcpd.pid
Contain the PID number of the currently running dhcpd.
/var/lib/dhcp/dhcpd.leases˜
Backup of dhcpd.leases file.
Errors:
When an error occurs, dhcpd sends a description of the error to syslogd and stderr,
if dhcpd is running in the foreground.
Contributing author:
Ted Lemon in cooperation with Vixie Enterprises.
License:
This utility is based on copyright software of The Internet Software Consortium; for
licensing information, see the Third Party License Terms List at
http://licensing.qnx.com/third-party-terms/.
See also:
dhcp.client, /var/state/dhcp/dhcpd.leases, /etc/dhcpd.conf,
dhcprelay, syslogd
Based on RFC2131, RFC2132
Name:
/etc/dhcpd.conf
Description:
The dhcpd.conf file is a free-form ASCII text file containing a list of statements that
dhcpd uses for DHCP configuration.
File format
To create a dhcpd.conf file, you enter a scope keyword first, followed by a pair of
braces ({}) enclosing the parameter and declaration statements that apply within that
scope. If there is no preceding scope keyword, the statement applies globally.
Scope
The following keywords define the scope for following statements:
• global (default)
• shared-network
• subnet
• group
• host
The group keyword is unusual in that it may be located anywhere under global. Thus
groups may contain shared-networks and subnets, as well as hosts.
The order of precedence for parameters is in reverse hierarchical order: that is from
the specific to the general. If a parameter for a machine is specified in the host section
and a different parameter is specified for the same machine in the subnet section, the
value in the host section applies. We’ll explain the scope keywords in this order of
precedence.
host keyword
The host keyword signifies that any following statements are to be applied to a
unique host machine on the network.
There must be at least one host statement for every BOOTP client that is to be served.
host statements may also be specified for DHCP clients, although this is not required
unless booting is enabled for known hosts only.
If it is desirable to be able to boot a DHCP or BOOTP client on more than one subnet
with fixed addresses, more than one address may be specified in the fixed-address
parameter, or more than one host statement may be specified.
If client-specific boot parameters must change based on the network to which the
client is attached, then multiple host statements should be used.
If you want to allocate a dynamic address only when it is not possible to boot with a
fixed address, a host statement must be specified without a fixed-address clause.
The host declarations are matched to actual DHCP or BOOTP clients by matching
the dhcp-client-identifier option specified in the host declaration to the one
supplied by the client, or, if the host declaration or the client does not provide a
dhcp-client-identifier option, by matching the hardware parameter in the
host declaration to the network hardware address supplied by the client. BOOTP
clients do not normally provide a dhcp-client-identifier, so the hardware
address must be used for all clients that may boot using the BOOTP protocol.
You declare a host statement like this:
host name{
[ parameters ]
[ declarations ]
}
where name is a unique host name (for an example and restrictions on use, see the
entry for use-host-decl-names flag; in the section on Parameter statements,
below)
Examples of parameters that might be assigned a value under a typical host scope are:
• hardware
• fixed-address
• filename
• server-name
group keyword
The group scope may include individual hosts, shared networks, subnets, or even
other groups.
If some machines on a subnet share common parameters but others don’t, you might
want to create a group scope to cover the similar machines without having to treat
them as a separate subnet. You do this by using the group keyword. All of the options
included within the group scope declaration apply to that group. As with subnets, this
scope can also specify individual hosts with the group.
For example, you may want to provide a large set of addresses for DHCP clients that
are registered to your DHCP server, while providing a smaller set of addresses,
possibly with shorter lease times, for unknown clients. Or, if you have a firewall, you
may be able to arrange for addresses from one group to be allowed access to the
Internet, while addresses in another group are not; thus encouraging users to register
their DHCP clients.
Within either the group or subnet declarations, you can specify parameters for
individual hosts, just as when the hosts are part of a shared network.
You can also vary the facilities afforded to members of the same group by partitioning
them within the group, like this:
group{
default-lease-time 100000;
option routers 192.168.42.1;
host fantasia { hardware ethernet 08:00:07:26:c0:a5; }
host passacaglia { hardware ethernet 0:0:c0:5d:bd:95; }
host confusia {
hardware ethernet 02:03:04:05:06:07;
default-lease-time 200000;
}
}
All three machines in this group share the same router but, while leases for fantasia
and passacaglia last for 100,000 seconds, confusia enjoys a 200,000-second
lease.
subnet keyword
For every subnet that will be served, and for every subnet to which the DHCP server is
connected, there must be subnet declarations that tell dhcpd how to recognize that
an address is on that subnet. A subnet declaration is required for each subnet, even if
no addresses will be dynamically allocated on that subnet.
If clients on a subnet are to be assigned addresses dynamically, a range declaration
must appear within the subnet declaration. The range statement contains the pool of
IP addresses that can be allocated on this subnet. For clients with statically assigned
addresses, or for installations where only known clients will be served, each such
client must have a host declaration.
If parameters are to be applied to a group of declarations which are not related strictly
on a per-subnet basis, the group declaration can be used.
Any subnets in a shared network should be declared within a shared-network
statement.
Here’s what a subnet statement looks like:
subnet subnet-number netmask netmask-number{
[ parameters ]
[ declarations ]
}
for each subnet to set the desired subnet mask (see Standard DHCP option statements,
below). Any such subnet-mask option statement overrides the netmask declared in
the top line of the subnet statement.
Some installations have physical networks on which more than one IP subnet operates.
For example, if there is a site-wide requirement that 8-bit subnet masks be used, but a
department with a single physical Ethernet network expands to the point where it has
more than 254 nodes, it may be necessary to run two 8-bit subnets on the same
Ethernet until such time as a new physical network can be added. In this case, the
subnet declarations for these two networks must be enclosed in a shared-network
declaration.
Some sites may have departments that have clients on more than one subnet, but you
might want to offer clients in the same department a uniform set of parameters,
regardless of the subnet they are on. For clients which will be declared explicitly with
host declarations, these declarations can be enclosed in a group declaration along with
the parameters which are common to that department.
shared-network keyword
Shared networks are separate networks that use the same physical network segment.
Uses include things like restricting certain device types to specific segments or
separating machines before moving them to a different network segment.
A shared-network can contain any combination of subnets, groups, and hosts.
You must declare all the subnets in a shared network within a shared-network
statement. Clients on these subnets are booted using the parameters specified in the
shared-network statement, unless parameters provided at the subnet or host level
override them. If any subnet in a shared network has addresses available for dynamic
allocation, those addresses are collected into a common pool for that shared network
and assigned to clients as needed. There is no way to distinguish on which subnet of a
shared network a client should boot.
The syntax for a shared-network statement is:
shared-network name {
[ parameters ]
[ declarations ]
}
You can use a valid domain name for name, but as this variable is used only when
printing debugging messages, you might want to use descriptive text (enclosed in
quotes) instead.
global keyword
The global keyword may be used on its own or inside lower scope declarations, like
subnet or group. It denotes that any following statements are to be applied globally,
either within another scope or on the whole network. Normally, the global keyword
is omitted because it is the default.
Statements
Statements cover:
• ranges
• permissions (allow and deny)
• parameters
• DHCP options to be passed to the client
Range statements
The range statement specifies the IP addresses that may be allocated to clients within
a defined scope.
For any subnet on which addresses will be assigned dynamically, there must be at least
one range statement. The range statement gives the lowest and highest IP addresses
in a range. All IP addresses in the range should be in the subnet in which the range
statement is declared. The dynamic-bootp flag may be specified if addresses in the
specified range may be dynamically assigned to BOOTP clients as well as DHCP
clients. Here’s the syntax for the range statement:
range [ dynamic-bootp ] low-address [ high-address];
Permission statements
Allow and deny statements can be used to control the response of the DHCP server to
various sorts of requests. The allow and deny keywords have different meanings
depending on context. In a pool context, these keywords can be used to set up access
lists for address allocation pools. In other contexts, the keywords simply control
general server behavior with respect to clients, based on scope.
The following declarations work in any scope, although you shouldn’t use them in
group declarations.
allow|deny unknown-clients;
The unknown-clients flag tells dhcpd whether or not to dynamically assign
addresses to unknown clients. The default is allow. (An unknown client is
simply a client that has no host declaration.)
allow|deny bootp;
The bootp flag tells dhcpd whether or not to respond to BOOTP queries. The
default is allow.
allow|deny booting;
The booting flag is used to tell dhcpd whether or not to respond to queries from
a particular client. This keyword only has meaning when it appears in a host
declaration. By default, booting is allowed, but if it is disabled for a particular
client, then that client will not be able to get an address from the DHCP server.
Parameter statements
always-reply-rfc1048 flag;
Some BOOTP clients expect RFC1048-style responses, but do not
follow RFC1048 when sending their requests. You can tell that a
client is having this problem if it is not getting the options you have
configured for it and if you see in the server log the message “(non
rfc1048)” printed with each BOOTREQUEST that is logged.
If you want to send rfc1048 options to such a client, you can set the
always-reply-rfc1048 option in that client’s host declaration, and
the DHCP server will respond with an RFC-1048-style vendor options
field. This flag can be set in any scope, and will affect all clients
covered by that scope.
authoritative;
at the top of your configuration file to indicate that the DHCP server
should send DHCPNAK messages to misconfigured clients. If you
don’t do this, clients who change subnets will be unable to get a
correct IP address until their old lease has expired, which could take
quite a long time.
If you want to set up a DHCP server so that it is aware of some
networks for which it is authoritative and some networks for which it
is not, you could declare authority on a per-network-segment basis.
Note that the most specific scope for which the concept of authority makes any sense
is the physical network segment: either a shared-network statement or a subnet
statement that is not contained within a shared-network statement. It is not meaningful
to specify that the server is authoritative for some subnets within a shared network, but
not authoritative for others, nor is it meaningful to specify that the server is
authoritative for some host declarations and not others.
boot-unknown-clients flag;
If the boot-unknown-clients statement is present and flag has a value
of false or off, then clients for which there is no host declaration will
not be allowed to obtain IP addresses. If this statement is not present
or has a flag value of true or on, then clients without host declarations
will be allowed to obtain IP addresses, as long as those addresses are
not restricted by allow and deny statements within their pool
declarations.
default-lease-time time;
The time variable is the length in seconds that will be assigned to a
lease if the client requesting the lease does not ask for a specific
expiration time.
dynamic-bootp-lease-cutoff date;
This statement sets the ending time for all leases assigned
dynamically to BOOTP clients. Because BOOTP clients do not have
any way of renewing leases, and don’t know that their leases could
expire, by default dhcpd assigns infinite leases to all BOOTP clients.
However, it may make sense in some situations to set a cutoff date for
all BOOTP leases for example, the end of a school term, or the time at
night when a facility is closed and all machines are required to be
powered off.
The date variable is the date on which all assigned BOOTP leases will
end . The date is specified in the form:
W YYYY/MM/DD HH:MM:SS
filename filename;
This statement can be used to specify the name of the initial boot file
that is to be loaded by a client. The filename should be a filename
recognizable to whatever file transfer protocol the client can be
expected to use to load the file.
max-lease-time time;
The time variable is the maximum time in seconds that will be
assigned to a lease. The only exception to this is that Dynamic
BOOTP lease lengths, which are not specified by the client.
next-server server-name;
This statement specifies the host address of the server from which the
initial boot file (specified in the filename statement) is to be loaded.
The server-name variable is a numeric IP address or a domain name.
server-identifier hostname;
This statement defines the value that is sent in the DHCP Server
Identifier option for a given scope. The hostname value must be an IP
address for the DHCP server, and must be reachable by all clients
served by a particular scope.
The use of the server-identifier statement is not recommended:
the only reason to use it is to force a value other than the default value
to be sent on occasions where the default value would be incorrect.
The default value is the first IP address associated with the physical
network interface on which the request arrived.
The usual case where the server-identifier statement needs to be sent is
when a physical interface has more than one IP address, and the one
being sent by default isn’t appropriate for some or all clients served by
that interface. Another common case is when an alias is defined for
the purpose of having a consistent IP address for the DHCP server,
and it is desired that the clients use this IP address when contacting
the server.
Supplying a value for the dhcp-server-identifier option is equivalent to
using the server-identifier statement.
server-name name ;
This statement can be used to to inform the client of the name of the
server from which it is booting. the name variable should be the name
that will be provided to the client.
use-host-decl-names flag;
If flag is true in a given scope, for every host declaration within that
scope the name provided for the host declaration will be supplied to
the client as its hostname. So, for example:
group {
use-host-decl-names on;
host joe {
hardware ethernet 08:00:2b:4c:29:32;
fixed-address joe.fugue.com;
}
}
is equivalent to:
host joe {
hardware ethernet 08:00:2b:4c:29:32;
fixed-address joe.fugue.com;
option host-name "joe";
}
Most DHCP clients completely ignore the host-name option sent by the DHCP server,
and there is no way to configure them not to do this.
use-lease-addr-for-default-route flag;
If flag is true in a given scope, instead of sending the value specified in
the routers option (or sending no value at all), the IP address of the
lease being assigned is sent to the client. This causes QNX DHCP
clients to ARP for all IP addresses, which can be helpful if your router
is configured for proxy ARP.
• option-name is one of the option names in a defined list (see Standard DHCP
options)
See the section on Standard DHCP options for a list of allowed option names and
corresponding data types.
Troubleshooting
Finding host parameters
In a complex configuration, it can be difficult to tell which parameter applies to
any given host. It helps to remember two things:
• if there is a conflict, the parameter declaration in the lowest level of scope
takes precedence
• regardless of where they appear in the file, definitions are applied in this
order:
1 specific host configuration
2 group configuration
3 subnet configuration
4 shared-network configuration
5 global configuration
When you are troubleshooting DHCP, always start at the bottom and work your
way up.
Finding allocated leases
The dhcpd daemon writes information about the current state of all active leases
to a text file (/var/state/dhcp/dhcp.leases). The daemon rewrites this
file from time to time to keep it reasonably sized. If your server dies while
dhcpd is rewriting this file, it is possible that the file will disappear. If this
happens, you won’t be able to restart your DHCP server because dhcpd won’t
start without a leases file. Fortunately, before dhcpd changes anything in the
leases file, it creates a backup (dhcpd.leases˜) in the same directory: just
rename the backup file dhcpd.leases and you’re back in business.
The contents of the dhcpd.leases file is fairly straightforward. Each lease
declaration is identified with the keyword lease followed by the IP address and a
block of configuration information within braces .
You might have something like this:
lease 192.168.42.1 {
starts 0 2000/01/30 08:02:54;
ends 5 2000/02/04 08:02:54;
hardware ethernet
00:50:04:53:D5:57;
uid 01:00:50:04:53:D5:57;
client-hostname "PC0097";
}
The starts and ends statements tell you the period when the lease is valid.
Each entry is of the form:
Related issues
This section gives you some background information that might help explain a few
related issues as you create your dhcpd.conf file.
Address allocation is actually only done when a client is in the INIT state and has sent
a DHCPDISCOVER message. If the client thinks it has a valid lease and sends a
DHCPREQUEST to initiate or renew that lease, the server has only three choices: it
can ignore the DHCPREQUEST, send a DHCPNAK to tell the client it should stop
using the address, or send a DHCPACK, telling the client to go ahead and use the
address for a while.
If the server finds the address the client is requesting, and that address is available to
the client, the server will send a DHCPACK. If the address is no longer available, or
the client isn’t permitted to have it, the server will send a DHCPNAK. If the server
knows nothing about the address, it will remain silent, unless the address is incorrect
for the network segment to which the client has been attached and the server is
authoritative for that network segment, in which case the server will send a
DHCPNAK even though it doesn’t know about the address.
There may be a host declaration matching the client’s identification, and that host
declaration contains a fixed-address declaration that is valid for the network segment
to which the client is connected. In this case, the DHCP server will never do dynamic
address allocation. In this case, the client is required to take the address specified in
the host declaration. If the client is requesting some other address, the server will
respond with a DHCPNAK.
When the DHCP server allocates a new address for a client (remember, this only
happens if the client has sent a DHCPDISCOVER), it first looks to see if the client
already has a valid lease on an IP address, or if there is an old IP address the client had
before that hasn’t yet been reassigned. In that case, the server will take that address
and check it to see if the client is still permitted to use it. If the client is no longer
permitted to use it, the lease is freed if the server thought it was still in use: the fact
that the client has sent a DHCPDISCOVER proves to the server that the client is no
longer using the lease.
If no existing lease is found, or if the client is forbidden to receive the existing lease,
then the server will look in the list of address pools for the network segment to which
the client is attached for a lease that is not in use and that the client is permitted to
have. It looks through each pool declaration in sequence (all range declarations that
appear outside of pool declarations are grouped into a single pool with no permit list).
If the permit list for the pool allows the client to be allocated an address from that
pool, the pool is examined to see if there is an address available. If so, then the client
is tentatively assigned that address. Otherwise, the next pool is tested. If no addresses
are found that can be assigned to the client, no response is sent to the client.
If an address is found that the client is permitted to have, and that has never been
assigned to any client before, the address is immediately allocated to the client. If the
address is available for allocation but has been previously assigned to a different
client, the server will keep looking in hopes of finding an address that has never before
been assigned to a client.
If a lease has been specified in a range statement and has not been listed as being in
use by the server or its failover peer, dhcpd checks IP addresses to see if they are in
use before allocating them to clients. It does this by sending an ICMP Echo request
message to the IP address being allocated.
If no ICMP Echo reply is received within a second, the address is assumed to be free.
If a response is received, dhcpd assumes that there is a configuration error or the IP
address is in use by a network host that is not a DHCP client. In this case, the server
marks the address as abandoned, and will not assign it to clients.
If only abandoned IP addresses are available when a DHCP client makes its request,
dhcpd tries to reclaim one of the abandoned IP addresses by carrying out a new ICMP
Echo request check. If there is no answer to the ICMP Echo request, the address is
assigned to the client and the search ends; if not, dhcpd tries the next abandoned
address and so on until it finds a free one.
If the same conditions apply when the next request comes in, dhcpd starts the same
search starting at a different IP address to avoid cycling through the same sequence as
before.
Security
At first glance, there may not seem to be much to talk about in terms of security and
DHCP. However, considering the importance of DHCP, a few precautions are in order.
The first consideration is the machine itself. Although an outage of a couple of hours
might be something you can deal with, any long outage means that there may be a
number of machines without a valid configuration or even a valid IP address.
Therefore, you need to look at what other services the machine with your DHCP
server provides. Since there is very little computer power required to support DHCP,
you can easily get away with smaller machines. This might be preferable to having
dhcpd running alongside some other machines.
Another issue to consider is a denial-of-service attack. If your DHCP server were
accessible from the Internet, it would be possible for someone to gobble up all of your
IP addresses, leaving nothing for your own machines. So make sure that you stop
DHCP traffic getting through your firewall by blocking port 67 (the DHCP listen port)
and port 68 (the DHCP transmit port) on the machine running your firewall.
Examples:
An easy way to create your own dhcpd.conf file is to back up the file in
/etc/dhcpd.conf file, and then change it to suit your own needs. Here’s the file we
provide in /etc/dhcpd.conf:
# dhcpd.conf
#
# Sample configuration file for ISC dhcpd
#
host passacaglia {
hardware ethernet 0:0:c0:5d:bd:95;
filename "vmunix.passacaglia";
server-name "toccata.fugue.com";
}
host confusia {
hardware ethernet 02:03:04:05:06:07;
fixed-address confusia-3.fugue.com;
filename "vmunix.confusia";
server-name "snarg.fugue.com";
}
host confusia {
hardware ethernet 02:03:04:05:06:07;
filename "vmunix.confusia";
server-name "bb.home.vix.com";
}
See also:
dhcp.client, dhcpd, /var/state/dhcp/dhcpd.leases, dhcprelay,
syslogd.
Based on RFC 2131, RFC 2132
Name:
/var/state/dhcp/dhcpd.leases
Description:
When a client requests an IP address under DHCP, the dhcpd daemon assigns an
address from a pool of IP addresses stored in the /etc/dhcpd.conf file. Before
dhcpd grants the client a lease on this address, it records the details of the lease in the
leases database, a free-form ASCII file (/var/state/dhcp/dhcpd.leases) that
contains a series of lease declarations. The daemon makes sure that the contents of the
file are flushed to disk, ensuring that, even in the event of a system crash, dhcpd will
not forget about a lease that it has assigned. On startup, after reading the dhcpd.conf
file, dhcpd also reads the saved dhcpd.leases file.
Every time a lease is acquired, renewed or released, its new value is recorded at the
end of the lease file. So if more than one declaration appears for a given lease, the last
one in the file is the current one.
New leases are appended to the end of the dhcpd.leases file. From time to time,
dhcpd removes obsolete information to prevent the file becoming too large.
There is no lease database when you first install dhcpd but the daemon will not start
without one, so before you can offer DHCP services, you have to create an empty file
called /var/state/dhcpd/dhcpd.leases.
In order to prevent the lease database from growing without bound, dhcpd rewrites
the file from time to time. First, dhcpd creates a temporary lease database and dumps
all known leases to it. Then, it renames the old lease database as
/var/state/dhcpd/dhcpd.leases˜ to create a backup copy. Finally, it writes the
new lease database as /var/state/dhcpd/dhcpd.leases.
This process does have a window of vulnerability. If dhcpd is killed or the system
crashes after the old lease database has been renamed but before the new one has been
moved into place, there will be no /var/state/dhcpd/dhcpd.leases file. In this
case, dhcpd will refuse to start, and will require manual intervention. If this happens,
do not create a new lease file or you will lose all your old bindings, and your new lease
file will not match the lease information kept by the client hosts. Instead, rename
/var/state/dhcpd/dhcpd.leases˜ as /var/state/dhcpd/dhcpd.leases,
restoring the old, valid lease file, and then start dhcpd. This guarantees that a valid
lease file will be restored.
Lease descriptions are stored in a format that is parsed by the same recursive descent
parser used to read /etc/dhcpd.conf files. Currently, the only declaration that is
used in the dhcpd.leases file is the lease declaration.
Each lease declaration includes the single IP address that has been leased to the client.
The statements within the braces define the duration of the lease and to whom it is
assigned.
The duration of a lease is recorded as the starts and ends statements. Dates are
specified as follows:
The weekday is present to make it easy for you to tell when a lease expires: it’s
specified as a number from zero to six, with zero being Sunday. The day of week is
ignored on input. The year is specified with the century, so it should generally be four
digits except for really long leases. The month is specified as a number starting with 1
for January. The day of the month is likewise specified starting with 1. The hour is a
number between 0 and 23, the minute a number between 0 and 59, and the second also
a number between 0 and 59. Lease times are specified in UCT, not in the local time
zone.
DHCP leases can be assigned almost any length from zero seconds to infinity. What
lease length makes sense for any given subnet, or for any given installation, will vary
depending on the kinds of hosts being served. For example, in an office environment
where you add or remove systems infrequently, you might allow monthly leases
whereas in a final test environment on a manufacturing floor, you might want to
restrict leases to 30 minutes or so.
The MAC address of the network interface that was used to acquire the lease is
recorded with the hardware statement:
uid client-identifier;
client-hostname "hostname";
If the client sends its hostname using the Hostname option, as Windows 95 does, it is
recorded using the hostname statement:
hostname "hostname";
The DHCP server may determine that a lease has been misused in some way, either
because a client that has been assigned a lease NAKs it, or because the server’s own
attempt to see if an address is in use prior to reusing it reveals that the address is in fact
already in use. In that case, the abandoned statement is used to indicate that the lease
should not be reassigned, like this:
abandoned;
Abandoned leases are reclaimed automatically. When a client asks for a new address,
and the server finds that there are no new addresses, it checks to see if there are any
abandoned leases, and allocates the least recently abandoned lease. The standard
mechanisms for checking for lease address conflicts are still followed, so if the
abandoned lease’s IP address is still in use, it will be re-abandoned.
If a client requests an abandoned address, the server assumes that the reason the
address was abandoned was that the lease file was corrupted, and that the client is the
machine that responded when the lease was probed, causing it to be abandoned. In that
case, the address is immediately assigned to the client.
Examples:
Here’s an example of a typical lease entry:
lease 192.168.42.1 {
starts 0 2000/01/30 08:02:54;
ends 5 2000/02/04 08:02:54;
hardware ethernet
00:50:04:53:D5:57;
uid 01:00:50:04:53:D5:57;
client-hostname "PC0097";
}
See also:
dhcp.client, dhcpd, /etc/dhcpd.conf, dhcprelay, syslogd.
Based on RFC2131, RFC2132
Syntax:
dhcprelay [-a] [-A value] [-d] [-D] [-q] [-i en0]
[... -i enX] [-p port] [-pf pid-file]
[-m] dhcp-server1 [... serverX]
Runs on:
Neutrino
Options:
-a Append an agent option field to each request before forwarding it to
the server.
-D Drop packets that don’t contain a relay agent information option field
for this agent.
-p port The UDP receiving port that dhcprelay will listen to. By default,
dhcprelay listens for datagrams on port 67 or as specified in
/etc/services. The port dhcprelay transmits on is the one with
the next highest number (e.g. if dhcprelay receives on port 67, it
transmits on port 68). This option is mostly used for debugging
purposes.
-pf file An alternative file to store the PID of dhcprelay. The default is
/var/run/dhcprelay.pid.
-q Quiet mode. Use when you want to avoid printing on startup (e.g.
when starting dhcprelay from a script).
-mappend|replace|forward|discard
Take action if a packet is received with the gateway address
(giaddr) set.
Description:
The dhcprelay DHCP relay agent relays DHCP and BOOTP requests from a subnet
that doesn’t have a DHCP server to one that does.
The agent normally runs in the foreground until it has configured an interface, and
then runs as a daemon in the background.
The dhcprelay daemon listens for DHCP requests on all interfaces attached to a host
(or those specified by the -i option).
When a query is received, dhcprelay forwards it to the list of DHCP servers
specified on the command line. When a reply is received, it is broadcast or unicast on
the network where the original request came.
The agent ID suboption is not defined in the current relay agent information option
draft (draft-ietf-dhc-agent-options-03.txt), but has been proposed for
inclusion in the next draft.
Relay agent options are added to a DHCP packet without the knowledge of the DHCP
client. If the client has filled the DHCP packet option buffer completely, then there’s
no space to add agent options. The DHCP server, however, can handle a much larger
packet than most DHCP clients send. The current agent options draft requires that the
relay agent use a maximum packet size of 576 bytes.
With the Internet software consortium DHCP server, we recommend that you set the
maximum packet size to about 1400, allowing plenty of extra space in which the relay
agent can put the agent option field, while still fitting into the Ethernet MTU size. You
can do this by specifying the -A flag, followed by the desired maximum packet size
(e.g. 1400).
It’s reasonably safe to do even if the MTU between the server and the client is less
than 1500, as long as the hosts on which the server and client are running support IP
fragmentation (and they should). With some knowledge as to how large the agent
options might get in a particular configuration, this parameter can be tuned as finely as
necessary.
It’s possible for a relay agent to receive a packet that contains an agent option field. If
this packet doesn’t have a giaddr set, the packet is discarded.
If giaddr is set, the server may handle the situation in one of four ways. It may:
• append its own set of relay options to the packet, leaving the supplied option field
intact
• discard it.
To do the above, use the -m flag with one of the arguments: append, replace,
forward, or discard.
The relay agent usually scans a response from a server and removes the relay agent
information option if the relay agent information option processing is enabled.
However, if it finds a relay agent information option field containing an agent ID
suboption that matches one of its IP addresses, that is recognized as its own. If no such
option is found, the relay agent can either drop the packet or relay it anyway. If the -D
option is specified, all packets that don’t contain a match are dropped.
Examples:
Start dhcprelay using defaults:
dhcprelay 10.0.0.1
Errors:
When an error occurs, dhcprelay sends a description of the error to syslogd and
stderr only if dhcprelay is running on the foreground.
Contributing author:
Ted Lemon in cooperation with Vixie Enterprises.
License:
This utility is based on copyright software of The Internet Software Consortium; for
licensing information, see the Third Party License Terms List at
http://licensing.qnx.com/third-party-terms/.
See also:
dhcp.client, dhcpd, syslogd.
Based on RFC2131, RFC2132
Syntax:
diff [option] file1 file2
Runs on:
Neutrino
Options:
-i
--ignore-case Ignore case differences in the contents of the files.
--ignore-file-name-case
Ignore case when comparing filenames.
--no-ignore-file-name-case
Consider case when comparing filenames.
-E
--ignore-tab-expansion
Ignore changes due to tab expansion.
-b
--ignore-space-change
Ignore changes in the amount of white space.
-w
--ignore-all-space
Ignore all white space.
-B
--ignore-blank-lines
Ignore changes whose lines are all blank.
-I RE
--ignore-matching-lines=RE
Ignore changes whose lines all match the given regular
expression.
--strip-trailing-cr
Strip trailing carriage returns from the input.
-a
--text Treat all files as text.
-c
-C num
--context[=num] Output num (default 3) lines of copied context.
-u
-U num or --unified[=num]
Output num (default 3) lines of unified context.
--label label Use label instead of the filename in the output. You can specify
this option twice; the first applies to file1, and the second to
file2.
-p
--show-c-function
Show which C function each change is in.
-F RE
--show-function-line=RE
Show the most recent line that matches the given regular
expression.
-q
--brief Output only whether or not the files differ.
-e
--ed Output an ed script.
-n
--rcs Display the differences in RCS format.
-y
--side-by-side Display the output in two columns.
-W num
--width=num Output at most num (default 130) print columns.
--suppress-common-lines
Don’t display any lines that are common to both files.
-D name
--ifdef=name Output merged file to show #ifdef name differences.
--GTYPE-group-format=GFMT
Use the given format to output groups of lines in an if-then-else
format. GTYPE can be old, new, changed, or unchanged.
GFMT may contain:
--line-format=LFMT
Use the given format to output all input lines in an if-then-else
format.
--LTYPE-line-format=LFMT
Use the given format to output individual lines in an if-then-else
format. LTYPE can be old, new, or unchanged. LFMT may
contain:
-l
--paginate Pass the output through pr to paginate it.
-t
--expand-tabs Expand tabs into spaces in the output.
-T
--initial-tab Make tabs line up by prepending a tab.
-r
--recursive Recursively compare any subdirectories found.
-N
--new-file Treat absent files as being empty.
--unidirectional-new-file
Treat absent first files as being empty.
-s
--report-identical-files
Report when two files are the same.
-x pattern
--exclude=pattern
Exclude files that match the given pattern.
-X file
--exclude-from=file
Exclude files that match any pattern in file.
-S file
--starting-file=file
Start with file when comparing directories.
--from-file=file1 Compare file1 to all operands. The file1 argument can also be
the name of a directory.
--to-file=file2 Compare all operands to file2. The file2 argument can also be
the name of a directory.
--horizon-lines=num
Keep num lines of the common prefix and suffix.
-d
--minimal Try hard to find a smaller set of changes.
--speed-large-files
Assume large files and many scattered small changes.
-v
--version Output version information.
Description:
The diff utility reports the differences between two files.
If you use diff to compare binary files, diff simply reports whether or not the files
are different. If you want to see the differences between two binary files, use cmp.
For any two files, there may be several correct interpretations of the differences
between them. The diff utility attempts to generate the smallest number of additions,
changes, and deletions required to convert file1 into file2. No output is produced if the
files are identical.
This utility is subject to the GNU Public License (GPL). We’ve included it for use on
development systems.
Exit status:
0 No differences were found.
Contributing author:
GNU
See also:
cksum, cmp, diff3, patch, wc
Syntax:
diff3 [options...] mine older yours
Runs on:
Neutrino
Options:
-a Treat all files as text and compare them line-by-line, even if they
do not appear to be text.
-L label Use the label label for the brackets output by the -A, -E and -X
options. This option may be given up to three times, one for each
input file. The default labels are the names of the input files.
Thus diff3 -L X -L Y -L Z -m A B C acts like diff3
-m A B C, except that the output looks like it came from files
named X, Y and Z rather than from files named A, B and C. See
section “Marking conflicts”.
-m Apply the edit script to the first file and send the result to
standard output. Unlike piping the output from diff3 to ed, this
works even for binary files and incomplete lines. -A is assumed
if no edit script option is specified. See section “Generating the
merged output directly”.
-T Output a tab rather than two spaces before the text of a line in
normal format. This causes the alignment of tabs in the line to
look normal.
mine older yours These are the pathnames of the files to be compared. At most
one of these three file names may be a dash (-), which tells
diff3 to read the standard input for that file.
Description:
The diff3 utility is used to compare three files and show any differences among
them. (diff3 can also merge files; see section “Merging from a common ancestor”).
The normal diff3 output format shows each hunk of differences without surrounding
context. Hunks are labeled depending on whether they are two-way or three-way, and
lines are annotated by their location in the input files.
file:la This hunk appears after line l of file file, and contains no lines in that file.
To edit this file to yield the other files, one must append hunk lines taken
from the other files. For example, “1:11a” means that the hunk follows
line 11 in the first file and contains no lines from that file.
file:rc This hunk contains the lines in the range r of file file. The range r is a
comma-separated pair of line numbers, or just one number if the range is a
singleton. To edit this file to yield the other files, one must change the
specified lines to be the lines taken from the other files. For example,
“2:11,13c” means that the hunk contains lines 11 through 13 from the
second file.
If the last line in a set of input lines is incomplete, it is distinguished on output from a
full line by a following line that starts with “\”.
diff3 hunks
Groups of lines that differ in two or three of the input files are called diff3 hunks, by
analogy with diff hunks. If all three input files differ in a diff3 hunk, the hunk is
called a three-way hunk; if just two input files differ, it is a two-way hunk.
As with diff, several solutions are possible. When comparing the files A, B, and C,
diff3 normally finds diff3 hunks by merging the two-way hunks output by the two
commands diff A B and diff A C. This does not necessarily minimize the size of
the output, but exceptions should be rare.
For example, suppose the file F contains the three lines “a”, “b”, “f”, the file G
contains the lines “g”, “b”, “g”, and the file H contains the lines “a”, “b”, “h”. In this
case the command diff3 F G H might produce the following output:
====2
1:1c
3:1c
a
2:1c
g
====
1:3c
f
2:3c
g
3:3c
h
because it found a two-way hunk containing “a” in the first and third files and “g” in
the second file, then the single line “b” common to all three files, then a three-way
hunk containing the last line of each file.
====2
1:1,2c
3:1,2c
The Way that can be told of is not the eternal Way;
The name that can be named is not the eternal name.
2:0a
====1
1:4c
The Named is the mother of all things.
2:2,3c
3:4,5c
The named is the mother of all things.
====3
1:8c
2:7c
so we may see their outcome.
3:9c
so we may see their result.
====
1:11a
2:11,13c
They both may be called deep and profound.
Deeper and more profound,
The door of all subtleties!
3:13,14c
You can remember the order of the arguments by noting that they are in alphabetical
order.
You can think of this as subtracting older from yours and adding the result to mine, or
as merging into mine the changes that would turn older into yours. This merging is
well-defined as long as mine and older match in the neighborhood of each such
change. This fails to be true when all three input files differ or when only older differs;
we call this a conflict. When all three input files differ, we call the conflict an overlap.
The diff3 utility gives you several ways to handle overlaps and conflicts. You can
omit overlaps or conflicts, or select only overlaps, or mark conflicts with special
“<<<<<<<” and “>>>>>>>” lines.
The diff3 utility can output the merge results as an ed script that that can be applied
to the first file to yield the merged output. However, it is usually better to have diff3
generate the merged output directly; this bypasses some problems with ed. Note that
ed is not included with the QNX distribution.
identical, because they assume that such changes have already been merged. If this
assumption is not a safe one, you can use the -A option. (See section “Marking
conflicts”).
Here is the output of the command diff3 with each of these three options (see section
“Sample input files”, for the complete contents of the files). Notice that -e outputs the
union of the disjoint sets of changes output by -3 and -x.
Output of diff3 -e lao tzu tao:
11a
8c
so we may see their result.
.
11a
Marking conflicts
The diff3 utility can mark conflicts in the merged output by bracketing them with
special marker lines. A conflict that comes from two files A and B is marked as
follows:
<<<<<<< A
lines from A
=======
lines from B
>>>>>>> B
<<<<<<< A
lines from A
||||||| B
lines from B
=======
lines from C
>>>>>>> C
The -A option acts like the -e option, except that it brackets conflicts, and it outputs
all changes from older to yours, not just the unmerged changes. Thus, given the
sample input files (see section “Sample input files”), diff3 -A lao tzu tao puts
brackets around the conflict where only tzu differs:
11a
||||||| tzu
They both may be called deep and profound.
Deeper and more profound,
The door of all subtleties!
=======
<<<<<<< tzu
=======
The Way that can be told of is not the eternal Way;
The name that can be named is not the eternal name.
>>>>>>> tao
The Nameless is the origin of Heaven and Earth;
The Named is the mother of all things.
Therefore let there always be non-being,
so we may see their subtlety,
And let there always be being,
so we may see their result.
The two are the same,
But after they are produced,
they have different names.
<<<<<<< lao
||||||| tzu
They both may be called deep and profound.
Deeper and more profound,
The door of all subtleties!
=======
Exit status:
0 diff3 was successful.
Contributing author:
GNU
See also:
cmp, diff, patch
Syntax:
dig [@server] [-b address] [-c class] [-f filename]
[-k filename] [-p port_num] [-q name] [-t type]
[-x addr] [-y [hmac:]name:key] [-4] [-6] [name]
[type] [class] [queryopt...]
dig [-h]
Runs on:
Neutrino
Options:
See http://netbsd.gw.com/cgi-bin/man-cgi?dig++NetBSD-5.0 in the
NetBSD documentation.
Description:
The dig (domain information groper) utility is a flexible tool for interrogating DNS
name servers. It performs DNS lookups and displays the answers that are returned
from the name server(s) that were queried. For more information, see
http://netbsd.gw.com/cgi-bin/man-cgi?dig++NetBSD-5.0 in the NetBSD
documentation.
See also:
dnssec-keygen, host, named in the NetBSD documentation
Syntax:
dinit [-8bpqr] [-F|h] [-B filename|-O] [-d drive_number]
[-f bootfile] [-i blocks] [-L label|-l label]
[-m message] [-N] [-R] [-r] [-S size] drive
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
-8 Use the int 13 extended loader for disks bigger than 8.4Gig.
-B filename Use the 512-byte OS loader from this file instead of the standard
QNX OS loader. Note that on a partitioned hard disk, the OS
loader is the second loader, not the primary bootstrap loader,
which is written to the first block of the hard disk by the fdisk
utility. On a nonpartitioned device, (e.g. floppy) the OS loader
is the primary (and only) bootstrap loader.
-b Don’t initialize the filesystem; just write the OS loader to disk.
You can use this option with -m, or -O.
-d drive_number The BIOS drive number to use for booting the second stage
loader (diskpc2). This enables you to set up the loader to boot
when the drive is configured as either a primary or secondary
drive. Common values for drive_number are: 00 for the first
floppy drive, 80 for the first hard drive, and 81 for the second
hard drive.
This option is required for booting from secondary hard drives
(if you specify an explicit drive number, it overrides -F or -h).
-F Initialize a floppy or LS120 disk.
-f bootfile Write the specified operating system boot image to the /.boot
file on the newly initialized disk.
-H or -h Initialize a hard or compact flash disk. You can’t initialize a
hard disk unless you specify this option.
-i blocks The initial size, in blocks, of the .inodes file. The default is
16. You don’t usually have to change this setting; for more
information, see Fine-Tuning Your System in the Neutrino
User’s Guide.
-l label (“el”) Write the given volume label to disk after initializing.
-L label Write only the given volume label to disk. You can remove a
label by using the -L option with an empty string. For example:
-m message Replace the message the OS displays when booting from disk
with message.
-O Use the old QNX bootstrap loader. The old loader loads at (real
mode) 0x60:0, always. The newer loader looks for a signature
byte in the beginning of the OS image to determine if it’s old or
new, and loads at 0x60:00 or 0x80:00 as appropriate. The
start address for new images is 0x0 relative to the load address,
while the start address for old images is 0x20 relative to the
load address.
-S size When used on a file, grow it to this size, which can include a
suffix of k, m, or g.
drive The drive on which to initialize the hard disk or diskette (e.g.
/dev/fd0, /dev/hd0t77).
Device names under Windows differ from those under QNX 4 and QNX Neutrino. For
example, under Neutrino:
Under Windows:
dinit -f hello.ifs a:
Description:
The dinit utility initializes a formatted diskette or hard disk so that you can use it as
a QNX 4 filesystem, using fs-qnx4.so. The default values are determined from the
current configuration of the specified drive.
We recommend that you use dinit to initialize the QNX 4 filesystem, and dloader
to make it bootable. The dinit bootloader options are for backwards compatibility
reasons, but aren’t generally used anymore.
If the disk is a hard disk, you need to specify the -h or -H (hard) option. This option
helps protect you against typing errors that might cause dinit to initialize your hard
disk. To initialize a hard disk, you must be the superuser.
After initializing a hard disk with dinit, you should use the dcheck utility to remove
any bad blocks from the disk allocation bitmap. For example:
dinit -h /dev/hd0t77
dcheck -m /dev/hd0t77
When dinit initializes a disk, it writes a loader in the first block. If the disk is a
floppy diskette, the loader is the bootstrap loader, else it’s the secondary (or partition)
loader. If you need to rewrite the loader without reinitializing the disk, specify the -b
option.
The -m option lets you change the message the OS displays when booting from disk.
Normally, the message is:
Your new message may contain up to 30 characters plus the trailing period. You can
specify the minimum message of “.” by specifying -m. for the option.
a Read-only.
b Not usually necessary.
For more information, see the Filesystems chapter of the System Architecture guide.
Examples:
Initialize a hard disk:
dinit -h /dev/hd0t77
dinit /dev/fd0
Exit status:
0 Successful.
Caveats:
Don’t use the -r option unless you know exactly what you’re doing. You use the -r
option only after a disaster has destroyed the first few blocks of your disk (e.g. a
power failure occurred while the disk was being updated). In order for any damage to
be repaired, you must follow dinit -r with this command:
chkfsys mountpoint
See also:
chkfsys, dcheck, diskboot, dloader, fdformat, fdisk, fs-qnx4.so,
mkdosfs, mkqnx6fs
Filesystems chapter of System Architecture
QNX Neutrino User’s Guide:
• “Filesystems and block I/O (devb-*) drivers” in the Fine-Tuning Your System
chapter
Syntax:
dirname string
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
None.
Description:
The dirname utility returns a portion of the string operand to standard output. The
string operand represents a valid pathname whose format is:
directory_pathname/base_filename
Examples:
Command: Output:
dirname . .
dirname .. .
dirname ../. ..
dirname /usr/src/prog.c /usr/src
dirname /usr/src/ /usr
dirname ...//[fred] ...
Exit status:
0 Successful completion.
See also:
basename
Syntax:
diskboot [options]...
Runs on:
Neutrino
Options:
-b type Force the boot to a particular type; where type can be 1,2, or 3
depending on the type of boot required:
1 Boot from a hard disk.
2 Boot from a CDROM.
3 Install QNX Neutrino to a new disk partition.
-D UseDma If UseDma is 0, disable DMA for the EIDE driver. If UseDma is
1, enable DMA for the EIDE driver. By default, DMA is disabled.
-d dir The directory to search for *.qfs files on partition filesystems.
The default depends on the filesystem type:
• QNX — /boot/fs
• DOS — /Program Files/qnx/boot/fs
• Linux — /qnx/boot/fs
• cd — /boot/fs
-e Search ext2 partitions.
-f Instead of running finstall, run the installation script on the
CD.
-i Run inflator on the qnxbase.qfs file mountpoint.
-o cmd,options Provide options to use if the given command is started. For
example:
• To pass an option to a specific driver:
-o "devb-eide,blk cache=30m"
-s Start drivers and filesystems but don’t run the sysinit file.
-x drvr Exclude the specified driver. The drvr argument must be the full
name (e.g. -x devb-eide).
Description:
The diskboot utility is built into the boot image for systems that boot from a block
device. Its purpose is to boot a QNX Neutrino system.
If the -b option isn’t set, diskboot starts by searching for all hard disks and
CDROMs on all controllers. A 10-second timeout prevents defective drivers or
hardware from locking the system. The utility then starts all filesystems on all
partitions on hard drives, magneto drives, and CDROMs. If you press the space bar
while diskboot is running, it lets you select additional options.
The diskboot process then runs the /etc/system/sysinit script, which:
• starts any system services that would be in any monolithic UNIX kernel
For a more detailed description, see the Controlling How Neutrino Starts chapter of
the Neutrino User’s Guide.
Examples:
Run diskboot:
diskboot
Files:
.diskroot A file that indicates how to mount the partitions; see the description
of .diskroot in the Controlling How Neutrino Starts chapter of the
Neutrino User’s Guide.
/etc/system/sysinit
A script that sets up system services.
See also:
enum-devices, io-usb, tinit
Controlling How Neutrino Starts in the Neutrino User’s Guide
Syntax:
dispconf -i vid did index [-d drv[,mode opts]]*
[-c file] [-g name=val[ ,name=val[ ,...]]]
Runs on:
Neutrino
Options:
-i vid, did, index The vid (vendor id), did (device id) and index (device index) of
the device for which the device {} section should be added
or updated in the config file. The vid, did, index values are
numbers, if they start with 0xn, then the n is a hexadecimal
value.
photon {
driver {
drivername=drv
modeopts=[modeopts]
}
}
This option can be used multiple times if this device is
supported by multiple drivers. Whenever the list of drivers
changes or when the device section is added for the first time
the device.drivername is set to the first driver. If no drivers
are specified, the default “svga” driver is used.
-g name=val[,name=val[,...]]
Specify overrides of entries in the display {} section.
This option will only work when the device section is added for the first time, or when
the list of drivers changes. To override an entry in the photon {} subsection, use the
following example:
photon.name=val
photon {
enabled=1 # if this is the primary display card.
xoffset=0
yoffset=0
cursor=hardware
input_group=1
}
}
Description:
The dispconf utility has several options that enable you to manipulate the
configuration information for your video hardware.
Files:
/etc/system/config/display.conf
The default configuration file.
/etc/system/config/display.conf.changed
A zero length file. It is created by the dispconf if the configuration has been
changed.
/etc/system/config/crtc-settings
If /etc/system/config/crtc-settings does not exist, try to restore it
from /usr/photon/config/crtc-settings
/usr/photon/config/crtc-settings
This file is used by io-display.
See also:
io-graphics, phgrafx
Connecting Hardware in the Neutrino User’s Guide
Syntax:
dloader [-v] [-d drive_number] [-F|H] [device loader] ...
Runs on:
Neutrino
Targets:
x86
Options:
-d drive_number Sets the BIOS drive number for booting the second stage loader
(diskpc2). This enables you to set up the loader to boot when
the drive is configured as either a primary or secondary drive.
Common values for drive_number are: 00 for the first floppy
drive, 80 for the first hard drive, and 81 for the second hard
drive.
If you don’t specify this option or any of the other override
options (-F, -H), a heuristic based on disk size and removability
determines whether the drive is for a fixed or floppy disk. The
order of precedence used to determine the drive number to be
patched into the loader code is:
1 -d
2 -F
3 -H
4 heuristic
-v Be verbose.
Description:
The dloader utility writes a boot loader to a disk.
The dloader utility starts by looking for the loader you specified. If your loader
name contains a / (slash), dloader assumes it is a complete pathname and looks for
the loader using the path you gave; if not, dloader looks in the processor family
subdirectory of QNX_TARGET (under QNX Neutrino, this would be
Along with these two standard loaders, we also provide loader variants named
pc1-flop and pc2-flop. These variants provide alternative loaders that are
designed to work with floppy diskettes (or a hard disk with a capacity less than 8
Gbytes in an old PC with an old BIOS).
Similarly, users who wish to create and use their own loaders can specify them using
unique variant names.
The device names for our loaders are prefixed with ipl-disk. So if you look in
/x86/boot/sys/ under QNX Neutrino, you will see the following loaders:
• ipl-diskpc1
• ipl-diskpc1-flop
• ipl-diskpc2
• ipl-diskpc2-flop
If you write your own loaders, make sure you use this ipl-disk prefix.
If the loader is in the /x86/boot/sys/ path, you don’t need to specify the ipl-disk
prefix on the command line because dloader adds it for you. If your loader is in a
different directory, you have to specify the exact path, including the prefix.
Assuming you specified a device and loader correctly, dloader opens the device in
the path you specified and, if you selected the verbose option, displays its disk and
partition information.
The specified loader data is then put together and written to the disk.
The floppy (-F] and hard disk (-H] override options let you force dloader to treat a
fixed device (e.g. a hard disk) as if it was a removable device (e.g. a floppy), and
vice-versa.
Examples:
To see a list of available disk loaders:
dloader
Environment variables:
QNX_TARGET The location of target backends on the host machine.
Exit status:
0 The loader was written to the disk.
Errors:
When an error occurs, dloader sends a description of the error to stderr.
See also:
fdisk, dinit
Syntax:
dnssec-dsfromkey [-v level] [-1] [-2] [-a alg] {keyfile}
dnssec-dsfromkey {-s} [-v level] [-1] [-2] [-a alg] [-c class] [-d dir]
{dnsname}
Runs on:
QNX Neutrino
Options:
See http://netbsd.gw.com/cgi-bin/man-cgi?dnssec-dsfromkey++NetBSD-current in the
NetBSD documentation.
Description:
The dnssec-dsfromkey utility outputs the Delegation Signer (DS) resource record
(RR), as defined in RFC 3658 and RFC 4509, for the given key(s). For more
information, see
http://netbsd.gw.com/cgi-bin/man-cgi?dnssec-dsfromkey++NetBSD-current in the
NetBSD documentation.
See also:
dnssec-keygen, dnssec-signzone in the NetBSD documentation.
Syntax:
dnssec-keyfromlabel {-a algorithm} {-l label} [-c class] [-f flag] [-k]
[-n nametype] [-p protocol] [-t type] [-v level] {name}
Runs on:
QNX Neutrino
Options:
See http://netbsd.gw.com/cgi-bin/man-cgi?dnssec-keyfromlabel++NetBSD-current in
the NetBSD documentation.
Description:
The dnssec-keyfromlabel utility gets keys with the given label from a crypto
hardware and builds key files for DNSSEC (Secure DNS), as defined in RFC 2535 and
RFC 4034. For more information, see
http://netbsd.gw.com/cgi-bin/man-cgi?dnssec-keyfromlabel++NetBSD-current in the
NetBSD documentation.
See also:
dnssec-keygen, dnssec-signzone in the NetBSD documentation.
Syntax:
dnssec-keygen {-a algorithm} {-b keysize} {-n nametype}
[-c class] [-e] [-f flag] [-g generator]
[-h] [-k] [-p protocol] [-r randomdev]
[-s strength] [-t type] [-v level] {name}
Runs on:
Neutrino
Options:
See http://netbsd.gw.com/cgi-bin/man-cgi?dnssec-keygen++NetBSD-5.0 in the
NetBSD documentation.
Description:
The dnssec-keygen utility generates keys for DNSSEC (Secure DNS), as defined in
RFC 2535 and RFC 4034. It can also generate keys for use with TSIG (Transaction
Signatures), as defined in RFC 2845. For more information, see
http://netbsd.gw.com/cgi-bin/man-cgi?dnssec-keygen++NetBSD-5.0 in the NetBSD
documentation.
See also:
dnssec-dsfromkey, dnssec-signzone in the NetBSD documentation
Syntax:
dnssec-signzone [-a] [-c class] [-d directory] [-e end-time]
[-f output-file] [-g] [-h] [-k key] [-l domain]
[-i interval] [-I input-format] [-j jitter]
[-N soa-serial-format] [-o origin]
[-O output-format] [-p] [-r randomdev]
[-s start-time] [-t] [-v level]
[-z] {zonefile} [key...]
Runs on:
Neutrino
Options:
See http://netbsd.gw.com/cgi-bin/man-cgi?dnssec-signzone++NetBSD-5.0 in the
NetBSD documentation.
Description:
The dnssec-signzone utility signs a zone. It generates NSEC and RRSIG records
and produces a signed version of the zone. The security status of delegations from the
signed zone (that is, whether the child zones are secure or not) is determined by the
presence or absence of a keyset file for each child zone. For more information, see
http://netbsd.gw.com/cgi-bin/man-cgi?dnssec-signzone++NetBSD-5.0 in the NetBSD
documentation.
See also:
dnssec-dsfromkey, dnssec-keygen in the NetBSD documentation
Syntax:
ds &
Runs on:
Neutrino
Options:
None.
Description:
The data server is a process that maintains a shared state among other processes — it’s
like a global environment. Processes can store or retrieve data using a set of data
server library calls. You can use it for many tasks, but specifically you can access it
from the Slinger webserver in support of dynamic HTML. The HTTP server slinger
makes use of the data server and the data server library.
Data is stored using variable names that represent buffers of data. All of the variables
are global, any process can access them (no attempt is made to restrict access), so only
one instance of the variable (name) can exist in the data server.
Examples:
Here’s a simple (and nonfunctional) example of monitoring the temperature of an oven
from a remote client:
This example uses HTML as the interface to the data server, but the data server isn’t
limited to HTML.
Here’s what the qnxvar tokens on the client’s web page look like:
If the temperature of the oven is currently 500 degrees F, the output looks like:
<P>The oven temperature is 500 degrees F.
#include <stdlib.h>
#include <stdio.h>
#include <ds.h>
#include <string.h>
#define MAXLEN 4
int main(void)
{
ds_t ds_descriptor;
char ovenID[7], oven_temp[MAXLEN], flag=0;
int length = MAXLEN;
ds_descriptor = ds_register();
if(ds_descriptor==-1){
perror("ds_register");
exit(1);
}
strcpy(ovenID,"oven1");
ds_set(ds_descriptor,ovenID,oven_temp,length);
while(1)
//you might want some kind of decision to exit the program.
{
ds_set(ds_descriptor,ovenID,oven_temp,length);
ds_clear(ds_descriptor,ovenID);
ds_deregister(ds_descriptor);
The output HTML page reflects the current temperature stored in the data server.
When this process exits, the data server variable is no longer available because the flag
argument passed to ds_create() was 0.
If this application needs some data passed from HTML text, another variable is
created by calling ds_create() and is used to pass information to it by using the
qnxvar write token in some HTML text. The application gets the data by calling
ds_get() and/or react to the change in data by receiving a proxy or signal.
Here’s what’s happening:
Oven Data
Slinger
control server
SSI token
5:24
Remote
client
Oven
The oven
temperature
is 350
degrees F.
HTML page
In summary:
• Use the qnxvar read token to display a value on the HTML page and use
ds_get() to get the data server variable.
• Use the qnxvar write token to change a variable on the data server process and
use ds_set() to set the data server variable.
See also:
slinger
ds_clear(), ds_create(), ds_deregister(), ds_flags(), ds_get(), ds_register(), ds_set()
in the Library Reference
Setting Up an Embedded Web Server in the Neutrino User’s Guide
Syntax:
du [-a|-s] [-kpqx] [file...]
Runs on:
Neutrino
Options:
-a Generate a report for each file in the directory tree. If you don’t specify this
option, du makes a report for each directory only. The report shows the total
space allocated to all files under the directory, including the directory itself.
-p Report the space figures in bytes (the default is 512-byte blocks). Also, ensure
that du generates error messages when it can’t process existing files (unless the
-q option is specified).
-s Give the total figures for each of the specified files, rather than the totals for
any subdirectories.
file The pathname of a file whose size is to be displayed. If you don’t specify any
files, the current directory is used; du behaves as if the filename dot (.) were
given.
Description:
The du utility prints the amount of file space allocated to the specified files. If you
name a directory, all files in that directory are reported; subdirectories are traversed
recursively. If a file has multiple links, the space allocated to that file is counted only
once.
The space figures are displayed in 512-byte blocks by default. If you want du to print
the size in bytes, specify the -p option. The sizes output by du when you specify the
-p option are accurate with one exception: the numbers may be slightly higher than
expected because they include extent blocks that are part of filesystem overhead
associated with the file, but don’t contain actual data.
If you specify nondirectories, they aren’t listed unless you specify the -a option.
All results are written to the standard output. Errors may result in diagnostic messages
to the standard error. Standard input isn’t used.
Examples:
Estimate disk space consumed by the contents of /tmp, in kbytes:
du -k /tmp
Estimate the total space occupied by the contents of the current directory:
du -s
Exit status:
0 Successful completion.
>0 An error occurred. This doesn’t include failure to read files or directories.
Syntax:
dumpefs [-tuv] embedded files
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
-t Dump the “text” of each extent.
-u Output a unit summary, including the size of the filesystem, and the amount
and percentage of space used.
-v Be verbose.
Description:
The dumpefs utility dumps the contents of an embedded filesystem.
See also:
dumpifs, mkefs
Making an OS Image chapter of Building Embedded Systems
Syntax:
dumper [-d path] [-m] [-n] [-p pid] [-s size[G|M|K]]
[-v] [-w] [-z level] &
Runs on:
Neutrino
Options:
-d path The name of the directory in which to write postmortem dump
files. The default is your home directory.
-p pid Save a dump file for this process immediately, and then exit
dumper.
-v Be verbose.
-z level Use gzip to compress the core files. The compression level must
be in the range from 1 (fastest) through 9 (best compressed).
Description:
The dumper utility runs in the background and provides a postmortem dump service
for all processes. Whenever a program terminates abnormally, a dump of the current
state of the program is written to disk. The dump filename is the same as the program
name with a .core extension. For example, if the program name is experiment, the
dump is written to experiment.core in your home directory.
You can use the -d option to force all dumps into a directory other than /var/dumps.
Dump files can be large, so make sure the destination filesystem has lots of space.
The -p option lets you get a dump immediately for a particular process. If you specify
-p, dumper doesn’t run in the background, but exits right away.
You can use a debugger such as gdb to examine a dump file:
For example:
A program may terminate in one of two ways: it may exit cleanly under its own
control, returning an exit status, or it may be forcibly terminated by the receipt of a
signal that it isn’t prepared to handle. In the latter case, dumper writes a dump file for
the following set of signals:
Signal Description
SIGABRT Program-called abort function
SIGBUS Parity error
SIGEMT EMT instruction
SIGFPE Floating-point error or division by zero
SIGILL Illegal instruction executed
SIGQUIT Quit
SIGSEGV Segmentation violation
SIGSYS Bad argument to a system call
SIGTRAP Trace trap (not reset when caught)
SIGXCPU Exceeded the CPU limit
SIGXFSZ Exceeded the file size limit
You can force the dump of a running program by setting one of the preceding signals,
assuming that the program isn’t masking or handling the signal itself. For example, to
force a dump using the kill command and a process ID (pid):
kill -SIGABRT pid
To force a dump using the slay utility and the process name:
slay -s SIGABRT process_name
Examples:
Start dumper, with dump files to be written to the default directory:
dumper &
Files:
/proc/dumper A special entry in the /proc filesystem (see procnto*) that
receives notification when a process terminates abnormally.
Exit status:
The dumper utility normally doesn’t terminate. However, it may terminate if it
encounters an error on startup (for instance, if it wasn’t run by root) or if it receives a
signal.
See also:
coreinfo, gdb, kill, slay
Syntax:
dumpifs [-f file] [-m] [-vxb -u file] image [files]
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
-b When using the -x option, extract to the basenames of the files.
-x Extract the files specified after the image. If you also specify -b, the files
are put into the current directory; if you don’t specify -b, the files are
extracted to the pathname specified in the image.
Description:
The dumpifs utility dumps the contents of an image filesystem. It can also be used to
extract files from the image filesystem.
Examples:
$ dumpifs shell.ifs
Offset Size Name
0 288 *.boot
288 100 Startup-header flags1=0x1 paddr_bias=0
388 6008 startup.*
6390 59 Image-header mountpoint=/
63ec 1ac Image-directory
---- ---- Root-dirent
6598 8c proc/boot/data1
6624 5c proc/boot/.script
6680 14 proc/boot/data2
7000 2c02c proc/boot/procnto
34000 12ad0 proc/boot/devc-con
47000 b66c proc/boot/esh
53000 d7fc proc/boot/ls
61000 7394 proc/boot/cat
Checksums: image=0x6d5fb484 startup=0x274d7c89
Caveats:
This utility will not work on an image that has been built using a filter such as srec
(for more information on image filters, see mkifs). If you wanted to run dumpifs on
such an image, you would build the image omitting the filter stage in your mkifs
build file (you would then need to run the filter by hand later in order to make a viable
image for your target).
See also:
mkifs
Syntax:
echo [-n] [string...]
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
-n Don’t write a trailing newline character.
Description:
The echo command is present both as a shell builtin (see the echo command for ksh)
and as a standalone executable that can operate without the availability of the system
shell. Both versions behave in a similar manner. To make sure you use the executable,
specify the full path.
The echo utility writes its arguments, followed by a newline character, to standard
output. If there are no arguments, only the newline character is written.
The echo utility supports the following escape sequences within string:
Escape Description
\a Write an alert character (the bell).
\b Write a backspace character.
\c Suppress the newline character that otherwise follows the final argument
in the output. All characters following the \c in the arguments are
ignored.
\f Write a formfeed character.
\n Write a newline character.
\r Write a carriage-return character.
\t Write a tab character.
\v Write a vertical tab character.
\\ Write a backslash character.
\0num Write an 8-bit value that’s the ASCII character represented by the
specified 1-, 2-, or 3-digit octal number num.
The escape sequences listed above are extensions to POSIX. For a more versatile
utility that’s portable, see printf.
Examples:
Echo the string Hello, Mother\nHello, Father to the standard output (note that
echo appends a final trailing newline):
Exit status:
0 Successful completion.
See also:
cat, ksh, printf, sh
Syntax:
ed [-] [-sx] [-p string] [file]
Runs on:
QNX Neutrino
Options:
-s Suppress diagnostics. Use this option if the standard input to ed is from
a script.
-x Prompt for an encryption key that will be used for reads and writes.
Description:
The ed utility is a text editor.
See also:
elvis, ped, qed, vi
Syntax:
egrep [-cilnqsvx]
[-e expression | -f expression_file]...
[file...]
egrep [-cilnqsvx] expression [file...]
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
See grep for a complete listing.
Description:
The egrep utility does an extended regular expression grep (equivalent to grep -E).
See the documentation for grep for details.
Exit status:
0 Lines were found matching the expression provided.
See also:
grep
Syntax:
elvis [options]... [+command] file...
Runs on:
Neutrino
Options:
-c command Begin editing by executing this ex command.
-m [file] Scan file for errors and position the cursor at the offending line
number. If you don’t specify file, errlist is used.
-t tag Start editing at the given tag. (See the ctags utility.)
Description:
The elvis utility is an interactive fullscreen editor that is compatible with the
Unix/POSIX vi editor. The vi utility in QNX Neutrino is a link to elvis.
In elvis, changes are buffered and are written to the file only upon request. Since a
temporary file is used for storage, elvis can edit files larger than the amount of
memory available on the machine it’s run on.
There are two major command modes:
• visual mode
You can switch between modes. You’ll probably use the visual command mode most
of the time. This is the mode elvis normally starts up in.
In visual mode, the entire screen is filled with lines of text from your file (except the
last screen line, which is reserved for status). You can view text and move around the
file. Each keystroke is interpreted as part of a visual command. If you start typing text,
it isn’t inserted; instead, it’s treated as part of a command. To insert text, you must first
give an “insert text” command (see “Inserting text”).
The ex mode is quite different. In this mode, elvis displays a “:” character on the
bottom line of the screen as a prompt. You are then expected to type in a command
and press Enter. The set of commands recognized in ex mode differs from those in
visual mode, and are known as ex commands. A summary of these commands is
found at the end of this description. (A line-oriented editor, ex is a predecessor of vi,
and the two share common functionality.)
The capabilities of elvis are described throughout the following sections:
• Visual mode
- Input mode
- Operators
- Special cases
- Named buffers
• Movement commands
- Cursor movement
- Marking
- Tags
• Inserting text
- Input mode
• Filters
• Shifting text
• Miscellaneous commands
• Searching
• Screen commands
• Writing files
• Reading in a file
• Leaving elvis
• Escaping to a shell
• Macros
• Abbreviations
• Options
• ex commands
Visual mode
Most visual mode commands are one keystroke long. The following sections list the
operation performed by each keystroke, and any necessary options or operands.
Most commands may be preceded by a decimal number. Usually, this number
specifies how many times the command is to be repeated. Without this number, the
command in most cases executes just once.
Input mode
You can’t enter text into your file directly from visual command mode. Instead, you
must first give a command that puts you into input mode. The commands to do this
are:
A, C, I, O, R, S,
a, c, i, o, s
Visual command mode looks a lot like text input mode. If you forget which mode
you’re in, just press Esc. If elvis beeps, you’re in visual command mode. If elvis
doesn’t beep, you were in input mode — by pressing Esc you switch to visual
command mode. One way or another, after you press Esc, elvis is ready for a
command.
Note that if the showmode option is set (this option described in the “Options” section
below), the mode is displayed in the lower right-hand corner as either Command or
Input. Also note that each mode uses a different cursor shape.
Operators
Among its various commands, elvis has seven basic but powerful operators that let
you change, delete, cut, paste, shift, or filter text regions. Although they’re described
below in the appropriate sections, you should note that, for the most part, they all share
a common form:
op<object>
Where op can be:
c Change
d Delete
y Yank (copy)
! Filter
p Put
The object operand specifies the range of text that the op operator acts upon. The
object can be any movement command or pattern search. (See “Movement
commands.”) In this way, you can see the power of the operators. The elvis utility
can act on words, sentences, regions up to a specified pattern — whatever range the
object operand specifies.
When you give a movement command as an operand, you can specify an optional
count [n] to multiply the effect of the operand (e.g. d2w to delete next two words).
When a count isn’t provided, it typically defaults to 1.
Special cases
Operators are frequently used with lines. So, for simplicity, a few special forms of
these commands operate only with line objects. The following list shows the syntax of
these special forms. Note the count is optional, and precedes the operator (this differs
from the above form):
[n]Y
[n]yy Yank n lines
Named buffers
When you yank, delete, change, shift, or filter text, elvis saves the affected region in
a single unnamed cut buffer, which you can recall by the p (put) command. However,
elvis also has 26 named buffers, a to z, that you can use to save blocks of text during
an editing session. These buffers are often used when editing multiple files to move
text around.
You can prefix the previously defined operator forms by "a through "z (represented
below by "<a-z>) to indicate which cut buffer to use to store the modified text region:
"<a-z>op<object>
Normal cases.
When you use the uppercase letters to denote the named buffers, the objects are
appended to the buffer:
"<A-Z>op<object>
Normal cases.
"<A-Z>[n]op Special cases.
Movement commands
The following movement commands provide a convenient means to position the
cursor throughout the file being edited. You can precede most by an optional count to
repeat the action. More importantly, you can use these movement commands as
operands to the change, yank, delete, put commands to specify the range of action to
be performed (see “Inserting text” and “Deleting, yanking, putting” sections).
The movement commands operate on the following text objects:
. ! ?
Paragraph A paragraph starts after an empty line or any of the pairs of characters
defined with the :set pa= option are found.
Section A section starts where any of the pairs of characters defined with the
:set se= option are found.
Cursor movement
To move the cursor, you can use the keypad arrow keys; you can also use the H, J, K,
and L keys.
[n]j
[n]down-arrow
[n]Ctrl-J
[n]Ctrl-N Move down n lines (next).
[n]k
[n]up-arrow
[n]Ctrl-P Move up n lines (previous).
[n]l
[n]right-arrow
[n]Space Move right n characters.
[n]h
[n]left-arrow
[n]Backspace Move left n characters.
[n]W Move to the beginning of the next word that follows white space.
[n]G Move to the specified line (default is last line of file for a single G
command).
[n]f<char> Move to the nth occurrence of char (in forward direction) on the
current line. The cursor is placed at the matched character.
[n]F<char> Move to the nth occurrence of char (in backward direction) on the
current line. The cursor is placed at the matched character.
[n]t<char> Move to the nth occurrence of char (in forward direction) on the
current line. The cursor is placed just before the matched character.
[n]T<char> Move to the nth occurrence of char (in backward direction) on the
current line. The cursor is placed just before the matched character.
[n]H Move to the top left position of screen. If n is specified, move the
cursor to the beginning of the line n lines from the top of the
screen.
Marking
‘<a-z> Move to the exact position marked with the character <a-z>.
’’ Move back to the beginning of the line where it was before the last
“nonrelative” move.
‘‘ Move back to the exact position it was before the last nonrelative move.
Tags
Tags can’t be included as <object> operands for commands such as change, yank, put,
delete, shift, and filter.
Ctrl-] The word at the cursor position is taken as the tag, and the editor finds the
word as with the :ta command.
Inserting text
The following commands enter input mode, where the text you enter (until you press
Esc) is put into the file:
o Open a new line below line cursor is on, insert text there.
O Open a new line above line cursor is on, insert text there.
c<object> Change the text between the current position and the position specified
by the <object> (movement operand or pattern). You can specify an
optional count to multiply the effect of the <object> operand (e.g. c2w
to change next two words).
If the range is within the current line, a $ is displayed at the end of the
<object> to indicate end-of-range. Otherwise, the text in the range is
deleted and you’re placed in input mode. When within a line, the
specified range of text isn’t deleted until you type Enter.
R Replace the rest of the line with text. Rather than delete the text as with
the change command, before going into insert mode, all text entered
overwrites the current line until it has been completely replaced; at that
point you’re placed in input mode.
Input mode
In input mode, all keystrokes are inserted into the text at the cursor’s position, except
for the following:
Esc
Ctrl-[ Exit from input mode, back to command mode.
erase
Ctrl-H Erase the character before the cursor.
Ctrl-M
Enter Insert a newline.
Ctrl-V Insert the following keystroke, even if special (e.g. Ctrl-V Ctrl-L inserts a
form-feed).
Delete Delete the specified region and place the text into the unnamed buffer, or a
named buffer if one is specified.
Yank Make a copy of the specified region and place it into the unnamed buffer, or
a named buffer if one is specified.
Put Put the contents of the unnamed buffer, or of the named buffer if specified,
into its new location.
When you have a sequence of text you want to copy or move to a different location,
you first use the yank or delete operators to copy or delete the data into a buffer; you
then use the put command to place the data at its new location.
If you’re using named buffers, you can switch to another file before putting the text
back. Thus you can copy from one file to another.
To copy the next four lines, yank them with a command such as 4yy or y4j, move to a
new location and put the text by typing the p command.
To delete the next four lines, type 4dd or d4j.
To move the next four lines, use a command such as 4ddor d4j, then move to a new
location and put the text by typing p or :pu.
Filters
With the filter command, you can select regions of text and run them through any
command and insert the output into the file. The text in the range specified from the
current line to the delimited <object> is filtered through the command and replaces the
region specified. The text that was in the region before being replaced by the output of
the command is saved in the unnamed buffer, or in a named buffer if one was
specified. If uppercase letters are used, elvis appends text to the named buffer.
!<object>command
Delete the specified text object into a buffer (unnamed, or named if given). Pass
the specified text region to the standard input of the command, and replace it
with the command’s output. When you enter this command, the ! prompt
doesn’t appear until an <object> has been given.
Shifting text
The shift operators, < and >, shift all the lines delimited by the current line and the
<object> operand. Text is shifted by the value of the shiftwidth option (see below).
The forms of the shift command are:
Miscellaneous commands
[n]. Repeat last text modifying command n times.
:[x,y]l Display text in the specified range with tab and end-of-line markers.
Searching
A pattern used for searching and substituting is called a regular expression. While
most characters match themselves in a search request, some have special meaning, as
described in the table below. To be used in a search expression, these special
characters must be preceded by a backslash (\).
Character Meaning
ˆ Match “beginning of line”.
$ Match “end of line”.
. Match any single character except the newline.
\< Match the beginning of a word.
\> Match the end of a word.
[string] Match any single character in string.
[ˆstring] Match any single character not in string.
[x-y] Match any character between x and y (range).
[ˆx-y] Match any character not between x and y (range).
* Match any repeated characters.
\ Escape special characters.
/[pattern]/{+|-}nEnter
Go to the nth line relative to the line on which pattern is found,
in forward direction.
?[pattern]?{+|-}nEnter
Go to the nth line relative to the line on which pattern is found,
in backward direction.
/fred[1-3]
To match QNX Neutrino at the beginning of a line:
/ˆQNX Neutrino
To match QNX Neutrino at the end of a line:
/QNX Neutrino$
Substitute command
The substitute command substitutes text matching a pattern with replacement text:
:[x,y]s/pattern/replacement_text/[c][g][p]
If none of the modifiers c, g, or p is specified, this command replaces the first
occurrence of the given pattern. You can modify this behavior by specifying any
combination of the three modifiers:
This command is very powerful when used in conjunction with the global command
(see below).
Global command
The global command searches through the lines of the specified range — or through
the whole file if no range ([x,y]) is specified — for lines that contain the pattern. The
command is performed on each matching line. The global command is of the
following form:
:[x,y]g/pattern/command
Execute command for every line that matches pattern.
:[x,y]g!/pattern/command
:[x,y]v/pattern/command
Execute command for every line that doesn’t match pattern.
You can combine the substitute and global commands, using the following syntax:
[x,y]g/pattern/s//replacement_text/
This command runs the substitute command on every occurrence of a matched pattern
within the given range. The null pattern specification (i.e. //) indicates to the
substitute command that it’s to use the currently matched global pattern as the text it’s
to replace.
The following variations may also be used:
[x,y]g!/pattern/s//replacement_text/
[x,y]v/pattern/s//replacement_text/
For example, substitute the word fred with the word barney in lines 1 to 10:
1,10g/fred/s//barney
Match every mary that’s at the beginning of a line and prompt the user to confirm the
substitution:
1,$g/ˆmary/s//dave/c
u Undo the effects of the last command that changed the edit buffer.
U Undo the effects of all the text modifying commands performed on this line.
Return the line to its original state.
The editor saves the last nine deleted blocks of text in save buffers. You can retrieve a
buffer with the following commands:
" np Retrieve nth previous deletion (1-9). Place after the cursor.
" nP Retrieve nth previous deletion (1-9). Place before the cursor.
If you accidentally select the wrong buffer, you can use the undo command to clear it
and then try specifying a different buffer.
You can also use named buffers (see “Deleting, yanking, putting”):
"<a-z>p Retrieve the contents of the named buffer. Place after the cursor.
"<a-z>P Retrieve the contents of the named buffer. Place before the cursor.
Screen commands
The scrolling commands are as follows:
[n]Pg Up
[n]Ctrl-B Jump backward n pages.
Ctrl-G
:f Display status line on bottom of screen.
Writing files
The following commands write to a file. You can precede all w commands by an [x,y]
range. For example, specify 1,6w to write the first 6 lines.
ZZ OR :x Exit elvis. If any changes were made, the edit buffer is written to the
file.
:e! file Edit file, discarding unsaved changes to the current file.
:e #
Ctrl-ˆ Return to the previous position in the last edited file.
:n! Edit the next file, discarding unsaved changes to the current one.
:rew! Rewind the list of files, re-edit the first file, and discard any unsaved
changes to the current file.
Reading in a file
:r file Read in file after the cursor.
Leaving elvis
ZZ or :x Exit elvis. If any changes were made, the edit buffer is written to the
file.
Escaping to a shell
To execute a single command from within elvis, you can use the following
command:
:sh Start a subshell. You can type Ctrl-D or exit to return to elvis.
Macros
Macros let you bind a single key to an arbitrary set of editing commands.
Defining a macro is simple: you define an lhs (left-hand side), which is the single
character you want translated, followed by an rhs (right hand side), which is the
sequence it is mapped into.
Abbreviations
Word abbreviations are similar to macros, but they expand a short word into a longer
word or words. If you type the abbreviation as part of a longer word, it’s left alone.
Abbreviations are used in input mode primarily to save typing.
Substitution isn’t performed until you type a nonalphanumeric character to mark the
end of the word. If you type Ctrl-V before the nonalphanumeric character, elvis
doesn’t perform the substitution.
For example:
This inserts the text mary had a little ram whenever the word woof is typed.
Options
You can set or examine options via the colon command set. The values of options
affects the operation of subsequent commands.
There are three option types:
• those that toggle on or off; these are enabled by typing :set option and disabled
by typing :set nooption.
• those that expect a string value; these are used by typing :set option=value
:set all
For convenience, options have both a long descriptive name and a short name (shown
in parentheses below) that’s easier to type. You may use either interchangeably.
If your /tmp directory is on ramdisk, recovery isn’t possible if the system is rebooted.
edcompatible (ed)
Default: noed
Remember :s// options.
It’s assumed your formatter uses commands that start with a “.”
character at the front of a line, followed by a one- or
two-character command name.
The value of the paragraphs option is a string in which each
pair of characters is one possible form of your text formatter’s
paragraph command. For example, lines starting with .IP, .LP,
or .PP are considered new paragraphs.
You can configure the option settings with the EXINIT environment variable:
EXINIT="set ai aw"
export EXINIT
ex commands
The following list of ex commands is intended for your convenience only. It’s beyond
the scope of this document to describe the operations of these commands in detail.
Most of these commands have been indicated as alternatives to the visual mode
commands described in the above sections.
The general form of these commands is:
continued. . .
Command Form
escape !command
print next CR
lshift <
rshift >
Files:
/tmp/elv* During editing, text is stored in a temporary file in /tmp.
tags The tag database created by ctags and used by the :tags
command and the -t option.
Environment variables:
LINES, COLUMNS
Overrides the screen size values associated with your terminal type.
EXINIT Default elvis option settings. If set, the contents of this environment
variable are executed on startup as a series of ex commands.
The elvis utility requires that the TERM environment variable be set to indicate
your terminal type. For example, if elvis is running on a console, TERM should be
set as follows:
export TERM=qansi
or
export TERM=qnx
Contributing author:
Steve Kirkendall
Caveats:
When displayed, long lines scroll horizontally. On some implementations, these wrap
onto multiple rows on the screen.
Under QNX Neutrino, you must have a /tmp directory for temporary files. To use a
RAM disk as /tmp, try this:
See also:
ctags, ed, ped, qed, sed, vi
Using Editors in the Neutrino User’s Guide
Linda Lamb, Learning the vi Editor, O’Reilly and Associates, 1990
Syntax:
enum-devices options
Runs on:
Neutrino
Options:
-c path Specify one or more configuration files. The path can either be a
single file, or the name of a directory:
• If a single file, enum-devices reads the contents of the file.
• If a directory, enum-devices reads the contents of all the files
contained in the directory.
You can repeat this option to specify multiple configuration files
and directories; you can also use a config clause in a
configuration file to include other files and directories (see below).
Before it starts processing, enum-devices concatenates the
contents of all the configuration files that you tell it to read.
-I suffix Ignore any configuration files in directories whose names end with
suffix.
-v[v...] Operate verbosely. The more v characters, the more verbose the
output is.
Description:
This description of enum-devices includes the following sections;
• Overview
• Matching rules
• Configuration files
Overview
The enum-devices manager enumerates the devices present on your computer. This
manager first reads the configuration files specified by any -c command-line options.
Next, the configuration manager queries its various enumerators to discover what
devices are on the system. It then matches these devices against the device IDs listed
in the configuration files. If the device matches, enum-devices executes the action
clauses associated with the device.
Programs that are spawned by any start and requires clauses aren’t actually
started until all processing is completed, so that any built-up command lines are
finished. If you want to perform an action regardless of what devices are present, use
the all device ID.
Matching rules
Matching behavior for enum-devices is based on the “number of matches” in the
enum-devices configuration file device statement. A secondary device statement
may be created by placing a period (“.”) in front of the match field.
This method for matching devices with entries in the enum-devices configuration
file can sometimes result in “ambiguities”: a specified device that matches more than
one entry in the enum-devices configuration file, rendering it impossible for the
enumerator to select the preferred driver for the device.
For example, with a device fully specified as:
ven=1922,dev=1234,busno=0,devno=1,
rev=100,msven=fe,mscomp=MTP,mssubcomp=0
device(usb, ven=1922,dev=1234)
device(usb, class=08,proto=00)
the specified device matches both the entries in the configuration file.
This ambiguity can be removed by either extending the match criteria for the preferred
driver:
device(usb, ven=1922,dev=1234,class=08)
or by making one of the matching fields secondary; that is, by giving it a lower
precedence that the other fields:
device(usb, .class=08,proto=00)
A “catch all” (an action that matches any device) is produced by simply entering the
bus type for the device. For example:
device(usb)
echo("No match found for device ven=$(ven),
dev=$(dev), class=$(class), busno=$(busno),
devno=$(devno), cfg=$(cfg), iface=$(iface),
msven=$(msven), mscomp=$(mscomp),
mssubcomp=$(mssubcomp)" )
Configuration files
Configuration files in the etc/system/enum/ directory include:
etc/system/enum/devices/
• audio
• block
etc/system/enum/devices/usb/
etc/system/enum/include/
• audio
• block
• isa-types
• par-class
• pccard-types
• pccard-vendors
• pci-class
• pci-vendors
• pnpbios-types
• net
• graphics
• usb-class
• the order in which configuration files are passed via the commandline -c option
If files are added to an enumeration directory after the enumeration utility has been
started, the enumerator picks up these files and assigns them a higher precedence than
currently existing files.
Given the complexity associated with adding and removing files and directories during
processing, QNX recommends that you:
/enum
common
/devices
default
net
mass
char
/include
usb-class
/overrides
mass
Anything after a number sign (#) until the end of the line is considered a comment.
Each statement is in this form:
device_id...
action_clause
.
.
.
The device_id is either the keyword all or any number of identifiers in this form:
device(bus_type[, specification]...)
• none
• pci
• cardbus
• isa
• pcmcia
• pnpbios
• isapnp
• serenum
• lptenum
Each clause is a keyword, followed by any required arguments. The clauses include:
start clause
It runs the command and arguments specified by system_command. If you specify the
/wait option, the enumerator pauses until the command terminates.
If you specify system_args, the manager searches for a start clause with a
system_command that’s identical to this one, and appends system_args to its
command line. This is a useful way to start just one instance of a command, specifying
the arguments needed for all of the devices found.
For example, this clause:
says to start spooler -d$(path), but tells enum-devices that if it’s already
encountered this command, just append -P$(pnpstr) to it. (The $(...) notation is
for macro expansion; see the set clause, below.)
requires clause
If you specify system_args, don’t forget the comma between system_command and
system_args; if you omit it, enum-devices doesn’t check to see if the command is
already running — it might start the command more than once.
For example, the /etc/system/enum/devices/net enumeration file
includes this line for the network devices that need io-pkt*:
requires($(IOPKT_CMD),)
requires[/wait] (@tag_string)
If you use this form, enum-devices searches all the pending action lines for
tag names of tag_name (see the tag clause) and executes them. This can be
useful when you need a certain ordering of various components.
If you specify the /wait option in either form, the enumerator pauses until the
command terminates.
driver clause
It’s similar to the start clause, but if the bus-enumerator process indicates that the
device might be removed, enum-devices starts an individual driver process for the
device (instead of tacking the system_args onto a previously specified driver for the
same device). If the bus enumerator indicates that the device has been removed, a
SIGTERM signal is sent to the driver process.
If you specify the /wait option, the enumerator pauses until the command terminates.
mount clause
It spawns the mount command with the given mount_args arguments. If you specify
any umount_args, they’re passed to umount if or when the device is removed.
enumerator clause
set clause
You can recursively nest macros the way that you can in make.
append clause
uniq clause
This clause makes enum-devices search an internal database for the string
uniq_name:
For example, you can use a uniq clause to keep track of how many instances of a
device you’ve found, so you can create a unique path for a device:
uniq(sernum, devc-ser, 1)
driver(devc-ser8250 $(SER_OPTIONS), "-u$(sernum) $(ioport),$(irq)")
waitfor clause
This clause makes enum-devices wait for up to timeout tenths of a second for
pathname to appear. If you don’t specify timeout, enum-devices waits for 10
seconds.
echo clause
It echoes string to output_file. If this is the first occurrence of an echo to the file for
this invocation of the configuration manager, enum-devices erases output_file
before doing the echo. For subsequent occurrences, enum-devices appends to the
file. If you don’t specify an output_file, the output goes to standard output.
tag clause
It gives the name, tag_string, to the subsequent block of action clauses. Use this
clause to indicate the commands to run when you use the second form of the
requires clause.
config clause
use clause
• merges the macro definitions in device_list with those of the device event that
caused the action clauses to be invoked (the device_list definitions have priority)
Macros
When invoking an action-clause sequence, a number of of special macros are available
for expansion. What they are depends on the bus that the device is present on.
For PCI devices, the macros are:
Bus-enumerator protocol
To handle the bus-specific aspects of device enumeration, enum-devices spawns
separate bus-enumerator programs. The standard output of these programs is
connected to a pipe that enum-devices reads from. As the bus enumerator does its
bus scan, it writes lines to standard output describing what it’s found. Each line must
be written to the pipe atomically. Each line starts with a one-character code (defined in
<hw/enumdata.h> in the form ENUMER_CODE_*) and is immediately followed by
the process ID of the bus enumerator.
Here are the lines that can be written for each C macro definition:
ENUMER_CODE_DEV_PERM
This line reports a permanently connected device (i.e one that will never be
removed while the system is running):
Dpid { macro=value }
A sequence of macro names and values follows the D code and pid. If there’s
more than one macro, separate them with spaces. These are available for
expansion in the action clauses that enum-devices invokes for the device.
You must define the following special macros because enum-devices uses
them to identify the device:
#define ENUMER_SYM_BUSTYPE "bus"
#define ENUMER_SYM_VENDOR "ven"
#define ENUMER_SYM_SUBVENDOR "dev"
#define ENUMER_SYM_CLASS "class"
#define ENUMER_SYM_SUBCLASS "subclass"
ENUMER_CODE_DEV_TEMP
This is similar to ENUMER_CODE_DEV_PERM, except that the device might be
removed while the system is running:
dpid { macro=definition }
ENUMER_CODE_DEV_ACTIVE
This is similar to ENUMER_CODE_DEV_PERM, except that the indicated
device is already running on the system:
apid { macro=definition }
If another bus enumerator reports the device, its driver shouldn’t be started since
it’s already running.
ENUMER_CODE_DEV_REMOVED
This line is reported when a device is removed from a running system:
gpid { macro=definition }
ENUMER_CODE_BUS
This is used for reporting additional buses that need new enumerators started:
Bpid { macro=definition }
ENUMER_CODE_SCAN_DONE
Write this line when the bus enumerator has finished scanning its bus:
Fpid
When all the bus enumerators started have written this line, enum-devices
invokes the required action clauses (note that ENUMER_CODE_BUS actions are
invoked immediately). If no devices may be added/deleted from the bus, the bus
enumerator should terminate after writing this line. If there are temporary
devices, it should remain running and write ENUMER_CODE_DEV_TEMP
and/or ENUMER_CODE_DEV_REMOVED events followed by another
ENUMER_CODE_SCAN_DONE as devices are inserted or removed.
ENUMER_CODE_ERROR
Write this line when the bus enumerator detects an error of some kind:
Epid error_message_text
#pid comment_text
Examples:
Here’s a sample configuration file:
# prefixing generic commands
all
# so we can say "pci($(ATI), ....) for readability
set( ATI, 0x1234 )
echo( "starting configuration" )
• In the enum-devices configuration file, all text following a number sign (#) up to
the end of the line is a comment.
• The default enum-devices configuration files are for a standard x86 self-hosted
implementation. If you use enum-devices in another environment, you may need
to modify these default configuration files. For example, if only a subset of the
enumerators specified by the default enumerator clause are present on your target
system, you must remove from the configuration the enumerator clauses and the
associated device statements for the absent enumerators.
• The device enumerator doesn’t start devb-fdc by default. If your system has a
floppy drive, you can start the driver manually or uncomment the devb-fdc lines
in the /etc/system/enum/devices/block file.
See also:
Controlling How Neutrino Starts in the Neutrino User’s Guide
Syntax:
enum-usb [options]
enum-usb [options,]validate
Runs on:
Neutrino
Targets:
ARM, PowerPC, SH, x86
Options:
Options for enum-usb are separated by commas, with no whitespaces. They include:
cfg_file_path=pathname
pathname is the path to the enum-usb configuration file.
Default is /etc/enum-usb.conf.
check_MS_desc Query devices for Microsoft descriptor data. Default is off. See
“Microsoft descriptors” below.
iface_tbl_size=size
size is the maximum number of interfaces enum-usb will
manage at the same time. These interfaces can be on any
number of devices. Default is 50 interfaces.
USB_mgr_pathname=pathname
pathname is the path to the USB resource manager. Default is
/dev/io-usb/io-usb.
Description:
This description of enum-usb includes the following sections;
• Overview
Overview
The enum-usb utility is a bus-enumerator program spawned by enum-devices to
handle USB-specific aspects of device enumeration.
Since enum-usb is spawned by enum-devices, enum-usb options are specified by
the enumerator clause in the enum-devices configuration files. For example:
enumerator("usb verbose=10,cfg_file_path=/etc/enum-usb.conf")
• num_iface — the number of interfaces available for the selected USB device
configuration
See the enum-usb configuration file’s Set for additional information that enum-usb
can provide to enum-devices.
Microsoft descriptors
If the device (for example a PFS device) supports Microsoft descriptors, enum-usb
provides the following additional information:
CAUTION: For the Microsoft descriptor information to be present, you must enable
! the check_MS_desc option, but enabling the check_MS_desc option may cause
some devices to become unresponsive. Disable this option unless you are using PFS
devices or have other features dependent on Microsoft descriptor data enabled on your
target.
• Ignore — instruct enum-usb to ignore the USB device; see Ignore below.
Each option must be on its own, separate line. Commented lines begin with a number
sign (“#”) and are ignored by enum-usb. Blank spaces are ignored.
Device
The enum-usb configuration file Device option identifies the start of a device
configuration definition. All options that follow a Device option in the configuration
file are applied to that device, up to a new instance of the Device option.
The Device option identifies a USB device by its:
• device ID (did)
• vendor ID (vid)
Device [vid=v],[did=d],[ser=s]
The rules for composing the Device option statement are:
• In the model above, vvvv, dddd and s represent the hexadecimal values to match,
and s represents the serial number string.
• If the device will be ignored, do not specify the serial ID (ser) parameter; see
Ignore below.
• The option statement supports wildcard matching (see fnmatch()), so you can
match a range of devices. For example, did=05ac,vid=12*, would match a
specific vendor and a range of devices, where 12* matches 1200 through 12FF.
• If matching strings do not contain a wildcard, they must specify the vendor ID (vid)
and the device ID (did) as four numerals, with leading zeros if necessary. The serial
number is a string with a device specific format and length.
Ignore
The Ignore option instructs enum-usb to ignore the device and to not enumerate it.
This option is useful if you have a USB device for which a driver registers for the
insertion event for the device itself and does not need to be launched by the
enumerator. Instructing enum-usb to ignore this type of device, eliminates any
possible conflict between the enumerator and the driver, which might both attempt to
attach to the device at the same time.
If you want enum-usb to Ignore a device, the Device option identifying it should
specify only the device ID and the vendor ID.
enum-usb ignores serial numbers defined in the Device option of ignored devices,
because to obtain a device’s serial number it must “attach” to the device, and attaching
to an ignored device may create a conflict with a driver attempting to get exclusive
access to the device.
Config
The Config option allows the user to specify which USB device configuration is used
when the device to be enumerated supports multiple configurations.
If the Config option is not used, the enum-usb uses the first device configuration
selected. If Config option is used but the specified configuration is not present on the
device, enum-usb logs an error and does not enumerate the device.
When enum-usb encounters the specified device, it sets the USB device’s
configuration to either the number specified (Config num=x) by the Config option,
or to the first configuration with an interface that matches the class and subclass
combination specified by the Config option.
option lines for each Device, in priority order. enum-usb uses the first Config option
statement that matches the device for which it is listed.
Config [class=xx],[subclass=xx]
or:
Config num=x
• In the model above, xx represents the hexadecimal values for the class and subclass
to match, and x represents the configuration decimal value to match.
• The matching strings for class and subclass must be two numerals, with a leading
zero if necessary.
• When you specifying the configuration number, you are specifying the value
reference number of the configuration, rather than its index. For example, if a
device has two configurations, they may not be referred to as configuration one and
configuration two. To determine the configuration value of a device configuration,
refer to the output of the USB utility (usb -vv).
• QNX recommends that you use the class and subclass parameters wherever
possible, rather than a configuration number (num). For some devices, the
environment in which they are used may affect which configurations they report.
This device characteristic means that in different environments, the same
configuration number may represent different configurations.
• Use the configuration number parameter for the Config option only when you are
certain that the configuration numbers you use will do not change — when you are
certain that the numbers will always represent the same configurations, in all
circumstances.
Set
The Set option allows you to specify a custom string to be passed to enum-devices.
This string can be:
There are currently two defined custom tags that enum-usb can pass to
enum-devices:
• If the Device section does not contain a Config statement, Set statements can be
specified after the Device statement.
For example:
Device vid=05AC,did=12*
Config class=01
Set usr_spec_id=AppleIPODwithDigitalAudio
Config class=08
Set usr_spec_id=AppleIPODUMASSmode
user_spec_id
The Set user_spec_id option is useful for associating multiple devices, or a range of
devices, with a single enum-devices configuration. It can be:
• used to confirm matching criteria, and thus launch the same driver for all the
associated devices
The statement for the Set user_spec_id option takes the form:
Set usr_spec_id=x
The rules for composing the Set user_spec_id option statement are:
inc_user_spec_id
The Set inc_user_spec_id option is useful for associating multiple devices, or a range
of devices, while providing a device-unique incrementing suffix appended to the user
supplied string. Because enum-devices configuration files do not support wildcards,
this option can be used only as an argument passed to the matched configuration.
The suffix appended to the user-supplied string by this option:
• When the first iPod is connected to the host system, all insertion events related to
that device include the tag inc_usr_spec_id=/fs/ipod0.
• When a second iPod is connected to the host system, all insertion events related to
that device include the tag inc_usr_spec_id=/fs/ipod1, and so on for all
further iPods connected to the system.
• If the second iPod device is removed, the 1 suffix becomes free, and will be reused
for the next iPod inserted.
• If you want the device suffix to be incremented from zero for a device entry in your
enum-usb configuration file (enum-usb.conf) instead of from a shared pool, you
must use a unique inc_ usr_spec_id for that device entry in the configuration file.
The statement for the Set inc_user_spec_id option takes the form:
Set inc_usr_spec_id=x
The rules for composing the Set inc_user_spec_id option statement are:
• The string length is limited to 1024 characters, including the appended suffix.
all
config(include)
config(overrides)
config(devices)
enumerator(usb)
Examples:
Start enum-usb, specifying the path to the configuration file and setting the interface
maximum:
# enum-usb cfg_file_path=/etc/enum-usb-custom.conf,iface_tbl_size=32
enum-usb.conf
In this sample implementation, we want enum-devices to launch a driver for an
iPod, which has several different device IDs. Instead of a using a enum-devices
configuration containing an entry for every vid and did combination, we pass up a user
specified ID which represents the set of iPod devices.
See also:
enum-devices, io-fs-media, iofs-ipod.so, iofs-pfs.so,
iofs-ser-ipod.so, iofs-usb-ipod.so
Syntax:
env [-i] [name=value]... [command [arguments]]
Deprecated:
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
-i Ignore the environment that’s otherwise inherited from the current
shell. This restricts the environment for command to that specified by
any name=value pairs.
- (Deprecated) same as -i
name=value Set the environment variable name to value and add it to the
environment.
Description:
The env utility obtains the current environment, modifies it according to its
arguments, and executes command with the modified environment. If no command is
specified, the resulting environment is displayed.
If you have removed the PATH environment variable from the environment, you must
include the path to the command.
Examples:
Start a shell with only the SHELL and PATH environment variables:
env -i /bin/cron
Exit status:
When a command is specified on the command line, the env utility attempts to exec()
into that command. If the command is successfully launched, the exit status from env
is that of the program it exec()ed into. Otherwise, env returns an exit status as follows:
>0 An error was present in the command-line parameters supplied or env was
unable to launch the command specified on the command line.
Syntax:
errno error_number...
Runs on:
Neutrino
Options:
error_number Error number to be explained.
Description:
The errno utility displays the string equivalent for the error_numbers supplied on the
command line. The output is written to the standard output. If the command-line
argument isn’t a valid error number, a line is written to the standard error instead.
This utility is useful in cases where a program has indicated that a numerical error
occurred and hasn’t provided the ASCII string equivalent of that errno value. Users
who don’t have access to the C header file <errno.h> don’t have the option of using:
Examples:
Find the string equivalent of error number 2:
$ errno 2
errno 2: ERROR ENOENT
$
Exit status:
>0 An error occurred (e.g. unknown errno value).
See also:
use
Syntax:
esh [-c command] [-irv] [script_file]
Runs on:
Neutrino
Options:
-c command Run this command.
Description:
The esh utility provides a subset of the functionality found in the standard shell,
/bin/sh. You should find esh useful for situations where memory requirements are
limited. For example, you could use it to run a simple system initialization file for an
embedded system.
Command-line format
In esh, command lines take this form:
Where:
Specifying: Will:
<file Redirect standard input from this file.
>file Redirect standard output to this file. If the file exists, it’s
overwritten; if the file doesn’t exist, it’s created.
>>file Redirect standard output to this file. If the file exists, the
information is appended to the end of the file; if the file
doesn’t exist, it’s created.
2>file Do the same as >file, but for standard error.
2>>file Do the same as >>file, but for standard error.
& If a command contains an unquoted &, then esh doesn’t
wait for the command to complete execution but
immediately moves on to process the next command.
The standard input of the command is redirected from
/dev/null, and SIGINT and SIGQUIT are ignored.
Filename expansion
You use most commands for manipulating files in one way or another. As such, esh
has a filename “shorthand” (consisting of *, ?, [, and ]) that you can use to specify
the files that a command is to operate on. This shorthand is the same used by the
standard shell. For more information, see “Filename patterns” in ksh.
Quoting
The following characters have a special meaning in esh:
To suppress the special meaning of these characters and keep their literal meaning,
you use quoting.
To quote a sequence of characters or sequence of words, enclose the sequence in
double quotes. To quote a single character, use double quotes or precede it with the
escape character (\).
Double quotes
Enclosing characters and words in double quotes ("") preserves the literal meaning of
all characters within double quotes, with the exception of the \ character. For example:
"ab cd"
ab\"cd
Builtin commands
The following commands are built into esh (that is, esh interprets and executes them
internally):
• . (dot)
• alias
• cd
• emount
• ewaitfor
• exec
• exit
• export
• kill
• reopen
• set
• unset
. (dot) command
. file
The . (dot) command reads and executes the commands from file within the current
environment. The search path contained in the environment variable PATH is used to
find the directory containing file. This command doesn’t require that file be executable.
alias command
alias [name=value]...
Without arguments, alias lists all aliases and their values. If only the name is
specified, its value is listed. Any name specified with a value defines an alias.
Alias expansion occurs when the first word of a statement is a defined alias, except
when that alias is already being expanded.
List all aliases:
alias
Remove an alias:
alias name=
cd command
cd [directory]
Change the working directory of the current execution environment. If directory isn’t
specified, the value of the HOME environment variable becomes the new working
directory.
emount command
emount special directory [fs_type]
The emount command was implemented in QNX Momentics 6.3.0 Service Pack 2.
ewaitfor command
ewaitfor path [max_seconds [delay]]
max_seconds The maximum number of seconds to wait for the file to appear. The
default is 1 second.
The ewaitfor command was implemented in QNX Momentics 6.3.0 Service Pack 2.
exec command
exec [command [argument...]]
exit command
exit [n]
Cause esh to exit with the exit status specified by n. If n isn’t specified, esh exits with
the status of the last command executed.
export command
export name[=word]...
export -p
Mark environment variables for export. This makes them be in the environment of
subsequently executed commands. If you specify the -p option, the names and values
of all exported variables are written to the standard output.
If restricted mode (-r) is set, you can’t use this command.
kill command
kill pid
reopen command
reopen [device]
Close standard input, standard output, and standard error and attach them to the
specified device. This command is often used in startup scripts. If you don’t specify a
device, /dev/con1 is used.
If restricted mode (-r) is set, you can’t use this command.
set command
set -v
Enable verbose mode; all commands are echoed to the standard output before they’re
executed.
unset command
unset variable
Unset the specified variable. If restricted mode (-r) is set, you can’t use this
command.
Examples:
Invoke a subshell:
esh
esh /etc/backup
Files:
/etc/esh ASCII text file containing shell commands, executed when esh is
started as a login shell.
Environment variables:
HOME The pathname of the user’s home directory.
PATH The directory search path used by esh for locating executable
programs and esh shell scripts. To change PATH, you must use the
export command.
If PATH isn’t in the existing environment when esh is invoked, it is
set to /bin:/usr/bin. For more information on setting PATH, see
“Setting PATH and LD_LIBRARY_PATH” in the Configuring
Your Environment chapter of the Neutrino User’s Guide.
TMPDIR The name of a directory where utilities can create temporary files.
Caveats:
The current version of esh strips out single quotes (’), which means that many
common uses of commands such as find fail.
See also:
fesh, ksh, rsh, sh, uesh
Using the Command Line and Writing Shell Scripts in the Neutrino User’s Guide
Syntax:
etfsctl [options]
Runs on:
Neutrino
Targets:
ARM, MIPS, PowerPC, SH4, x86, and XScale processors
Options:
-c Make the filesystem on the device continue or resume operations.
-e Erase the device. For NAND flash, factory-marked bad blocks aren’t
erased. Blocks that become bad during normal use (worn-out blocks)
are also skipped during the erasing.
If you wish, you can use the -l and -o options to specify the length and
offset for the erasure. If used, these options must preceed the -e option.
-f Erase as in -e, then format an empty filesystem. Don’t use this option
with -w, since -w assumes an erased partition with no filesystem.
-l len The length for the subsequent -e, -R, or -r option. The len is in bytes,
but you can add a suffix of K, M, or G.
-o offset The starting offset for the subsequent -e, -R, -r, -W, or -w option. The
offset is in bytes, but you can add a suffix of K, M, or G.
-r file Read all data from the device and save it in the specified file. The data
is saved as a series of transactions. This data can be written to another
flash part as long as that part has the same:
• cluster size
• block size (number of clusters in a block)
The data format is endian-neutral and free of any device-specific
characteristics such as how it stores CRCs or ECCs. You can now read
and write filesystems across different classes of devices, for example
for NAND and RAM.
If you wish, you can use the -l and -o options to specify the length
and offset for which to read. If used, these options must preceed the -r
or -R option. If you specify the -l option, etfsctl doesn’t read past
this length.
-R file Read all data from the device, including blank or erased blocks, and
save it in the specified file. This is the raw version of -r option.
-S Similar to -s, but wait for the filesystem to stop before returning.
-w file Write transactions from the specified file to the device. This transaction
file can be created by reading it from this or another device via the -r
option of etfsctl or by the mketfs utility. The transactions are
block-location-independent on the device. This allows bulk
programming of devices with bad blocks in any location. The only
requirement is that enough good blocks should be available to hold all
transactions.
If you wish, you can use the -o option to specify the offset at which to
write. If used, this option must preceed the -w or -W option.
-W file Write transactions from the specified file to the device. Also, copy any
blank or erased blocks. This is a raw version of the -w option.
Description:
The etfsctl utility is used to manage an embedded transaction filesystem (ETFS).
The utility interacts with the running filesystem using devctl() messages. Using
etfsctl, you can erase and format a partition, read or write an entire transaction log
(and thus its entire filesystem) from or to the device, stop the filesystem, make it
continue or get statistical information.
Options are processed from left to right in order. The first option must be a -d device
where:
/dev/etfs1 The raw partition for user extensions (such as boot images).
The raw partition is used for user extensions, such as boot images, and is always at the
start of the device. It may be zero bytes long if you don’t need it. The filesystem
partition consists of a series of transactions that together form a filesystem. You can
use the -r option to read the transactions from the device and save them to a regular
file, typically on another filesystem. You can then use the -w option to write this
transaction log to another ETFS filesystem.
CAUTION: When writing, you must erase the filesystem first; failure to do so
! corrupts the data on the device.
The -w option is most often used to write transaction logs created by the mketfs
utility.
You can request the filesystem to stop accepting new open requests by using the -s or
-S option. Once the last file currently open by any application is closed, the filesystem
enters the stopped state. A filesystem partition must be stopped in order for you to
write a transaction log to it. You can start the filesystem again using the -c option.
The -i option provides useful statistical information about a running filesystem. This
option is so common that it assumes /dev/etfs2, thus saving you from having to
enter the -d option before it. The information is displayed in following groups:
• Device
• Pools
• Counts
• Errors
Device
Name Name of the device. The name usually encodes a part number or
size.
Blocks Number of blocks on the device.
Clusters/Block Number of clusters to a block on the device.
Clustersize Size of a cluster. Typically 1 KB or 2 KB.
Totalsize Total size of the device, in bytes.
Pools
Clean Number of erased blocks immediately ready for writing.
Spare Number of spare blocks.
Filthy Number of free blocks that are waiting to be erased and made clean.
Inactive Number of clusters not being used but trapped.
Xpool Number of cache buffers.
Cache Number of cluster cache buffers.
Counts
Erase Number of erases on the part (while running).
Copy Number of block-copy operations. Copies occur two ways: the first way
is a read in a block that has a soft ECC error, which is an indication that
the block is getting weak. The block is copied to a new fresh block and
the block with the ECC error is erased. In the second way, a block with a
low erase count is forced into service by copying its data to a new block
and erasing and putting this block into service.
Errors
Ecc Number of CRC data errors that are corrected by ECC.
Device Number of hard device errors. This is bad and usually indicates a
hardware problem.
The error statistics currently aren’t collected, so these values are always 0.
Examples:
Print information about a filesystem. If you omit the -d option, etfsctl assumes
/dev/etfs2.
etfsctl -i
etfsctl -d /dev/etfs2 -i
etfsctl -d /dev/etfs2 -S -f -c
Save the entire filesystem. Erase the part, and restore the filesystem:
Erase part of a raw ETFS partition, without erasing the boot monitor:
etfsctl -d /dev/etfs1 -o 3M -l 6M -e
See also:
fs-etfs-ram, mkefs, mketfs, mkifs
“Embedded transaction filesystem (ETFS)” in the Filesystems chapter of the System
Architecture guide
“Filesystem limits” in the Understanding System Limits chapter of the QNX Neutrino
User’s Guide
Syntax:
expand [-t tablist] [file...]
Runs on:
Neutrino
Options:
-t tablist Set up tab stops according to the tablist argument. This argument
consists either of a single positive decimal integer, or of multiple
positive decimal integers, in ascending order, separated by single
commas.
If no number is given, tabs stops are set eight columns apart. If a single
number is given, tab stops are set tablist columns apart. If multiple
numbers are given, tab stops are set at those columns.
file The pathname of a file whose tabs are to be converted.
Description:
The expand utility copies files or the standard input to the standard output with tab
characters replaced by the number of spaces needed to pad to the next tab stop. Any
backspace characters encountered in the input are copied to the output and cause the
column position count for the tab-stop calculations to be decremented; the count is
never decremented below zero.
The -t option lets you specify how many columns tab stops are set apart. You can also
use it to specify a multiple tab-stop list that determines where tab stops are placed. If
tab characters are present in the input past the last tab stop specified in a multiple
tab-stop list, those tabs are each replaced by a single space in the output.
Note that tabbing to position N causes the next character written to appear in the next
column position on that line (i.e. column N+1)
Examples:
For the file myfile, expand each tab to the number of spaces required to reach the
next tab stop:
expand myfile
Do the same as above, except set tab stops to every four columns rather than the
default eight:
expand -t4 myfile
Place tab stops at the specified columns. Any tab encountered past the last tab stop is
replaced by a single space:
expand -t8,12,20,24,32,36,44,48 myfile
Exit status:
0 Successful completion.
Caveats:
The expand utility doesn’t check to verify that the tab stops specified in the -t option
are in ascending order, as is required for proper operation.
See also:
unexpand
Name:
/etc/exports
/etc/exports.hostname
Description:
The exports file defines remote mountpoints for the NFS mount protocol according
to the NFS server specification; see RFC 1094 (Network File System Protocol
Specification) and RFC 1813 (NFS Version 3 Protocol Specification).
There isn’t a default version of this file; you can create your own if you need it.
Each line in the file specifies one remote mountpoint. The first field contains the
mount-point directory path, followed optionally by a list of options and/or a list of
specific hosts separated by whitespace. If no specific hosts are specified, the mount
point is exported to all hosts.
Here are the export options:
-mask=netmask -match=network
Restrict access to hosts belonging to subnet defined by netmask and
network. By default, there’s no restriction. Access is determined by:
-root=uid Map root’s uid (real user ID). By default, root is mapped to -2.
Limitations:
1 subnet per mountpoint
10 hosts per mountpoint
See also:
nfsd, showmount
Based on:
Syntax:
expr operand...
Runs on:
Neutrino
Options:
operand Operand expression to evaluate.
Description:
The expr utility evaluates a single expression and writes the result to the standard
output. The expression is formed from integer and string symbols in combination with
the following operators:
In the following table, expressions are listed in order of decreasing precedence, with
equal-precedence operators grouped together. All of the operators are left-associative.
Note that a string operand is an argument that can’t be identified as an integer
argument or as one of the above operators.
Expression Description
integer An argument consisting only of an (optional) unary minus
followed by digits
string A string argument
( expr ) Grouping symbols; you can place any expression inside the
parentheses.
expr1 : expr2 Matching expression
expr1 * expr2 Integer multiplication
expr1 / expr2 Integer division, producing an integer result
expr1 % expr2 Remainder of integer division
expr1 + expr2 Integer addition
expr1 - expr2 Integer subtraction
expr1 = expr2 Equal*
expr1 > expr2 Greater than*
continued. . .
Expression Description
expr1 >= expr2 Greater than or equal*
expr1 < expr2 Less than*
expr1 <= expr2 Less than or equal*
expr1 != expr2 Not equal*
expr1 & expr2 Returns the evaluation of expr1 if neither expression evaluates to
null or zero; otherwise, returns zero
expr1 | expr2 Returns the evaluation of expr1 if it’s neither null nor zero;
otherwise returns the evaluation of expr2
* Returns the result of a decimal integer comparison if both arguments are integers;
otherwise, returns the result of a string comparison. The result of each comparison is 1
if the specified relation is TRUE or 0 if FALSE.
The “:” matching operator compares the string resulting from the evaluation of expr1
with the regular expression pattern resulting from the evaluation of expr2. Usually,
this operator returns the string representing the number of characters matched (“0” on
failure). However, if the pattern contains at least one regular expression subexpression
\(...\), the string corresponding to \1 is returned (see grep).
Examples:
Add 1 + 1 :
expr 1 + 1
Logical 1 or 0 :
expr 1 \| 0
Logical 1 and 0 :
expr 1 \& 0
Add 1 to $a :
expr $(expr $a + 1)
Compare $a to a possible =
expr x$a = x=
Exit status:
0 The expression evaluates to neither null nor zero.
1 The expression evaluates to null or zero.
Caveats:
The syntax for expr requires special attention. Many of the operators are also shell
control operators or reserved words, so they have to be escaped on the command line.
In addition, each part of the expression is composed of separate arguments, so you
should use blanks liberally. For example:
In many cases, the arithmetic and string features provided as part of the shell
command language are easier to use than their equivalents in expr. However, you
may need expr to run older UNIX shell scripts.
When you want to specify the filesystem root, avoid the / character as a standalone
argument — expr interprets it as the division operator. Use // instead.
See also:
grep
Syntax:
false
Runs on:
QNX Neutrino, Microsoft Windows
Options:
None.
Description:
The false utility does nothing but exit immediately with a nonzero exit code.
The shell has a builtin false command; see ksh. To make sure you use the
executable, specify the full path.
Exit status:
>0
See also:
ksh, true
Syntax:
fcat [filename...]
Runs on:
Neutrino
Options:
See freeze for a full listing.
Description:
The fcat command is equivalent to freeze -cd. See the freeze utility for details.
The freeze, melt, and fcat compression utilities will eventually become
deprecated in favor of the GNU zip suite, which consists of gzip, gunzip, and
zcat. The freeze suite of utilities will continue to be provided for quite some time
before being eliminated completely.
Contributing author:
Leonid A. Broukhis
See also:
freeze, melt
Syntax:
fdformat [-aiIpqv] [-h heads] [-t tracks] [-n sectors]
[-s size] [-k skew_factor] [-z interlv] drive
Runs on:
Neutrino
Options:
-a Abort on the first error encountered.
-s size The disk media: 360K, 720K, 1.2M, 1.4M, or 2.8M (overrides -h,
-t, and -n).
Description:
The fdformat utility formats the specified disk. Formatting refers to a process of
placing addressing marks and other control information on the disk to allow the
hardware to read it. Formatting doesn’t imply any sort of filesystem structure.
By default, fdformat uses the current mount characteristics of the drive as the drive
parameters. These parameters may be overridden by specific command-line options,
such as -t tracks.
The -s size option lets you specify the size of standard floppy disks, as in the
following:
The first sector of QNX Neutrino floppy disks contains some information about the
layout of the diskette (heads, tracks, sectors). The -i option simply writes this layout
information to a diskette without formatting it.
The -z interlv option lets you specify the amount of interleave (spacing between
sectors). Specifying -z1 (the default) would place the sectors contiguously (e.g.
1,2,3,4,5, etc.)
Specifying -z2 would place the sectors at every second location (e.g. 1, -, 2, -, 3, -, 4,
-, 5, etc.). If there were nine sectors per track, -z2 would yield:
1, 6, 2, 7, 3, 8, 4, 9, 5
such that reading every other sector in the (circular) track would produce a contiguous
reading of the sectors. Note that the hardware makes all of this transparent; specifying
-z may optimize access for the hardware.
The -k skew_factor option affects performance when reading and writing consecutive
tracks on the disk in an ascending order. Disk drives have an inherent latency when
moving the head from one track to the next. By setting the first sector of the next track
some distance ahead of the last sector of the current track, it is possible to tune the
amount of time it takes before the head encounters the first sector of the next track
after the seek. When there is no skew, the rotation of the disk places the head past the
first sector of the next track after the time taken to seek to the next track, meaning that
to get to the first sector the disk must complete nearly a full rotation.
If the latency is, for example, five sectors, you would specify the following:
-k 5
Placing the first sector of the next track five sectors away from the current sector
minimizes the latency effects.
Examples:
Format the diskette mounted as /dev/fd0 using the current mount parameters:
fdformat /dev/fd0
Format a 1.4M diskette mounted as /dev/fd0:
Files:
If the -p is specified, fdformat pauses until gets a newline character from the
standard input before proceeding to format the specified disk. The standard input is
otherwise unused.
If not in quiet mode (i.e. -q isn’t specified), informational and progress messages are
written to the standard output as the formatting proceeds. The extent of this
information is influenced by the -v option. If -q is specified, this information isn’t
written. Note that -q doesn’t override the printing of the prompt for the -p (pause)
option.
Any errors which occur cause a diagnostic message to be written to the standard error.
In addition, if the -v option is specified, information relating to some of the specific
formatting steps may be written to the standard error.
The fdformat utility acts upon the block special file named on the command line. If
successful, fdformat destroys the contents of the medium represented by this file.
Exit status:
0 The disk was formatted successfully.
>0 An error occurred and a diagnostic message was written to the standard error.
Caveats:
The fdformat utility destroys any existing data on a diskette. Don’t count on this
behavior for data security — differences in physical drive characteristics and presence
of magnetic fields in fringe areas may result in the data being recoverable by use of
special instruments. If you want to destroy data, the only really safe way is to
completely destroy the media.
Note that the latency saved by tuning the disk skew factor is only realized when
reading sequentially across a track boundary. On random requests, there is no single
mechanism to minimize access time.
See also:
dcheck, devb-fdc, dinit
In order to run this utility, you must be logged in as root or have read/write
permissions for the block-special file concerned.
Syntax:
fdisk [-fpz] [-B loader] drive [cmd [args]]
Runs on:
Neutrino
Options:
-B loader Use the 512-byte file named by loader as the primary bootstrap
loader for the device when instructed to write a boot loader to the
disk. The default is to install a loader that’s built into the fdisk
utility.
drive The disk drive to partition. This must name a block-special file (e.g.
/dev/fd1, /dev/hd0).
Description:
The fdisk utility lets you create and manage partitions on a hard disk (typically a
rotating medium, but fdisk works on other devices, such as compact flash and USB
flash, if they support PC-style Master Boot Records (MBRs) and partitions). The
partition information, which is kept in the disk’s first physical block, matches that used
by DOS.
On some platforms, fdisk supports a full-screen interface; see “Interactive mode,”
below.
CAUTION:
! • The installer for Microsoft Windows overwrites any existing Master Boot Record
with its own. If you want your disk to contain bootable DOS and bootable QNX (or
other non-DOS) partitions, you should install Windows first, and then create the
other partitions. If you create a QNX partition first and then install Windows, you
can restore the boot loader by running QNX Neutrino from the installation disk and
explicitly using dloader.
• On some x86 machines, you can boot only from OS images that are loaded from
within the first 1024 cylinders of the disk. This means that while you may be able
to initially install and boot from a partition which extends past the 1024th cylinder,
it will someday fail when you go to update the boot image because the location of
some of its blocks may change. When this happens you will have a system that’s no
longer bootable.
Avoid this problem by creating a separate partition to boot from that lies entirely
within the first 1024 cylinders of the hard drive, and use a second partition to access
the additional space on the drive. (The boot partition may be quite small — just a
few megabytes will suffice.)
Before creating a QNX 4 partition for the first time, you must first start the hard disk
driver:
devb-eide &
You should then execute the fdisk command to partition your disk:
The QNX 4 filesystem doesn’t automatically relearn any changes that you make to the
partition table with fdisk. You must either slay and restart the filesystem/driver
(devb-*), use mount -e /dev/hd0 to recognize the new partitions and update the
contents of /dev, or reboot.
Partition types
The fdisk utility recognizes the following partition types. If you add a partition, use
the command shown to initialize it.
continued. . .
a Read-only.
b Not usually necessary.
For more information, see the Filesystems chapter of the System Architecture guide.
Commands
The fdisk utility supports the following commands directly from the command line:
add [args] Add a new partition entry of the size and type specified. If fdisk
can’t locate sufficient unallocated disk space to satisfy your
request, it allocates the largest available portion of the disk (if
any). Here are the arguments for add:
boot [args] Turn on the boot flag for the indicated partition. If another
partition was already flagged as the primary boot partition, the
flag is turned off for it. Here are the arguments for boot:
delete [args] Delete the specified partitions. Here are the arguments for
delete:
query [args] Print the number of cylinders to standard output. Here are the
arguments for query:
Interactive mode
On some platforms, fdisk is a fullscreen, interactive program that’s fairly
self-explanatory. When you invoke fdisk, you’ll see a screen similar to this one
(assuming your disk is already partitioned):
FDISK
Ignore Next Prev 1 2 3 4 Change Delete Boot Unboot Restore Loader Save Quit
You’ll see the available commands displayed at the top of the screen. To select a
command, either type its first letter or move the cursor to the command (with the
arrow keys) and press Enter.
The commands are:
Command: Action:
Next Move the pointer to the next entry.
Prev Move the pointer to the previous entry.
1, 2, 3, or 4 Move the pointer to the indicated entry.
Change Change the selected partition (see below).
Delete Delete the selected partition.
Boot Turn on the boot flag for the selected partition. If another partition
was already flagged as the primary boot partition, the flag is turned
off for it.
Unboot Turn off the boot flag for the selected partition.
Restore Restore the previous non-QNX bootstrap loader.
Loader Change the bootstrap loader to the QNX loader.
Save Save all changes and quit. This writes to the device and is
irrevocable.
Quit Quit without saving changes.
• Save the details about the partition (e.g. by writing them on a piece of paper),
because fdisk blanks the fields as you edit them.
• You have to enter the partition’s type number and the start and end cylinders;
fdisk calculates the other information for you. Press Enter after typing each value.
• If the partition was bootable before you changed it, use the Boot command to
make it bootable again.
Examples:
Create a QNX 4 partition that occupies half the disk, or the largest available space if
there isn’t a space big enough for a new partition that occupies half the disk:
Continuing from either of the above examples, reread the partition table, set up a
QNX 4 filesystem on the new partition, and then mount it:
mount -e /dev/hd0
dinit -h /dev/hd0t77
mount -t qnx4 /dev/hd0t77 /mnt/q4fs
Create a bootable partition for a Power-Safe filesystem, reread the partition table,
format the new partition, and then mount it:
Exit status:
0 Success.
Caveats:
After changing any partition information, you must either slay and restart the
filesystem/driver (devb-*) or use mount -e to make the filesystem reread the
partition table.
See also:
chkdosfs, chkfsys, chkqnx6fs, devb-*, df, dinit, dloader, fs-dos.so,
fs-ext2.so, fs-mac.so, fs-nt.so, fs-qnx4.so, fs-qnx6.so, mkdosfs,
mkqnx6fs, mount
Filesystems chapter of the System Architecture guide
Working with Filesystems and Backing Up and Recovering Data chapters of the QNX
Neutrino User’s Guide
Syntax:
fesh [-c command] [-irv] [script_file]
Runs on:
Neutrino
Options:
-c command Run this command.
Description:
The fesh utility is a “fat” version of the small embedded shell, esh. The fesh shell
supports all of the esh builtin commands, as well as the following extra builtin
commands:
• ecp
• edf
• eecho
• els
• emkdir
• epwd
• erm
• ermdir
ecp command
ecp [-v] source destination
Copy source to destination, like the cp command. The -v option gives verbose output.
edf command
edf [path]
Report the free disk space for the filesystem associated with path. If you don’t specify
a path, fesh uses the current directory.
eecho command
eecho arguments
els command
els [-l] [path]
List the contents of a directory, like ls. The els command supports only the -l
option, and displays the permissions in octal.
emkdir command
emkdir dir
epwd command
epwd
Print the name of the current working directory, like the pwd executable.
erm command
erm file...
ermdir command
ermdir dir...
See also:
esh, ksh, rsh, sh, uesh
Using the Command Line and Writing Shell Scripts in the Neutrino User’s Guide
Syntax:
fgrep [-cilnqsvx]
[-e expression | -f expression_file]...
[file...]
fgrep [-cilnqsvx] expression [file...]
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
See grep for a complete listing.
Description:
The fgrep utility does a fixed-string grep (equivalent to grep -F). See the
documentation for grep for details.
Exit status:
0 Lines were found matching the expression provided.
See also:
diff, find, grep, sort
Syntax:
file [-bcLnvz] [-f namefile] [-m magicfile] file ...
Runs on:
Neutrino
Options:
-b Don’t echo the name of the file before its type.
-c Cause a checking printout of the parsed form of the magic file. This
is usually used in conjunction with -m to debug a new magic file
before installing it.
-f namefile Read the names of the files to be examined from namefile (one per
line) before the argument list. Either namefile or at least one filename
argument must be present; to test the standard input, use - as a
filename argument.
-n Echo the name of the file before its type (this is done by default).
Description:
The file utility tests each file argument in an attempt to classify it. There are three
sets of tests, performed in this order:
1 Filesystem tests
3 Language tests
The first test that succeeds causes the file type to be printed. The type printed usually
contains one of these words:
text The file contains only ASCII characters and is probably safe to read
on an ASCII terminal.
The filesystem tests are based on examining the return from a stat() system call. The
program checks to see if the file is empty, or if it’s some sort of special file. Any
known file types appropriate to the system you’re running on (sockets, symbolic links,
or named pipes (FIFOs) on those systems that implement them) are intuited if they’re
defined in the system header file /usr/include/sys/stat.h.
The magic number tests are used to check for files with data in particular fixed
formats. These files have a “magic number” stored in a particular place near the
beginning of the file that tells the UNIX operating system that the file is a binary
executable, and which of several types thereof. The concept of “magic number” has
been applied by extension to data files. Any file with some invariant identifier at a
small fixed offset into the file can usually be described in this way. The information in
these files is read from the magic file /usr/share/misc/magic.
If an argument appears to be an ASCII file, file attempts to guess its language. The
language tests look for particular strings that can appear anywhere in the first few
blocks of a file. For example, the keyword .br indicates that the file is most likely a
troff input file, just as the keyword struct indicates a C program. These tests are
less reliable than the previous two groups, so they are performed last. The language
test routines also test for some miscellany (such as tar archives) and determine
whether an unknown file should be labeled as ascii text or data.
Files:
/usr/share/misc/magic
Default list of magic numbers.
Contributing author:
Written by Ian F. Darwin, UUCP address {utzoo|ihnp4}!darwin!ian, Internet
address ian@sq.com, postal address: P.O. Box 603, Station F, Toronto, Ontario,
CANADA M4Y 2L8.
Altered by Rob McMahon, cudcv@warwick.ac.uk, 1989, to extend the & operator
from simple x&y != 0 to x&y op z.
Altered by Guy Harris, guy@auspex.com, 1993, to:
• Put the “old-style” & operator back the way it was, because 1) Rob McMahon’s
change broke the previous style of usage, 2) the SunOS “new-style” & operator,
which this version of file supports, also handles x&y op z, and 3) Rob’s change
wasn’t documented in any case;
License:
Copyright © Ian F. Darwin, Toronto, Canada, 1986, 1987, 1988, 1989, 1990, 1991,
1992, 1993.
This software is not subject to and may not be made subject to any license of the
American Telephone and Telegraph Company, Sun Microsystems Inc., Digital
Equipment Inc., Lotus Development Inc., the Regents of the University of California,
The X Consortium or MIT, or The Free Software Foundation.
This software is not subject to any export provision of the United States Department of
Commerce, and may be exported to any country or planet.
Permission is granted to anyone to use this software for any purpose on any computer
system, and to alter it and redistribute it freely, subject to the following restrictions:
1 The author is not responsible for the consequences of use of this software, no
matter how awful, even if they arise from flaws in it.
2 The origin of this software must not be misrepresented, either by explicit claim
or by omission. Since few users ever read sources, credits must appear in the
documentation.
A few support files (getopt(), strtok()) distributed with this package are by Henry
Spencer and are subject to the same terms as above. A few simple support files
(strtol(), strchr()) distributed with this package are in the public domain; they are so
marked.
The files tar.h and is_tar.c were written by John Gilmore from his public-domain
tar program, and are not covered by the above restrictions.
Source:
You can obtain the original author’s latest version by anonymous FTP on
tesla.ee.cornell.edu in the directory /pub/file-X.YY.tar.gz.
Caveats:
The file utility uses several algorithms that favor speed over accuracy, thus it can be
misled about the contents of ASCII files. The support for ASCII files (primarily for
programming languages) is simplistic, inefficient and requires recompilation to update.
See also:
/usr/share/misc/magic
Syntax:
find path... [operand_expression]
find [limited_operand_expression]
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
path... Pathnames under which find should search for files. The utility traverses
the pathname tree from these files down, looking for files that match the
search criteria specified by the operand_expression. If no paths are
specified, and the expression meets the criteria of a
limited_operand_expression (below), then a path of . is assumed.
operand_expression
An expression composed of any set of the primary expressions and
operators described below.
limited_operand_expression
An expression composed of any of the primary expressions and operators
described below, except for -exec, -ok, and -spawn.
Description:
The find utility recursively descends the directory hierarchy for each file specified by
path and seeks files that match operand_expression.
If you don’t specify an operand_expression or limited_operand_expression on the
command line, find uses -print (i.e. the utility matches every file and directory,
printing each pathname on its own line to standard output).
The operand expression follows one or more pathnames. The find utility treats as a
pathname all the arguments up to the first one starting with any of these characters:
- ! (
Everything after that is part of the operand expression.
You’ll probably have to quote some operands and patterns, depending on the shell that
you’re using.
Operand expressions are made up of primaries and operators. The following operators
are supported:
Operator Action
! (NOT)
-a (AND)
-o (OR)
AND operations have higher precedence than OR operators. Negation (!) has a higher
precedence than AND operators. Parentheses are supported to override the normal
precedence rules.
The rules that apply to primaries and operators are:
Expression Evaluates to
-primary True if primary is true.
( expression ) True if expression is true.
! expression (NOT) Negation of a primary or expression enclosed in
parentheses.
expression [-a] expression (AND) True if both expressions are true. If the first
expression is false, the second expression isn’t
evaluated. The -a is optional. AND is implied by the
juxtaposition of two expressions (see below).
expression -o expression (OR) True if either expression is true. If the first
expression is true, the second expression isn’t
evaluated.
As mentioned above, the -a operand is optional. If you want to match files of two
different patterns, you might be inclined to use this command:
but this doesn’t work the way you might expect it to because of the implicit -a before
the -print expression. The rules of precedence make the above command equivalent
to this:
Primary expressions
Note that if you don’t supply an expression, find behaves as if you specified -print.
If you specify an expression, but it doesn’t contain a -chmod, -chown, -exec, -fls,
-fprint, -fprint0, -fprintf, -ls, -ok, -print, -print0, -printf,
-rename, -remove!, or -spawn primary, the find utility operates as if you specified
the following expression:
( given_expression ) -print
Whenever a primary expression uses a number (n), you can optionally precede it by a
plus (+) or minus (-) sign, which changes the meaning as follows:
Expression Means
+n More than n
-n Less than n
n Exactly n
We’ve classified the primary expressions as follows, in case you’re interested in using
find in a portable manner:
-amin n (GNU) True if the file was last accessed n minutes ago.
-anewer file (GNU) True if the file being evaluated was accessed more
recently than file.
-atime n (POSIX) True if the file access time subtracted from the time
that the find utility started running is between n-1 and n
multiples of 24 hours. For example, find . -atime 1 finds
all files under the current directory for which the file was
accessed within the last 24 hours.
-chgrp gname (QNX Neutrino) Change the file group ownership of the file
currently being evaluated to gname. If gname is numeric and
-chmod mode (QNX Neutrino) Change the permissions of the file currently
being evaluated according to the specified mode.
The mode argument represents file mode bits. It’s identical to
the symbolic_mode operand described in chmod and is
interpreted as follows.
A file mode has the form:
who{op}perm[,mode...]
where
• who may be
You can combine these. For example, if you specify ug, the
subsequent op and perm arguments are applied to the user
and group permissions on the file.
• op may be:
op Action
+ Sets the appropriate mode bits
- Clears the appropriate mode bits
= Sets the appropriate mode bits, regardless of the process’s
file mode creation mask
perm Meaning
r Read permission
w Write permission (create/unlink for directories)
continued. . .
perm Meaning
x Execute permissions (search for directories)
s Setuid for owner or setgid for group, sticky for
directories
-chown uname[:gname]
(QNX Neutrino) Change the file ownership of the file currently
being evaluated to the one specified, taking a ownership
specification similar to that accepted by the chown utility. A
user name uname must be specified, optionally followed by a
colon (:) and group name gname. The uname and gname
parameters may be either an ASCII name or the actual numeric
user or group ID.
Specifying -chown inhibits the automatic -print when the
expression as a whole evaluates to true.
-cmin n (GNU) True if the file status was last changed n minutes ago.
-cnewer file (GNU) True if the file being evaluated had its status changed
more recently than that of file.
-ctime n (POSIX) True if the file change of status time subtracted from
the time that the find utility started running is between n-1 and
n multiples of 24 hours.
-daystart (GNU) Always true. When used, this primitive causes find to
globally alter the behavior of the -atime, -ctime, and
-mtime primitives: instead of comparing file times to n
24-hour periods before the current time, it compares file times
to n 24-hour periods before the beginning of the current
calendar day.
-echo [text] ; (QNX Neutrino) Write the supplied text to standard output. If
the text contains any braces ({}), they’re interpreted as in the
-exec primitive to represent the pathname being evaluated.
Specifying -echo inhibits the automatic -print when the
expression as a whole evaluates to true.
-errmsg [text] ; (QNX Neutrino) Similar to -echo, except the output is written
to standard error.
Specifying -errmsg inhibits the automatic -print when the
expression as a whole evaluates to true.
-error (QNX Neutrino) Cause the exit status to be nonzero when the
find is completed. This primary always evaluates to false and is
typically used with -exec. For example, if you enter:
find /bin -type f \( -exec cmp {} /hd{} \; \
-o -error \)
{[strip][,skip]}
-exists filestring (QNX Neutrino) True if the file represented by filestring exists.
The filestring may be a simple filename or it may contain braces
({}) to represent the name of the file currently being evaluated,
in the same manner as used with the -exec primitive.
-fanewer filestring (QNX Neutrino) True if the file was accessed more recently
than the file represented by filestring.
-fcnewer filestring (QNX Neutrino) True if the file had its status changed more
recently than the file represented by filestring.
-fls file (GNU) Always true. Similar to -ls, but output is written to file
instead of the standard output.
Specifying -fls inhibits the automatic -print when the
expression as a whole evaluates to true.
-fmnewer filestring (QNX Neutrino) True if the file was modified more recently
than the file represented by filestring.
-Fnewer file (QNX Neutrino) True if the file being evaluated was created
more recently than file.
-fprint file (GNU) Similar to -print, but output is written to file instead
of to the standard output.
Specifying -fprint inhibits the automatic -print when the
expression as a whole evaluates to true.
-fprint0 file (GNU) Similar to -print, but each file name is followed by a
NUL instead of a newline character, and the output is written to
file instead of to the standard output.
Specifying -fprint0 inhibits the automatic -print when the
expression as a whole evaluates to true.
-group gname (POSIX) True if the file belongs to the group gname. If gname
is numeric and the name doesn’t exist in the group database,
gname is taken as a group ID. Note that gname is evaluated
only once.
-inode file|n (QNX Neutrino) True if the file uses the same inode (has the
same serial number) as the named file. If the file doesn’t exist
and is numeric, the number is used as the serial number to
match. This primary is used to find links to a file.
-ipath fpattern (GNU) Like -path, but case-insensitive when evaluating the
pattern match.
-iregex ere (GNU) Like -regex, but case-insensitive when evaluating the
regular expression match.
-level n (QNX Neutrino) True when the level down in a directory tree is
n. A file or directory specified on the command line is
considered level 0. For example, this command:
-lname fpattern (GNU) True if -follow or -logical isn’t specified, and the
file being evaluated is a symbolic link whose target is a
pathname that matches the pattern fpattern.
-maxdepth n (GNU) Always true. When this flag is set, find descends at
most n levels in the directory hierarchy. Files that are named on
the command line are level 0. Note: the + and - modifiers have
no meaning when used in conjunction with n in this primary.
-mindepth n (GNU) Always true. When this flag is set, find doesn’t apply
the expression to files unless the files are at least n levels down
in the directory hierarchy. Files named on the command line are
level 0. Note: the + and - modifiers have no meaning when
used in conjunction with n in this primary.
-mmin n (GNU) True if the file data was last modified n minutes ago.
-mnewer file (QNX Neutrino) True if the file being evaluated was modified
more recently than file was.
-mtime n (POSIX) True if the file modification time subtracted from the
time that the find utility started running is between n-1 and n
multiples of 24 hours.
-name pattern (POSIX) True if the basename of the filename being examined
matches pattern. This follows the same pattern-matching rules
as used by fnmatch() (see the Neutrino Library Reference).
-newer file (POSIX) True if the current file has been modified more
recently than file has. Note that file is evaluated only once.
-nogroup (POSIX) True if the file belongs to a group ID that isn’t in the
group database.
-NOP (QNX Neutrino) Always true, does nothing. This primitive has
the side effect of disabling the implicit -print that occurs
when the expression as a whole evaluates to true. You can use
this primitive to benchmark the time it takes to do a walk of the
filesystem. For example:
find / -NOP
-nouser (POSIX) True if the file belongs to a userid that isn’t in the
password database.
-ok utility_name [argument...] ;
(POSIX) Similar to -exec, except that find requests
affirmation of the execution of utility_name using the current
file as an argument by writing to standard error. If the response
on standard input is affirmative, the utility is executed. If the
response isn’t affirmative, the command isn’t executed and the
value of the -ok operand is false.
Specifying -ok inhibits the automatic -print when the
expression as a whole evaluates to true.
-path fpattern (GNU) True for any file whose path (as would be printed by
-print) matches fpattern.
-perm [-]mode (POSIX) The mode argument represents file mode bits. It’s
identical to the symbolic_mode operand described in chmod
and is interpreted as follows. To start, a template is assumed
with all file mode bits cleared. An op symbol of:
Operator Action
+ Sets the appropriate mode bits
- Clears the appropriate mode bits
= Sets the appropriate mode bits, regardless of the
process’s file mode creation mask
-perm [-] onum (POSIX) If the optional hyphen is omitted, the primary is true
when the file permission bits exactly match the value of the
octal number onum and only the bits corresponding to the octal
mask 777 are compared.
If the hyphen is included, more flag bits, corresponding to the
octal mask 06777, are compared and the primary is true if at
least all the bits in onum are set.
-print0 (GNU) Always true. Writes the path currently being evaluated
followed by an ASCII NUL character to the standard output.
Specifying -print0 inhibits the automatic -print when the
expression as a whole evaluates to true.
-printf format (GNU) Always true. Write data pertaining to the file currently
being evaluated to the standard output, according to the format
specified. For more information, see “Formatted printing,”
below.
Specifying -printf inhibits the automatic -print when the
expression as a whole evaluates to true.
-prune (POSIX) Stops find’s descent from that point in the file
hierarchy.
-regex ere (GNU) True when the pathname of the file currently being
evaluated matches the extended regular expression specified by
ere. See the grep documentation for details on regular
expressions.
-remove! (QNX Neutrino) Removes the file being evaluated. If the file is
a directory, rmdir() is performed, otherwise an attempt is made
to unlink() the file.
If a directory isn’t empty, the attempt to remove it fails. Thus,
to recursively remove a directory tree with find, the -depth
primitive must be used in conjunction with -remove!. (Note
the simple removal of a directory tree is better and more
portably done by using the rm utility.)
This primitive evaluates to TRUE if the removal was
successful. Note that the exclamation mark (!) is a required
part of this primitive.
Specifying -remove! inhibits the automatic -print when the
expression as a whole evaluates to true.
-rename filestring (QNX Neutrino) Renames the file to the pathname indicated by
filestring. As with other filestring arguments, braces ({})
encountered in the string are expanded to the name of the file
currently being evaluated. A file may be renamed anywhere
within the same filesystem. If the new path lies on another
device, the rename fails. Evaluates to true if the rename
succeeds, false if it fails.
Specifying -rename inhibits the automatic -print when the
expression as a whole evaluates to true.
-size n[c] (POSIX) True if the file size in bytes, divided by 512 and
rounded up to the next integer, is n. If n is followed by c, the
size is in bytes.
-spawn cmd [arguments]... ;
(QNX Neutrino) Similar to -exec, except that the command is
invoked directly (i.e. not through a shell). The -spawn primary
is faster but less flexible than -exec.
Specifying -spawn inhibits the automatic -print when the
expression as a whole evaluates to true.
Filetype Description
b Block special file
c Character special file
d Directory
p FIFO
f Regular file
l Symbolic link
n Named special file
-used n (GNU) True if file was last accessed n days after its status was
last changed.
-user uname (POSIX) True if the file belongs to the user uname. If uname is
numeric and the name doesn’t exist in the password database,
uname is taken as a user ID. Note that uname is evaluated only
once.
\a Alarm bell.
\b Backspace character.
\f Form-feed character.
\n Newline character.
Format Codes
%P The name of the file with the root of the file tree (pathname specified on
the command line) removed from the beginning.
%H The name of the root of the file tree (pathname specified on the command
line under which the current file was found).
%d The depth of the file in the directory tree. The files specified on the
command line have a depth of 0.
%l If the file is a symbolic link, the filename of the link object. Null if file
isn’t a symbolic link.
%Afchar Partial or full representation of the file’s last access time, depending on
the format character fchar:
continued. . .
%Tfchar Partial or full representation of the file’s last modification time, depending
on the format character fchar. See description of %A, above for details.
Examples:
Search the filesystem for the myfile file or directory:
find / -name myfile
Remove all files named tmp or ending in .xx that haven’t been accessed for seven or
more 24-hour periods:
find / \( -name tmp -o -name ’*.xx’ \) \
-atime +7 -exec rm {} \;
Print the pathnames of all files in and below the current directory, but skip any
directories named SCCS and the files beneath them:
Note that when possible, it’s better to use find in combination with xargs than it is
to use the -exec or -spawn options to start commands. You can use xargs to start a
program once for many files; -exec or -spawn starts the program once for every file
matched. You’ll see a tremendous difference in speed between the two approaches.
For instance:
Exit status:
0 All path operands were successfully traversed.
Caveats:
If you use -exec, -ok, or -spawn, find catches SIGINT (which you can generate, for
example, by pressing Ctrl-C or Ctrl-Break) and asks you whether the find should
continue. If these primaries aren’t used, find terminates from SIGINT.
See also:
chmod, chown, mv, pax, rm, xargs
Syntax:
finstall [-c config] [options]...
Runs on:
QNX Neutrino
Options:
See below.
Description:
The finstall utility installs a self-hosted QNX Neutrino system.
WARNING: Running this utility will destroy your current installation of QNX
Neutrino. The only reason we ship finstall is to allow customers to create a
custom installer boot image. This will likely happen only under the direction of
our support staff.
Syntax:
flashctl [-eFfimruvxz] [-A] [-a flags] [-b align]
[-c flag] [-L] [-l limit] [-n path] [-o offset]
-p path [-s num] [-U] [-u] [-v...]
Runs on:
Neutrino
Options:
The options are processed in the order given, and apply to the last partition specified
by a -p option, letting you control multiple partitions with one command.
Use this option only with a “raw” device (e.g. /dev/fs0); don’t use it with a mounted
partition. You can’t use the -l and -o options with the -A option.
-e Erase the raw partition specified by the preceding -p option from the
offset specified by the -o option through to limit specified by the -l
option.
If you specify the -v option for verbose output, flashctl outputs a
period (.) for every partition unit that it erases. On RAM disk, the unit
size is 64K; on other devices, it varies. This output is reassuring because
it can take several minutes to erase slow flash devices.
-f Format the raw partition specified by the preceding -p option from the
offset specified by the -o option through to limit specified by the -l
option.
-F Force the driver to use the given offset and length parameters, even if the
offset and length parameters don’t fall within the bounds of the partition
specified by the preceding -p option. The range provided by the -o and
-l arguments must fit in a single partition, and can’t cross partition
boundaries.
-L Lock the raw partition specified by the preceding -p option from the
offset specified by the -o option through to limit specified by the -1
option.
Description:
The flashctl utility is used to manage a flash filesystem. The utility interacts with
the flash filesystem driver using devctl() messages. Using flashctl, you can erase
and format a raw partition, force a reclaim operation, and get information about flash
filesystem partitions.
• The options are processed in the order entered. For example, you must erase (-e),
format (-f), and mount (-m) a partition in this order.
• For now, use flashctl instead of mount and umount to mount and unmount flash
partitions.
The flashctl utility rounds the values of the -o and -l (“el”) options down to the
nearest block bound. If the range specified exceeds the partition size, it’s rounded
down to fit. If you use the -v option, flashctl displays what the values have been
rounded to.
Filesystem information
If you use the -i option, flashctl displays information about the partition that you
chose with the -p option; the amount of information depends on what you chose (the
raw socket, raw partition, or formatted mounted filesystem):
• /dev/fs0 points to the entire socket, which means the whole chip (or all
physically contiguous chips). This is the Array Info listed below.
Array Info The total amount of contiguous flash at the specified base address:
• Total — the size.
• Chip Size — the size of each chip if there are multiple
physical chips (they’re assumed to all be the same size).
• Unit Size — the size of one sector, and the percentage of the
total size.
Part Info Information for the requested partition. Sizes are given in bytes and
as a percentage of the size of the partition; some fields might not be
filled in:
• Total — the partition size.
• Spare — the amount of space used for spare blocks;
Spare/Unit Size gives the number of spare blocks.
• Headers — the space used for filesystem extent headers.
• Padding — the space used for alignment padding.
• Overhead — the total of Headers + Padding.
• Free — the amount of free space (no reclaim necessary).
• Stale — the amount of stale space.
• Avail. — the total amount of usable space; this is the total of
Free + Stale.
• Reserved — internal reserved space for unlinking, etc.
Examples:
Create a flash filesystem between 1 MB and 3 MB in a 4 MB raw partition:
flashctl -p /dev/fs0p0 -o 1M -l 2M -e -f
Erase, format, and then mount (as /fs0p0) the flash filesystem partition
/dev/fs0p0:
flashctl -p /dev/fs0p0 -e -f -m
Use the following command to format the range from 3 to 6 MB, if the layout is
unknown:
flashctl -p /dev/fs0p0 -F -o 3m -l 6m -f
For devf-ram partitions only, you must format and erase a partition before you can
mount the flash filesystem. Otherwise, you may get an error message flashctl:
mounting partition failed.
Caveats:
The mount facility (with the -m and -u options) doesn’t provide complete mount
functionality, such as read-only (mount -r) and special options (mount -o).
See also:
devf-generic, devf-ram, mkefs
“FFS3 filesystem” in the Filesystems chapter of the System Architecture.
Syntax:
flex [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -ooutput
-Pprefix -Sskeleton] [--help --version] [file ...]
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
-+ Generate C++ scanner class.
Description:
The flex command generates programs for lexical tasks.
QNX does not provide the flex library (libfl.a). If you wish to generate code that is
not dependent on this library, add the following line as the first line in your lex source
file:
%option noyywrap
Contributing author:
GNU
Syntax:
fmt [-w width] [-m maximum] [-] [file...]
Runs on:
Neutrino
Options:
-m maximum The maximum line length. The default is 75 characters.
-w width Make the lines as close to width as possible. The default width is 65
characters.
Description:
The fmt utility concatenates the input files, formats the output as specified by the
width and maximum options, and sends the results to standard output. Non-indenting
tabs are converted to spaces; tabs are used for indentation where possible. If no input
files are given, fmt reads from standard input.
Syntax:
fold [-bs] [-w width] [file...]
Runs on:
Neutrino
Options:
-b Count width in bytes rather than column positions. If -b is specified,
carriage-return, backspace and tab are treated as normal
characters. Only newline remains special.
-s If a segment of a line contains a blank within the first width column
positions, break the line after the last such blank meeting the width
constraints (i.e. avoid breaking the line in the middle of a word).
-w width Specify the maximum line length. The default is 80 characters.
Description:
The fold filter folds lines in files by breaking up lines that have a width in excess of
80 or, if specified, the width in the command-line -w option. Lines are folded by the
insertion of a newline character. All output is written to the standard output.
In all cases, the current count of line width is reset to zero when a newline character
is encountered in the input. In addition, when the -b option is not specified, the
following characters have a special meaning when encountered in the input:
carriage-return
The current count of line width is set to zero.
backspace The current count of line width is decremented by one (but it doesn’t
go below zero).
tab The current count of line width is incremented to the next count for
which count modulo 8 equals 1.
Examples:
Fold the file myfile.txt to a maximum line width of 80 characters, making the line
breaks on the last word boundary (white space) before the width was exceeded and
write the results to the standard output:
fold -s myfile.txt
Fold the file myfile.txt to a width of 40 characters, and treat all characters except
newline as occupying one character (byte) position and write the results to the
standard output:
fold -bw40 myfile.txt
Files:
If no files are specified on the command line, fold reads lines to be folded from the
standard input until EOF is reached.
The fold utility writes all folded output from all input files to the standard output.
If an error occurs, a diagnostic message is written to the standard error.
The fold utility reads lines from the text files specified on the command line. If the
-b is specified, the input files need not be text files.
Exit status:
>0 An error occurred.
See also:
pr, sed
Syntax:
fontinfo -f file [-S size] [-v] [-r] [-s dir]
[-t file] [-c ch] [-C ch]
[-u][<code|code-code> [...]]
Runs on:
Neutrino
Options:
-f file The font file to display information about. This argument must be a path to
the font file.
-S An integer defining the font size of the rendered font. The default size is
10. This applies to scalable fonts only.
-t file The unicode file tab to display the name of each character. See note below.
-c ch Render each character to the screen, using the supplied character to fill the
white space around the character. This option uses an asterisk to render the
font to the screen. The supplied character fills in the white space around the
glyph.
-C ch Render each character to the screen, using only the supplied character in
the rendering. This option renders the character to the screen without using
a character to fill up the white space.
-u Display the UTF8 string as a string, instead of the default hex dump.
<code|code-code> [...]
Specifies the character code or code range to process or render. This
command line option may be repeated.
Description:
The fontinfo utility returns information and metrics about each glyph in a given
font file, or for a specified code list or range(s).
You can render each glyph in the font file to the screen (using ASCII characters) by
using the -r option. You can render only a subset of glyphs in the font file by
specifing a code range.
The unicode tab file that is used by the -t argument must use the following format:
For example:
0021,EXCLAMATION MARK
0022,QUOTATION MARK
0023,NUMBER SIGN
0024,DOLLAR SIGN
0025,PERCENT SIGN
0026,AMPERSAND
Examples:
In the following example, the fontinfo utility is called using the font file webt.ttf.
Each glyph in the file is rendered to the screen using the . character. The size of each
glyph is 20 characters.
fontinfo -f web.ttf -r -C . -S 20
The output for a single glyph in the font file is shown below:
Range: 0x2030 (8240)
0x2030 (8240, utf8:0xe2 0x80 0xb0, glyph index:16):
Size: 26,22, render offset: 0,22
Metrics: Adv.=001B.0000, BearingX,Y=0000.0000,0000.0540, maxX=0000.0680
... ...
..... ..
... ... ..
.. .. ..
.. .. ..
.. .. ..
.. .. ..
.. .. ..
... ... ...
..... ..
... .. .... ...
.. ...... .....
.. ... ... ... ...
.. .. .. .. ..
.. .. .. .. ..
.. .. .. .. ..
... .. .. .. ..
.. .. .. .. ..
.. ... ... ... ...
.. ...... .....
.. .... ...
In the following example, the fontinfo utility is called using the / character to fill
the white space around the glyph. The font size is set to 15.
fontinfo -f web.ttf -r -C / -S 15
The output for a single glyph in the font file is shown below:
See also:
In the Photon Programmer’s Guide see: Fonts
Syntax:
N/A
Runs on:
Neutrino
Options:
None.
Description:
The fpemu.so shared object provides support for floating-point emulation. QNX
Neutrino automatically loads this object when math operations are required on a
system with no floating-point unit.
By default, QNX Neutrino uses floating-point hardware in the CPU if present, and
emulates it in software if the CPU has no FPU. To force floating-point emulation, use
the -fe option to procnto.
Caveats:
In this version of QNX Neutrino, you can’t use the floating point emulator in statically
linked executables.
See also:
procnto
Syntax:
freeze [-cdfvVz] [[+n1,...,n8] [filename]]...
Runs on:
Neutrino
Options:
-c Write the results of the freeze/melt operation to standard output. No
files are changed.
-f Force creation of the .F file. This option creates the .F file, even if
one already existed, without prompting you for confirmation. The .F
file is created even if the compressed file is larger than the original.
Description:
The freeze utility compresses the specified files or the standard input. If a file
becomes smaller, it’s replaced by a file with the extension .F (you can use the -f
option to force the creation of the .F file, even if the compressed file is larger). If no
files are specified, the compression is applied to the standard input and is written to the
standard output.
If you don’t specify the -f option, and you run freeze in the foreground, you’re
prompted as to whether the file should be overwritten.
CAUTION:
! When a .F file is created, the original file is removed.
Normally there are several links set up to the freeze utility. Freeze behaves
differently when invoked under these command names:
When you specify filenames, freeze maintains the ownership, modes, access times,
and modification times between the file and its .F version. As a result, you can use
freeze for archival purposes, yet you can still use it with make after melting.
The freeze utility uses the Lempel-Ziv algorithm on the first pass and the dynamic
Huffman algorithm on the second pass. The size of “sliding window” is 8K and the
maximum length of “matched string” is 256. The positions on the window are coded
using a static Huffman table.
A two-byte magic number is prepended to the file to ensure that neither melting of
random text nor refreezing of already frozen text is attempted. In addition, the
characteristics of the static Huffman table being used during the freeze are written to
the file so that these characteristics may be adapted to concrete conditions.
The amount of compression you obtain depends on the size of the input file and the
distribution of character substrings and their probabilities. Typically, text files (e.g. C
programs) are reduced by 60% to 75%, while executable files are reduced by 50%.
Compression is generally much better than that achieved by LZW coding or by
Huffman coding, although it takes more time to compute.
An argument preceded by a + defines the values to use for the Huffman table. You may
want to explicitly state these values in order to modify the compression algorithm.
The freeze compression utility will eventually become deprecated in favor of the
GNU zip suite, gzip/gunzip/zcat. The freeze suite of utilities will continue to be
provided for quite some time before being eliminated completely.
Examples:
Freeze all files in the current directory:
freeze *
melt *.[ch].F
Or:
freeze -d *.[ch].F
View the concatenated contents of all compressed files in the current directory:
Exit status:
0 Normal exit.
1 An error occurred.
Contributing author:
Leonid A. Broukhis
See also:
bzip2, cpio, fcat, gunzip, gzip, melt, pax, tar, zcat
Backing Up and Recovering Data in the Neutrino User’s Guide
Syntax:
driver ... cd cd_options ... &
Runs on:
Neutrino
Options:
Where driver is one of the devb-* drivers, and cd_options is one or more of the
following, separated by commas:
case=asis|lower|upper
Control the case used to display ISO-9660 filenames (to a readdir()
request; all pathname matching is always performed
case-insensitively on such names):
• asis — don’t convert the filename in any way; if the CD was
mastered with strict ISO-9660 compliance, the name will be in
uppercase, but more lenient utilities could produce mixed-case
filenames.
• lower — convert to lowercase (the default).
• upper — convert to uppercase.
RRIP and Joliet store case-preserving names and ignore this option.
gid=group Set the owning group to group for files on disks without Rock Ridge
extensions. The default is 0 (root).
hidden=hidden_mode
Specify what to do with “hidden” files. The hidden_mode can be
one of:
• ignore — ignore the hidden files; they don’t appear in the
filesystem.
• show — (the default) show hidden files in the filesystem as
normal files.
• dot — show hidden files in the filesystem with a dot (.) prefixed
to their names.
begins with a +, then all metadata fields are presented but may have
a length of zero.
nomulti Disable multisession support (mount the first data session instead of
the last).
uid=user Set the owner to user for files on disks without Rock Ridge
extensions. The default is 0 (root).
umask=mask Apply this permission mask to files on disks without Rock Ridge
extensions. The default is 0 (all access permissions).
In addition, you can specify any of the filesystem options described for io-blk.so.
Description:
The fs-cd.so shared object provides support for ISO-9660 filesystems. It’s
automatically loaded by the devb-* drivers when mounting an ISO-9660 filesystem.
• This filesystem uses UTF-8 encoding for presentation of its filenames; attempts to
specify a filename not using UTF-8 encoding will fail (with an error of EILSEQ).
See also:
devb-*, fs-dos.so, fs-ext2.so, fs-qnx4.so, fs-qnx6.so, fs-udf.so,
io-blk.so, mount, umount
Filesystems chapter of System Architecture
QNX Neutrino User’s Guide:
• “Filesystems and block I/O (devb-*) drivers” in the Fine-Tuning Your System
chapter
Syntax:
fs-cifs [-a] [-b] [-D] [-d name] [-h] [-L|-l] [-o option[,option...]]
[-t n] [-v[v]...] [-Z n]
[[//netbiosname:]server:/share
prefix user passwd]
Runs on:
Neutrino
Options:
-a Spoof POSIX attributes; calls to chmod() and chown() return EOK
instead of ENOTSUP. Use -a to get rid of error messages from
applications that attempt to set the mode or ownership of files and
directories, such as cp.
-b Turn off buffered writes (default is on). This makes writes to the
remote filesystem slower, but safer.
-L Ask the user to provide the password (the command line doesn’t
include password).
-l (“el”) Ask the user to provide the name of the user and the password
(the command line doesn’t include user or password).
-o option[,option...]
Miscellaneous options; use commas to separate them. These options
include:
• old — don’t use 64-bit filesystem dialects. By default, fs-cifs
supports 64-bit filesystem operations.
• plainpwd — if logging in with an encrypted password fails, try to
log in by using the password unencrypted.
Adding the password to the log file may be a security problem if unauthorized
personal have access to the log file.
• timeout=n — set the reconnection timeout to be n seconds.
[//netbiosname:]server:/share
Specify the server name or IP address and the shared resource name of
the filesystem being mounted.
If you specify a server name, there must be some way to resolve it to an IP address.
See /etc/hosts or /etc/nsswitch.conf.
You must specify the netbiosname if:
• The server’s TCP/IP host name is different from its NetBIOS name
Or
• The server host is running a Microsoft operating system.
prefix Absolute path specifying where to mount share in the local filesystem.
If your password includes characters that the shell considers to be special, you might
have to enclose the password in quotation marks.
Description:
The fs-cifs filesystem manager is an SMB (also known as CIFS — Common
Internet Filesystem) client operating over TCP/IP. SMB is a protocol for accessing
resources in a controlled fashion over a LAN.
The fs-cifs filesystem manager is primarily intended for use as a client with
Windows NT machines, although it also works with any SMB server (such as OS/2
Peer, LAN Manager, or SAMBA). To use fs-cifs, you must have an SMB server
and a valid login on that server.
The fs-cifs filesystem manager also requires a TCP/IP transport layer, such as the
one provided by io-pkt*.
You can mount SMB filesystems at the same time as you start fs-cifs; you can also
mount them separately after you have started fs-cifs using the mount command.
If you want to mount filesystems separately, start fs-cifs without arguments, as a
daemon, then create your mountpoints using mount specifying cifs as the type. See
below for an example.
If syslogd is running, fs-cifs writes any error messages to the system log.
Examples:
Start fs-cifs and mount the QNX_BIN share as /bin from an SMB server named
SMB_SERVER (with IP address 10.0.0.1) using the guest account and a password of
none:
Or:
fs-cifs 10.0.0.1:/QNX_BIN /bin guest none
The same as the above, but with a server, called NB_NAME, running a Microsoft
operating system:
fs-cifs //NB_NAME:SMB_SERVER:/QNX_BIN /bin guest \
none
Or:
fs-cifs //NB_NAME:10.0.0.1:/QNX_BIN /bin guest \
none
Ask the user for the name of the user and the password:
fs-cifs -l //NB_NAME:SMB_SERVER:/QNX_BIN /bin
Start fs-cifs as a daemon, then mount the QNX_BIN share as /bin from an SMB
server named SMB_SERVER (with IP address 10.0.0.1) using the guest account and
a password of none:
fs-cifs &
Then:
or:
Files:
/dev/log syslogd interface.
Caveats:
When the filesystem is mounted, everybody who uses the filesystem does so with the
privileges of the user specified on the command line.
The passwd argument is required on the command-line even if user doesn’t require a
password; it can be anything other than whitespace.
See also:
fs-nfs2, fs-nfs3, io-pkt*, mount, /etc/nsswitch.conf, umount, syslogd
Filesystems chapter of System Architecture
QNX Neutrino User’s Guide:
Syntax:
driver ... dos dos_options ... &
Runs on:
Neutrino
Options:
Where driver is one of the devb-* drivers, and dos_options is one or more of the
following, separated by commas:
codepage=mapping
Install a DOS codepage for mapping of locale 8.3 filenames.
These names are used only when the corresponding (Unicode)
long filename is absent (created pre-Win95) or has been
disabled (using lfn=ignore) or for the volume label;
specification of the appropriate locale will also allow portability
of filenames created by fs-dos.so to older versions of DOS.
Use the “chcp” native command on a DOS system to determine
its active codepage. Supported values for mapping are: cp437,
cp850, cp852, cp866, cp1250, cp1251, and cp1252.
fat=lazy|nonrmv|always
Set pre-reading of the FAT. Scanning the FAT is required to
return the count of free blocks. It also allows for improved
write() performance by creating an in-memory summary of
where free blocks might be located within the filesystem.
The value must be one of the following:
• always — always read the entire FAT at mount time
• lazy — read the FAT only when required (statvfs() query)
• nonrmv — act as always for nonremovable media, and
lazy for removable media
fsi=mode Set the handling of the FAT32/FSI record (this contains a count
of free clusters plus a hint at the next free cluster). The mode is
one of:
• ignore — ignore the record.
• lazy — update the record only when unmounting.
• update — update it whenever the FAT is modified.
• use — update it and use it (normally the free block count is
calculated at mounting).
The default is lazy.
gid=group Set the owning group of all files to group. The default is 0
(root).
hidden=hidden_mode
Specify what to do with files that have the DOS “hidden”
attribute; hidden_mode can be one of:
ignore The hidden files are ignored; the files don’t appear in
the filesystem.
show The hidden files appear in the filesystem as normal
files.
dot The hidden files appear in the filesystem with a dot
(.) prefixed to their names. Files created with a
leading dot have the DOS “hidden” attribute set.
lnk=lnk_mode Set the handling of Windows shortcut files. The options are:
notrunc Enforce short (8.3) filenames. This option is valid only with
lfn=ignore. By default, filename components beyond the 8.3
limit are silently ignored. For example, LONGFILENAME.TXT
becomes LONGFILE.TXT.
posix=posix_mode
Set POSIX check and emulation modes; posix_mode can be one
of the following:
• Remove an r permission.
• Set an s permission.
• Set a file modification or access time to pre-1980.
uid=user Set the owner of all files to user. The default is 0 (root).
umask=mask Apply this permission mask to all files. The default is 0 (all
permissions).
vollabel=vollabel_mode
Specify what to do with the DOS volume name; vollabel_mode
can be one of:
In addition, you can specify any of the filesystem options described for io-blk.so.
Description:
The fs-dos.so shared object lets you mount DOS filesystems (FAT12, FAT16, and
FAT32) under QNX Neutrino.
The fs-dos.so shared object is automatically loaded by the devb-* drivers when
mounting a DOS FAT filesystem.
This filesystem uses UTF-8 encoding for presentation of its filenames; attempts to
specify a filename not using UTF-8 encoding will fail (with an error of EILSEQ).
a Read-only.
b Not usually necessary.
For more information, see the Filesystems chapter of the System Architecture guide.
See also:
chkdosfs, devb-*, fs-cd.so, fs-ext2.so, fs-mac.so, fs-nt.so,
fs-qnx4.so, fs-qnx6.so, fs-udf.so, io-blk.so, mkdosfs, mount, umount
Filesystems chapter of System Architecture
QNX Neutrino User’s Guide:
• “Filesystems and block I/O (devb-*) drivers” in the Fine-Tuning Your System
chapter
Syntax:
fs-etfs-ram [common-options] [-Ddriver-options]
Runs on:
ARM, MIPS, PowerPC, SH4, x86, and XScale processors
Options:
Board Support Packages may include a board-specific embedded transaction
filesystem. All fs-etfs-* filesystems use the same common options as
fs-etfs-ram; for driver-specific options, see the BSP documentation or use the -D
use option, as described in “Driver options,” below.
Common options
-a Update access times (atime). Default is to not update atime, to
reduce the number of flash writes.
-c nclusters Set the cache size. The cache holds recently read clusters in RAM,
reducing the need to access the device if the same cluster is read
again. It’s also used to combine small writes into larger writes
consisting of multicluster transactions. This reduces file
fragmentation across the device and improves filesystem startup
time. Since most devices are very fast, a small cache is usually
acceptable. Larger caches may be desirable if many files are being
written with small writes concurrently. The default value is 64
clusters, where cluster size is usually 1 KB or 2 KB, depending on
the device.
Default: use CRCs for error checking and ECCs for error
correction.
-f numfiles Set maximum number of files. The default value is 4096, with a
maximum of 32,767.
-F num Defragment if the average extent is less than num clusters. The
value of num must be in the range from 0 through 16. Default is 6.
The fs-etfs-ram utility doesn’t defragment if num is 0.
-r kbytes Set the size of the raw partition /dev/etfs1, in kilobytes. This
partition, if present, is typically used to hold a boot image made
using the mkifs utility. The default size is 0.
-s num Set the number of flash blocks to use as spares. One spare block is
required to perform a reclaim. During normal operation, flash
devices wear, which causes flash blocks to fail. More than one
spare block provides extra redundancy. Default is 4.
-W erasediff Set wear-leveling span. Allow flash blocks to have erase counts
that differ by more than erasediff before attempting to either :
• force them into service if they are below erasediff
Or:
-x nextents Cache this number of file extent offsets. This option reduces the
processing needed to read through file extents on the device.
Default is 8.
Driver options
use Get a list of driver-specific options. This option causes the filesystem
to print a usage message and then terminate without accessing the
device.
size=nnM Set the size of the RAM disk to nn megabytes. The default is 16 MB.
Description:
The embedded transaction filesystem (ETFS) implements a high-reliability filesystem
for use with embedded solid-state memory devices with particular attention to NAND
flash memory. The filesystem supports a fully hierarchical directory structure with
POSIX semantics as shown in the table below:
The raw partition is used for boot images and is always at the start of the device. It
may be zero bytes long if no boot image is needed. The filesystem partition is
mounted in the pathname space as specified by the -m option.
If you don’t specify the -m option, the filesystem isn’t mounted. You can use the
mount command to mount it later:
Examples:
Start ETFS to implement a temporary filesystem in RAM mounted at /tmp. Since it’s
not persistent across a reboot, and since RAM is reliable, you should disable all data
error detection and correction (-C 0). The -e option initializes an empty filesystem
ready to go upon startup. Since the filesystem is in high-speed RAM, you should
specify the smallest cache possible with the -c 0 option.
fs-etfs-ram -C 0 -e -c 0 -m /tmp
Caveats:
Although ETFS supports most POSIX semantics, some functionality isn’t
implemented in order to keep the driver simple and efficient. The unsupported POSIX
semantics include:
• Hard links, and related links. For example the . and .. directories aren’t returned
in a readdir(). Symlinks are fully supported.
• Access times aren’t updated on the media unless the -a option is specified, to
reduce flash writes.
• The parent directory’s modification time isn’t updated when the directory content
changes (files are created or deleted).
See also:
etfsctl, mketfs, mount, umount
Filesystems chapter of System Architecture
“Filesystem limits” in the Understanding System Limits chapter of the QNX Neutrino
User’s Guide
Syntax:
driver ... ext2 ext2_options ... &
Runs on:
Neutrino
Options:
Where driver is one of the devb-* drivers.
unfixbadver Turns off work-arounds for corrupt volumes created by the buggy
1.19 version of mke2fs.
Description:
The Ext2 filesystem (fs-ext2.so) provides transparent access to Linux disk
partitions. This implementation supports the standard set of features found in Ext2
versions 0 and 1.
Sparse file support is included in order to be compatible with existing Linux partitions.
Other filesystems can only be “stacked” read-only on top of sparse files. There are no
such restrictions on normal files.
If an Ext2 filesystem isn’t unmounted properly, a filesystem checker is usually
responsible for cleaning up the next time the filesystem is mounted. Although the
fs-ext2.so module is equipped to perform a quick test, it automatically mounts the
filesystem as read-only if it detects any significant problems (which should be fixed
using a filesystem checker).
The following features are not currently supported:
• filetype extension
• compression
• b-tree directories
This filesystem uses UTF-8 encoding for presentation of its filenames; attempts to
specify a filename not using UTF-8 encoding will fail (with an error of EILSEQ).
a Read-only.
b Not usually necessary.
For more information, see the Filesystems chapter of the System Architecture guide.
Caveats:
Although Ext2 is the main filesystem for Linux systems, we don’t recommend using
fs-ext2.so as a replacement for the QNX 4 filesystem (fs-qnx4.so). Currently,
we don’t support booting from Ext2 partitions. Also, the Ext2 filesystem relies heavily
on its filesystem checker to maintain integrity; this and other support utilities (e.g.
mke2fs) are not currently available for QNX Neutrino.
See also:
devb-*, fs-cd.so, fs-dos.so, fs-mac.so, fs-nt.so, fs-qnx4.so,
fs-qnx6.so, fs-udf.so, io-blk.so, mount, umount
Filesystems chapter of System Architecture
QNX Neutrino User’s Guide:
• “Filesystems and block I/O (devb-*) drivers” in the Fine-Tuning Your System
chapter
Syntax:
driver ... mac mac_options... &
Runs on:
QNX Neutrino
Options:
There are currently no mac_options defined.
In addition, you can specify any of the filesystem options described for io-blk.so.
Description:
The fs-mac.so shared object provides read-only support for Apple HFS
(Hierarchical File System) and HFS Plus. It’s automatically loaded by the devb-*
drivers when mounting an Apple filesystem.
This filesystem uses UTF-8 encoding for presentation of its filenames; attempts to
specify a filename not using UTF-8 encoding will fail (with an error of EILSEQ).
The slash (/) character (which is valid in file names on the Mac but not in POSIX) is
swapped with the colon (:) (which is the Mac path separator). For example, an HFS
file called 29/1/2009 will get shown to ls as 29:1:2009, and when opened with
that name will internally match back to the 29/1/2009 on-disk name.
The fs-mac.so shared object doesn’t support access to the resource fork or hard
links.
continued. . .
a Read-only.
b Not usually necessary.
For more information, see the Filesystems chapter of the System Architecture guide.
See also:
devb-*, fs-cd.so, fs-dos.so, fs-ext2.so, fs-nt.so, fs-qnx4.so,
fs-qnx6.so, fs-udf.so, io-blk.so, mount, umount
Filesystems chapter of System Architecture
QNX Neutrino User’s Guide:
• “Apple Macintosh HFS and HFS Plus” in the Working with Filesystems chapter
• “Filesystems and block I/O (devb-*) drivers” in the Fine-Tuning Your System
chapter
Syntax:
fs-nfs2 [-b num] [-B size] [-D] [-e] [-h]
[-i nodes] [-r] [-S] [-t] [-u] [-v[v]...]
[-Z n] [server:export] [mountpoint]
[[-erStu] [-Z n] server:export mountpoint ...]
Runs on:
Neutrino
Options:
server The name of the NFS server.
-B size Set the buffer size to size bytes. The default is set by the first server,
and is usually 8K.
-v[v]... Verbose output; add more v characters for more verbosity. In order to
capture the log messages, you need to have syslogd running.
The following options apply only to the next mountpoint specified on the command
line:
Description:
The fs-nfs2 filesystem manager is an NFS 2 client operating over TCP/IP. To use it,
you must have an NFS server.
This filesystem manager requires a TCP/IP transport layer, such as the one provided
by io-pkt*. It also needs socket.so and libc.so.
By default, this utility does not set any upper limit for number of inodes.
You can also create mountpoints with the mount command by specifying nfs for the
type. You must start fs-nfs2 before creating mountpoints in this manner. If you start
fs-nfs2 without any arguments, it runs in the background so you can use mount.
Examples:
Mount the qnx_bin export as /bin from an NFS server named server_node:
fs-nfs2 server_node:/qnx_bin /bin &
Mount /nfs1 using TCP, and /nfs2 using UDP:
fs-nfs2 -t host1:/ /nfs1 host2:/ /nfs2
Mount both using TCP:
fs-nfs2 -t host1:/ /nfs1 -t host2:/ /nfs2
Caveats:
If possible, you should use fs-nfs3 instead of fs-nfs2.
See also:
fs-cifs, fs-nfs3, io-pkt*, mount, syslogd, umount
Filesystems chapter of System Architecture
QNX Neutrino User’s Guide:
Syntax:
fs-nfs3 [-b num] [-B size] [-D] [-e] [-h]
[-i nodes] [-r] [-s] [-S] [-t]
[-T threads] [-u] [-v[v]...] [-w delay=sec]
[-w number=num] [-w size=num] [-w sync=hard]
[-Z n] [server:export] [mountpoint]
[[-erStu] [-Z n] server:export mountpoint ...]
Runs on:
Neutrino
Options:
server The name of the NFS server.
-B size Set the buffer size to size bytes. The default is set by the first server,
and is usually 8K.
-v[v]... Verbose output; add more v characters for more verbosity. In order to
capture the log messages, you need to have syslogd running.
The following options apply only to the next mountpoint specified on the command
line:
-w delay=sec Indicate the time, in seconds, after which the data will be
flushed to the server. The default is 2 seconds.
Description:
The fs-nfs3 filesystem manager is an NFS 3 client operating over TCP/IP. To use it,
you must have an NFS server.
When you use fs-nfs3 with write caching (the default), you benefit from enhanced
filesystem performance. However, there can be interoperability issues if more than one
NFS client accesses the same file on the NFS server. If fs-nfs3’s cached data hasn’t
been written to the NFS server, another NFS client attempting to read the same file
won’t see the changes to the file until they’re written to the server at a later point. If
you want fs-nfs3 to write file modifications immediately to the NFS server, use the
-w sync=hard option to turn off write caching.
This filesystem manager requires a TCP/IP transport layer, such as the one provided
by io-pkt*. It also needs socket.so and libc.so.
By default, this utility does not set any upper limit for number of inodes.
You can also create mountpoints with the mount command by specifying nfs for the
type and -o ver3 as an option. You must start fs-nfs3 before creating mountpoints
in this manner. If you start fs-nfs3 without any arguments, it runs in the background
so you can use mount. The options that you can use with mount include the following:
tcp Use TCP instead of UDP. If this fails, mount uses UDP.
udp Use UDP (which is the default). If this fails, mount fails.
nocachesymlink
Don’t cache symlinks.
soft Use a soft mount (i.e. break the connection if unable to reach the server).
Examples:
Mount the qnx_bin export as /bin from an NFS server named server_node:
Caveats:
If possible, you should use fs-nfs3 instead of fs-nfs2.
See also:
fs-cifs, fs-nfs2, io-pkt*, mount, syslogd, umount
Filesystems chapter of System Architecture
QNX Neutrino User’s Guide:
Syntax:
driver ... nt nt_options... &
Runs on:
QNX Neutrino
Options:
compress=number The number of buffers to use for the dynamic decompression of
compressed files (e.g. if in a directory you set the “Compress
contents to save disk space” folder attribute). The default is 2; a
value of 0 disables support for compressed files.
In addition, you can specify any of the filesystem options described for io-blk.so.
Description:
The fs-nt.so shared object provides read-only support for the Microsoft Windows
NT filesystem. It’s automatically loaded by the devb-* drivers when mounting an NT
filesystem.
This filesystem uses UTF-8 encoding for presentation of its filenames; attempts to
specify a filename not using UTF-8 encoding will fail (with an error of EILSEQ).
The fs-nt.so shared object doesn’t support encrypted files, security IDs or ACLs,
and alternate data streams.
continued. . .
a Read-only.
b Not usually necessary.
For more information, see the Filesystems chapter of the System Architecture guide.
See also:
devb-*, fs-cd.so, fs-dos.so, fs-ext2.so, fs-mac.so, fs-qnx4.so,
fs-qnx6.so, fs-udf.so, io-blk.so, mount, umount
Filesystems chapter of System Architecture
QNX Neutrino User’s Guide:
• “Filesystems and block I/O (devb-*) drivers” in the Fine-Tuning Your System
chapter
Syntax:
driver ... qnx4 qnx4_options... &
Runs on:
Neutrino
Options:
Where driver is any of the devb-* drivers, and qnx4_options is one or more of the
following, separated by commas:
In addition, you can specify any of the filesystem options described for io-blk.so.
Description:
The fs-qnx4.so shared object provides support for QNX 4 filesystems. It’s
automatically loaded by the devb-* drivers when mounting a QNX 4 filesystem.
Summary of filesystem commands
The following table shows the shared objects and related commands for the
filesystems:
a Read-only.
b Not usually necessary.
For more information, see the Filesystems chapter of the System Architecture guide.
Files:
.longfilenames
To enable support for long filenames (more than 48 characters) on an existing
QNX 4 compatible filesystem, login as root and create an empty, read-only file
named .longfilenames in the root directory of that filesystem.
To enable support for long filenames on a new QNX 4 filesystem, use the -N
option to dinit.
See also:
devb-*, fs-cd.so, fs-dos.so, fs-ext2.so, fs-mac.so, fs-nt.so,
fs-qnx6.so, fs-udf.so, io-blk.so, mount, umount
Filesystems chapter of System Architecture
QNX Neutrino User’s Guide:
• “Filesystems and block I/O (devb-*) drivers” in the Fine-Tuning Your System
chapter
Syntax:
driver ... qnx6 qnx6_options... &
Runs on:
Neutrino
Options:
hold=allow|root|deny
Control which users (if any) can suspend the taking of snapshots
(via a flag in the DCMD_FSYS_FILEFLAGS devctl() command).
The default is root.
! that the filesystem is power-safe. You can use the sync option to override this
requirement at your own risk. Before using this filesystem on devices — such as
USB/Flash devices — other than traditional rotating hard disk drive media, check to
make sure that your device meets the filesystem’s requirements. For more information,
see “Required properties of the device,” below.
Description:
The fs-qnx6.so shared object provides support for Power-Safe
(copy-on-write/snapshot) filesystems. It’s automatically loaded by the devb-* drivers
when mounting a Power-Safe filesystem.
This filesystem uses UTF-8 encoding for presentation of its filenames; attempts to
specify a filename not using UTF-8 encoding will fail (with an error of EILSEQ).
and:
- Data that has previously been reported as committed to persistent storage
remains stable until explicitly overwritten. The device may implement facilities
such as bad-block remapping or wear-leveling to support this requirement,
provided that such activity never causes loss of persistent data, even under
conditions such as power-loss, etc.
a Read-only.
b Not usually necessary.
For more information, see the Filesystems chapter of the System Architecture guide.
See also:
chattr, chkqnx6fs, devb-*, fs-cd.so, fs-dos.so, fs-ext2.so, fs-mac.so,
fs-nt.so, fs-qnx4.so, fs-udf.so, io-blk.so, mkqnx6fs, mount, umount
Filesystems chapter of System Architecture
QNX Neutrino User’s Guide:
• “Filesystems and block I/O (devb-*) drivers” in the Fine-Tuning Your System
chapter
Syntax:
driver ... udf udf_options ... &
Runs on:
Neutrino
Options:
Where driver is one of the devb-* drivers, and udf_options is one or more of the
following, separated by commas:
case=asis|lower|upper
Control the case used to display ISO 9660 filenames (to a
readdir() request; all pathname matching is always performed
case-insensitively on such names):
• asis — don’t convert the filename in any way; if the CD
was mastered with strict ISO 9660 compliance, the name
will be in uppercase, but more lenient utilities could
produce mixed-case filenames.
• lower — convert to lowercase (the default).
• upper — convert to uppercase.
RRIP, Joliet, and ISO 9660:1999 store case-preserving names
and ignore this option.
If you specify both the case and charset options for an ISO 9660 format,
fs-udf.so ignores the case option.
charset=[pvd_charset][:svd_charset]
Use a non-standard character set mapping for ISO 9660:1988
Primary Volumes and ISO 96660:1999 Supplementary
Volumes. By default, these are ISO 646 (ASCII). However a
number of CD-burning tools incorrectly use extended
characters in filenames. An appropriate charset=
specification can allow these filenames to be displayed
according to a known alternate character set; without such a
hint, fs-udf.so replaces with an underscore (_) any illegal
characters in filenames.
Enhanced SVD format allows the active character set to be
specified via ISO 2022 escape sequences, but again many
CD-burning utilities fail to do this correctly, thus separate
overrides are provided. The supported character sets include:
• IBM850
• IBM852
• IBM866
• US-ASCII
• ISO-8859-1
• ISO-8859-2
• windows-1250
• windows-1251
• windows-1252
The case in these strings doesn’t matter.
format=list Set both the list of disk formats to support, as well as the order
in which they should be probed (for media with multiple
formats, such as UDF-Bridge/DVD-Video or ISO/Joliet).
Separate the formats with colons (:) You can use this option
to:
• set a specific order in which to probe (e.g.
format=joliet:rrip:udf)
• remove a format (e.g. format=-rrip)
• add a format, making it the first preference (e.g.
format=+udf)
Since the audio format matches any disk with audio tracks, you should usually make
it the last in the list. In addition, since many formats are extensions to a base ISO 9660
format, which is also present on the media, you should specify iso9660 itself after
those formats.
The default is
format=udf:rrip:joliet:iso9660e:iso9660:audio.
For backward compatibility, set the format to format=udf to
disable the CD/ISO formats.
gid=group The group ID to use for files with no specified group. The
default is 0.
hidden=hidden_mode
Specify what to do with “hidden” files. The hidden_mode can
be one of:
• ignore — ignore the hidden files; they don’t appear in the
filesystem.
• show — (the default) show hidden files in the filesystem as
normal files.
• dot — show hidden files in the filesystem with a dot (.)
prefixed to their names.
uid=user The user ID to use for files with no specified owner. The
default is 0 (root).
verify=level How much of the ISO PVD or UDF tag content (tag version,
tag location, header checksum, and/or data CRC) to verify; one
of the following:
• none
• tag — all except the data CRC
• all
• ?none
• ?tag
• ?all (the default)
Some ISO 9660:1999 SVD-mastering utilities and
UDF-authoring utilities write incorrect tags, so it might be
necessary to relax the verification if problems are observed. If
you specify an option with a leading question mark (?),
fs-udf.so consults an internal blacklist of known bad
utilities and automatically skips all checks in the list; otherwise
it operates at the level given after the question mark.
In addition, you can specify any of the filesystem options described for io-blk.so.
Description:
The fs-udf.so shared object provides support for UDF (OSTA-UDF/ECMA-167)
and ISO 9660 (base 1988 spec, 1999 spec, Joliet extensions, Rock Ridge extensions)
filesystems. It’s automatically loaded by the devb-* drivers when mounting a UDF
filesystem.
This filesystem uses UTF-8 encoding for presentation of its filenames; attempts to
specify a filename not using UTF-8 encoding will fail (with an error of EILSEQ).
See also:
chattr, devb-*, fs-cd.so, fs-dos.so, fs-ext2.so, fs-mac.so, fs-nt.so,
fs-qnx4.so, fs-qnx6.so, io-blk.so, mount, umount
Filesystems chapter of System Architecture
in the Working With Filesystems chapter, “Filesystems and block I/O (devb-*)
drivers” in the Fine-Tuning Your System chapter, and “Filesystem limits” in the
Understanding System Limits chapter of the QNX Neutrino User’s Guide
QNX Neutrino User’s Guide:
• “Filesystems and block I/O (devb-*) drivers” in the Fine-Tuning Your System
chapter
Syntax:
fsysinfo [options]* device|filesystem
Runs on:
Neutrino
Options:
-l period Loop with the specified period (in milliseconds).
-L period Loop with the specified period (in milliseconds), displaying the
differences in the statistics between iterations.
Description:
The fsysinfo utility is a front end to the devctl(DCMD_FSYS_STATISTICS)
command (from <sys/fs_stats.h>), which queries a disk filesystem for its
statistics. These statistics include disk sectors read and written, the efficiency of
internal caches, the count of various system calls made from user code, and so on.
By default, the current statistics are displayed once. There’s also a looping mode, in
which the utility loops and redisplays the statistics at the specified interval (-l
displays the raw values, and -L displays the difference from the previous values).
Press Ctrl-C to exit.
You can reset the statistics to 0 by using -z or -Z (-z displays what the values were
prior to being reset, but -Z produces no output and is useful in scripts).
If you specify the -m option, fsysinfo doesn’t combine disk I/O statistics from the
specified filesystem and its host device/partition; usually this is necessary for many
filesystem implementations that internally target metadata updates against the host
device and not to a particular higher-level file. (For example, if you specify -m,
modifications to the .bitmap and .inode files for an fs-qnx4 filesystem don’t
show as I/O on the mounted filesystem.)
The output includes the following:
continued. . .
You can use this information to analyze the efficiency of the various io-blk.so
caches, possibly leading to fine-tuning of the driver command-line options (blk
cache= ncache= map= vnode=).
Examples:
# fsysinfo /tmp
FILESYS / (qnx6)
MOUNT mounted Mon Sep 21 06:31:21 2009 elapsed 39 secs
DISK I/O write 0 read 0 r/a 0
direct 0 bad 0
CACHE write 328 read 23696 rate 100%
mru 6792k mfu 2832k ratio 29%
SYSCALL open 1211 stat 1331 namei 2718
write 3 read 2499 devctl 579
create 3 delete 3
NAMES exist 4960 enoent 1096 misses 652
unsuit 8 stale 1 rate 90%
BMAP hit 3977 miss 464 rate 89%
VNODES create 345 hit 7698 rate 95%
lock 17391 recycl 2
SLAB map 114 unmap 2 active 112
Monitor disk access in realtime, updating the statistics every 500 ms:
# fsysinfo -L500 /fs/hd
See also:
chattr, devb-*, fs-*, io-blk.so
Name:
/etc/fstab
Description:
The /etc/fstab file contains descriptive information about filesystems. Programs
read it, but don’t write it; it’s the duty of the system administrator to properly create
and maintain this file. Each filesystem is described on a separate line; fields on each
line are separated by tabs or spaces. Lines beginning with # are comments.
If you specify the -a option to the mount command, the utility mounts the devices
that are listed in /etc/fstab. The format of the /etc/fstab used with the mount
utility is as follows:
See also:
mount
endfsent(), getfsent(), getfsfile(), getfsspec(), mount(), setfsent() in the QNX Neutrino
Library Reference
Syntax:
ftp [-46AadefginpRtVv] [-N netrc] [-o output] [-P port]
[-q quittime] [-r retry] [-s srcaddr]
[-T dir,max[,inc]] [[user@]host [port]]
[[user@]host:[path][/]] [file:///path]
[ftp://[user[:password]@]host[:port]/path[/][;type=X]]
[http://[user[:password]@]host[:port]/path] [...]
Runs on:
Neutrino
Options:
See below.
Description:
The ftp utility is the user interface to the standard Internet File Transfer Protocol.
With this utility, you can transfer files to and from a remote network site. For more
information, see the NetBSD documentation at
http://netbsd.gw.com/cgi-bin/man-cgi?ftp++NetBSD-5.0.
See also:
ftpd, /etc/services, tftp
getservbyname() in the Library Reference
Based on RFC 959, RFC 1123, RFC 1738, RFC 2068, RFC 2428, and RFC 2732
Name:
/etc/ftpchroot
Description:
The /etc/ftpchroot file lists the users who should have their session’s root
directory changed (using chroot()). The root directory is changed accordingly:
If this file doesn’t exist, the root directory change isn’t performed.
The syntax is similar to /etc/ftpusers, except that the class argument is ignored:
userglob[:groupglob][@host] [directive]
See also:
ftpd, /etc/ftpd.conf, /etc/ftpusers
Syntax:
ftpd [-46DdHlnQqrsUuWwX] [-a anondir] [-C user] [-c confdir]
[-e emailaddr] [-h hostname] [-L xferlogfile]
[-P dataport] [-V version]
Runs on:
Neutrino
Options:
In addition to the options described in the NetBSD documentation, ftpd supports the
following:
Description:
The ftpd daemon is an Internet File Transfer Protocol server. It uses the TCP
protocol. For more information, see the NetBSD documentation at
http://netbsd.gw.com/cgi-bin/man-cgi?ftpd++NetBSD-4.0.
# cd ˜ftp
# mkdir -m0555 usr
# chown root:root usr
# mkdir -m0555 usr/lib
For MIPS targets, you need to name this link ldqnx.so.3 instead of ldqnx.so.2.
˜ftp/pub Make this directory mode 777 and owned by ftp. If any files
are to be accessed via the anonymous account, the user should
place them in this directory.
˜ftp/incoming Make this directory where the anonymous users place files they
upload. The owners should be user ftp with an appropriate
group. Members of this group are the only users with access to
these files after they’ve been uploaded, so these people should
know how to deal with them appropriately. To allow anonymous
FTP users the ability to see filenames in this directory, set the
permissions to 770; otherwise, set the permissions to 370.
Anonymous users are able to upload files to this directory, but
they’re unable to download them, delete them, or overwrite
them due to the umask and disabling of the commands
mentioned above.
To set up “ftp-only” accounts to provide FTP only with no valid shell login, you can:
This allows you to log in via FTP into accounts that have /sbin/ftplogin as the
login shell.
See also:
ftp, /etc/ftpchroot, /etc/ftpd.conf, ftpusers, inetd, tftpd, pipe,
syslogd
TCP/IP Networking in the Neutrino User’s Guide
Based on RFC 959, RFC 1123, RFC 2389, RFC 2428
Name:
/etc/ftpd.conf
Description:
The /etc/ftpd.conf file specifies various configuration options for ftpd that apply
once a user has authenticated their connection.
Each authenticated user is a member of a class (determined by the /etc/ftpusers
file) that associates which entries in this file apply to the user. When parsing entries
the following special classes are available:
The /etc/ftpd.conf file consists of a series of lines, each of which may contain a
configuration directive, a comment, or a blank line. Directives that appear later in the
file override settings by previous directives. This allows “wildcard” entries to define
defaults, and then have class-specific overrides.
A “\” is the escape character; it can be used to escape the meaning of the comment
character, or if it’s the last character on a line, extends a configuration directive across
multiple lines. A “#” is the comment character, and all characters from it to the end of
line are ignored (unless it’s escaped with the escape character).
The ftpd STAT command returns the class settings for the current user as defined by
/etc/ftpd.conf.
Each configuration line may be one of:
Escape: Description:
%c Class name
%d Home directory of user
%u Username
%% A % character
motd class [file] Display the contents of file after login as the “message of the
day.” Escape sequences are supported; for more information, see
the “Display file escape sequences” section in the NetBSD
documentation for ftpd at
http://netbsd.gw.com/cgi-bin/man-cgi?ftpd++NetBSD-4.0.
Default settings
The following defaults are used:
checkportcmd all
classtype chroot CHROOT
classtype guest GUEST
classtype real REAL
display none
limit all -1 # unlimited connections
maxtimeout all 7200 # 2 hours
modify all
motd all motd
notify none
passive all
timeout all 900 # 15 minutes
umask all 027
upload all
modify guest off
umask guest 0707
See also:
/etc/ftpchroot, ftpd, ftpusers
Name:
/etc/ftpusers
Description:
The /etc/ftpusers file provides user access control for ftpd by defining which
users may login.
If the /etc/ftpusers file doesn’t exist, all users are denied access.
Related files
/etc/ftpchroot
List of the normal users who should have their session’s root directory changed.
See also:
ftpd, /etc/ftpd.conf
fnmatch(), inet_net_pton() in the Library Reference
Syntax:
fullpath [-v] [name...]
Runs on:
Neutrino
Options:
-v Write verbose output, in this form:
name is qualified_path
name A filename.
Description:
The fullpath utility resolves all prefixes and symbolic links to display a fully
qualified network path for each filename you specify. If no names are given,
fullpath displays the full pathname of the current working directory.
Examples:
$ fullpath -v /usr/bin/CC
/usr/bin/CC is /usr/bin/qcc
Exit status:
0 Successful completion.
See also:
basename, dirname
We recommend you use qcc instead of invoking g++ directly. You can use the -V
option to qcc to invoke g++. For example:
Syntax:
g++_variant [ option | filename ]...
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
The g++_variant depends on the target platform, as follows:
Description:
See gcc for details.
We recommend you use qcc or QCC instead of gcc to compile and link your programs.
For detailed documentation about gcc, see the GNU website at
http://www.gnu.org/.
If you have trouble using the default debug format (-gdwarf), switch to -gdwarf-2
or -gstabs.
Exit status:
0 Success.
33 A nonfatal compilation error was encountered.
34 A fatal compilation error was encountered.
35 Unable to open a required file.
Contributing author:
GNU
See also:
gcov, gdb, qcc
Name:
/etc/gateways
Description:
The /etc/gateways file identifies gateways for the routed daemon. Typically, the
routed daemon queries the network and builds routing tables based on the routing
information transmitted by other hosts that are directly connected to the network.
Gateways that the daemon can’t identify through its queries (also called distant
gateways) may be identified in this file.
When the routed daemon starts, it calls this file to:
• find distant gateways which may not be located using only the information from a
routing socket
Each entry is contained on a single line. Blank lines and lines starting with a pound
sign (#) indicates a comment. An entry may specify user preferences (see “Other
parameter settings”), or it can indicate whether the route is to a network a specific host
using one of the following formats:
mask Optional number, between 1 and 32, that indicates the netmask
associated with Nname.
active Send RIP responses to the distant active gateway. As long as the
gateway is active, information about it is maintained in the
internal routing tables, and will be included with any routing
information transmitted through RIP. If the gateway doesn’t
respond for a period of time, the associated route is deleted from
the internal routing tables and the RIP responses are advertised
via other interfaces. If the distant gateway resumes sending RIP
responses, the associated route is restored.
Such gateways can be useful on media that don’t support
broadcasts or multicasts but otherwise act like classic shared
media like Ethernets such as some ATM networks. One can list
all RIP routers reachable on the HIPPI or ATM network in
/etc/gateways with a series of “host” lines. Note that it’s
usually desirable to use RIPv2 in such situations to avoid
generating lists of inferred host routes.
extern Inform the routed daemon that another routing process will
install such a route and that alternative routes to that destination
shouldn’t be installed by routed. Information about external
gateways is not maintained in the internal routing tables and
isn’t transmitted through RIP. Such entries are only required
when both routers may learn of routes to the same destination.
When debugging is turned on with -T, these lines create pseudo-interfaces. When
setting parameters for remote or external interfaces, you should start the lines with:
if=alias(Hname), or if=remote(Hname), etc.
if=ifname Indicate that the other parameters on the line apply to the
interface name ifname.
md5_passwd=XXX|KeyID[start|stop]
Specify a RIPv2 MD5 password. This keyword is similar to
passwd, except that a KeyID is required.
rdisc_interval=N
Set the nominal interval with which Router Discovery
Advertisements are transmitted to N seconds and their lifetime to
3*N.
redirect_ok Cause RIP to allow ICMP Redirect messages when the system is
acting as a router and forwarding packets. Otherwise, override
ICMP Redirect messages.
ripv1_mask=nname/mask1,mask2
Specify that the netmask of the network, of which nname/mask1
is a subnet, should be mask2. For example,
ripv1_mask=192.0.2.16/28,27 marks 192.0.2.16/28 as
a subnet of 192.0.2.0/27 instead of 192.0.2.0/24.
It’s better to turn on RIPv2 with ripv2_out, instead of using
this facility.
subnet=nname[/mask][,metric]
Advertise a route to network nname with mask mask and the
supplied metric (default is 1). This parameter must appear by
itself on a line. The network number must specify a full, 32-bit
value, as in 192.0.2.0 instead of 192.0.2.
Although this feature may be useful for filling “holes” in CIDR
allocations, it’s a dangerous feature and shouldn’t be used unless
necessary.
trust_gateway=rname[|net1/mask1|net2/mask2|...]
Cause RIP packets from that router and other routers named in
other trust_gateway keywords to be accepted, and packets
from other routers to be ignored. If networks are specified, then
routes to other networks will be ignored from that router.
See also:
routed, rtquery
Syntax:
gawk [-F ere] [-v var=val] [-W GNU_extension...]
[--] program [argument]...
Runs on:
Neutrino
Options:
-f progfile
--file=progfile
Specifies the name of the gawk program, progfile, which contains gawk
statements. You can also specify the gawk program as a single argument
in the command line by using quotes.
-F ere
--field-separator=ere
Define the input field separator (FS) to be the extended regular
expression ere, before any input is read.
-v var=val
--assign=var=val
Assign the value val to variable var before execution of the program
begins.
-W GNU_extension[,GNU_extension]...
Specify a GNU extension. Multiple -W options may be specified, or
multiple extensions may be listed in a single -W option if they are
separated by commas (or white space if the entire option argument has
been quoted from the command line). You can also specify these
options using the GNU long options shown in parentheses below.
The GNU extended options are:
compat (--compat)
Run in compatibility mode. In compatibility mode,
GNU gawk behaves identically to UNIX awk;
none of the GNU-specific extensions are
recognized.
copyleft (--copyleft)
copyright (--copyright)
Print the short version of the GNU copyright
information message on the error output.
dump-variables[=file] (--dump-variables[==file])
Print a sorted list of global variables, their types,
and final values to file. If you don’t specify a file,
gawk prints this list to the file named
awkvars.out in the current directory.
exec=file (--exec=file)
Similar to -f: read the program text from file.
There are two differences:
• This option terminates option processing;
anything else on the command line is passed on
directly to the gawk program.
• Command-line variable assignments of the
form var=value aren’t allowed.
gen-po (--gen-po)
Analyzes the source program and generates a GNU
gettext Portable Object file on standard output for
all string constants that have been marked for
translation.
help (--help)
usage (--usage) Print a relatively short summary of the available
options on the error output.
lint[=fatal] (--lint[=fatal]
Provide warnings about constructs that are dubious
or nonportable to other awk implementations. If
you specify fatal, lint warnings become fatal
errors.
lint-old (--lint-old)
Warn about constructs that aren’t available in the
original version of awk from Version 7 Unix.
non-decimal-data (--non-decimal-data)
Enable automatic interpretation of octal and
hexadecimal values in input data.
posix Turn on compatibility mode, with the following
additional restrictions:
• \x escape sequences are not recognized.
• The synonym func for the keyword function
is not recognized.
• The operators ** and **= cannot be used in
place of ˆ and ˆ=.
profile[=file] (--profile[=file])
Enable profiling of awk programs. By default,
profiles are created in a file named awkprof.out.
-- Indicates end of options, in case subsequent item begins with dash (-)
and is not an option.
program The text of an awk program that contains awk statements, assuming no
-fprogfile option has been specified. The awk program can either be in
a file progfile or specified in the command line, taking into account the
quoting rules of the shell.
Description:
The gawk utility executes programs written in the awk programming language; this
language specializes in manipulating textual data. An awk program is a sequence of
patterns and corresponding actions. When input matching a specified pattern is read,
the action associated with that pattern is carried out. The gawk shipped with QNX is a
port of GNU awk.
This utility is subject to the GNU Public License (GPL). We’ve included it for use on
development systems.
The gawk utility interprets each input line as a sequence of fields, where, by default, a
field is a string of nonblank characters. You can change this default white space
delimiter by using the builtin variable, FS (see Variables), or the -F ere option. The
gawk utility denotes the first field in a line $1, the second $2, and so forth. A $0 refers
to the entire line; setting any other field causes $0 to be reevaluated.
Each input line matched by the patterns and each input line for the getline function
(see the section on Functions) is limited to 1024 bytes.
Programs in awk are composed of statements of the form:
pattern { action }
You can omit either the pattern or the action (that includes the enclosing braces). In
the following sections of this description, blank characters between operators and
reserved words are ignored, unless otherwise specified. All blank characters are
significant inside literal strings and after a function name. A missing pattern matches
any line of input, and a missing action is equivalent to an action that writes the
matched line of input to standard output.
An awk program follows this general procedure:
1 Starts by executing the actions associated with all BEGIN patterns (BEGIN
patterns are described in the section Special patterns — BEGIN and END).
2 Processes each file argument in turn — or standard input if no files are specified
— by cyclically reading and saving data from the file until a record separator is
seen, evaluating each pattern in the script and executing that action for patterns
that evaluate to true (the default record separator is the newline character).
Expressions:
Expressions describe computations used in patterns and actions. Expressions in awk
are constructed from such operators as conditionals, logicals, arithmetics,
assignments, subscripts, and fields. Expressions take on string or numeric values
appropriate to the context. The following table displays valid expressions in groups,
starting from the highest priority.
In this table, the abbreviation expr represents any expression. The abbreviation lvalue
represents any entity that you can assign a value to (i.e. on the left side of an
assignment operator).
Syntax Description
(expr) Grouping
$expr References field number expr
++lvalue Preincrement lvalue by 1
--lvalue Predecrement lvalue by 1
lvalue++ Postincrement lvalue by 1
lvalue-- Postdecrement lvalue by 1
expr ˆ expr Exponentiation
! expr Logical not
+ expr Unary plus
- expr Unary minus
expr * expr Multiplication
expr / expr Division
expr % expr Integer modulus
expr + expr Addition
expr - expr Subtraction
expr expr String concatenation of two exprs
expr < expr Less than
expr <= expr Less than or equal to
expr != expr Not equal to
expr == expr Equal to
expr > expr Greater than
expr >= expr Greater than or equal to
expr1 ˜ expr2 1 if expr1 matches the ERE described by expr2
expr1 !˜expr2 1 if expr2 doesn’t match the ERE described by expr2
expr in array 1 if array[expr] exists
(index) in array Handles multidimensional arrays
continued. . .
Syntax Description
expr && expr Logical AND
expr || expr Logical OR
expr?expr:expr Conditional expression — evaluates first expr and if nonzero
evaluates to the second expr; otherwise to the third expr
lvalue ˆ= expr Raise lvalue to exponent expr
lvalue %= expr Assign lvalue%expr to lvalue
lvalue *= expr Multiply lvalue by expr
lvalue /= expr Divide lvalue by expr
lvalue += expr Add expr to lvalue
lvalue -= expr Subtract expr from lvalue
lvalue = expr Assign expr to lvalue
All of the arithmetic operators are based on the C Standard. The conditional
expression returns either strings or numbers, depending on the input expressions. Only
one of the alternative expressions is evaluated.
In addition to the descriptions in the previous table, an expression can also be a
floating-point number, a literal string enclosed by double quotation marks ("), or a
variable name.
You can treat a variable or a field as a number or a string at any time, depending on its
current usage. There are no explicit conversions between numbers and strings. To
force an expression to be treated as a number, you add zero to it. To force an
expression to be treated as a string, concatenate the null string ("") to it. Variables and
fields are set by the assignment statement:
lvalue=expression
+= -= *= /= %= ˆ= ++ --
each of which produces a numeric result. The left-hand side of an assignment and the
target of increment and decrement operators can be one of the following:
• a variable
• a field selector
<lvalue>: <variable>
| $expr
| <variable> [ <index> ]
;
A valid array index consists of one or more comma-separated expressions, with one
expression for each dimension of the array. Because awk arrays behave as associative
memories, an array index can be any string. Since awk arrays are really
one-dimensional, a multidimensional array index is converted to a one-dimensional
index by concatenating all expressions, each separated from the other by the value of
the SUBSEP variable (see Variables).
Thus, the following two index operations are equivalent:
Variables
You can use variables in an awk program by assigning to them. They don’t need to be
declared — uninitialized variables have the value of the empty string, which has a
numeric value of zero. All variables, including fields, are treated as string variables
unless they’re used in a clearly numeric context.
Field variables are designated by a $, followed by a number or a numerical expression.
You can create new field variables by assigning a value to them. References to
nonexistent fields — i.e. fields after “$(NF )” — produce the null string. But,
assigning to a nonexistent field (e.g. $(NF +2)=5) increases the value of NF, creates
any intervening fields with the null string as their values, and causes the value of $0 to
be recomputed, with the fields being separated by the value of OFS.
This table shows other special variables that gawk sets:
Variable Meaning
ARGC The number of elements in the ARGV array
ARGV Array of command-line arguments — excluding options and the
program argument — numbered from zero to ARGC-1
FILENAME Pathname of the current input file
FNR Ordinal number of the current record in the current file
FS Input field separator regular expression; space by default
NF Number of fields in the current record
NR Ordinal number of the current record from the start of input
OFMT Print statement output format for numbers; "%.6g" by default
OFS Print statement output field separation; space by default.
ORS Print statement output record separator; newline by default
RLENGTH Length of string matched by the match function
RS The first character of the string value of RS is the input record
separator; newline by default. If RS is null, records are separated
by blank lines, and newline is always a field separator, regardless
of the value of FS
RSTART Starting position of string matched by match function, numbering
from 1. This is always equivalent to the return value of the match
function
SUBSEP Subscript separator string for multidimensional arrays; the default
value is \034
You can modify or add to the arguments in ARGV; you can alter ARGC. As each input
file ends, gawk treats the text non-NULL element of ARGV, up through the current
value of ARGC-1, as the name of the next input file. Thus, setting an element of ARGV
to null means that it isn’t treated as an input file. A dash (-) filename indicates the
standard input. If an argument contains an equals sign (=), this argument is treated as
an assignment rather than as a file argument.
Patterns
The structure of a pattern is specified by the following BNF grammar:
<pattern>: BEGIN
|END
|<simple pattern>
|<simple pattern>, <simple pattern>
;
Regular expressions
The gawk utility uses the extended expression notation, except that it lets you use
C-language conventions for escaping special characters within the extended regular
expressions:
Escape Meaning
\b Backspace
\f Form feed
\n Newline
\r Carriage return
\t Tab
continued. . .
Escape Meaning
\ddd 1-3 digit octal value ddd
$4 ˜ /ere/
matches any line in which the fourth field matches the regular expression /ere/.
This pattern:
$4 !˜ /ere/
matches any line in which the fourth field doesn’t match the regular expression /ere/.
You can use an extended regular expression to separate fields by using the -F ere
option, or by assigning the expression to the builtin variable FS. The default field
separator is a single space character. The following describes the behavior of FS:
1 If FS is a single character:
1a If FS is space, skip leading and trailing blanks; fields are delimited by
sets of one or more blanks.
1b If FS is any other character c, fields are delimited by each single
occurrence of c.
Pattern ranges
A pattern range consists of two patterns separated by a comma; in this case, the action
is performed for all lines between an occurrence of the first pattern and the following
occurrence of the second pattern, inclusive. At this point, the pattern range can be
repeated starting at input lines subsequent to the end of the matched range.
Expression patterns
An expression pattern is considered to match — or be true — when the expression
evaluates to a nonzero numeric value. Otherwise, the pattern is considered false.
Actions
An action is a sequence of statements. A statement can be one of the statements listed
as follows. In this list, optional elements are shown in square brackets ([ ]) and
keywords are shown in a constant-width typeface.
Any single statement can be replaced by a statement list enclosed in braces (i.e. {}).
The statements in a statement list are separated by newline characters or semicolons.
The symbol # anywhere in a program line — in strings or EREs — begins a comment
that is terminated by the end of the line.
Statements are terminated by semicolons or newline characters. You can split a long
statement across several lines by ending each partial line with a backslash; newline
characters without backslashes can follow:
• a comma
• an open brace
• a logical AND operator (&&)
• a logical OR operator (||)
• the do keyword
• the else keyword
• the closing parenthesis of an if, for, or while statement
For example:
{ print $1,
$2 }
The while, do...while, for, break, and continue statements are based on the C
Standard, except in the case of for ( variable in array ), which iterates assigning
each index of array to variable in order. The for statement has a form that processes
each element in an array. The order of processing is unspecified.
The awk language supplies arrays that are used for storing numbers or strings. Arrays
don’t have to be declared, and their sizes change dynamically. The subscripts, or
element identifiers, are strings that provide a type of associative array capability.
Subscripts can’t themselves be arrays.
The delete statement removes an individual array element. Thus, the following code
deletes an entire array:
for (index in array)
delete array[index]
The next statement causes all further processing of the current input line to be
abandoned.
The exit statement invokes all END actions in the order in which they occur in the
program source. A next statement inside an END also terminates the program and can
optionally set the utility’s exit status.
Output statements
Both print and printf statements send their output to standard output by default.
The output is written to the location specified by redirection-expression, if one is
supplied, as follows:
>expression
>>expression
|expression
In all cases, the expression is evaluated to produce a string that’s used as a full
pathname to write into (for > or >>) or as a command to be executed (for |). Using the
first two forms, if the file of that name isn’t currently open, it is created if necessary,
opened, and using the first form, truncated. The output is then appended to the file.
Subsequent calls in which expression evaluates to the same name simply append
output to the file; the file remains open until closed.
The third form writes output onto a stream compatible with popen(). If no stream is
currently open, the stream is created with the same command name; the stream created
is compatible with popen() invoked with a mode of w. Subsequent calls write output to
the existing stream if, in those calls, expression evaluates to the same command name
as a stream that’s currently open. The stream is closed as if pclose() were called with
an expression that evaluates to the same command name.
The print statement writes the value of each expression argument to the indicated
output stream, separated by the current output field separator (see OFS in the table of
gawk variables), and terminated by the output record separator (see ORS in the table).
String expressions are written out as is; numeric expressions are written out as if
produced by printf using a format that is the string value of the variable OFMT. The
Modifier Meaning
- Left-justify the expression in its field
width Pad-left to this width as needed; a leading 0 pads with zeros
.prec Maximum string width, or digits to right of decimal point
Format specifications are terminated by any other character. For each format
specification that consumes an argument, the next argument from expression-list is
evaluated and converted to the appropriate type (string, integer, or floating point). Both
print and printf can output at least 1024 bytes.
The format-specification characters that gawk uses are as follows:
Character Interpretation
c If the argument is numeric, print a character; if the argument is a
string, print only the first character
d Decimal integer
e Exponential notation: [-]d.ddddddE[+-]dd
f Floating point: [-]ddd.dddddd
g Shorter of e or f notations; suppress nonsignificant zeros
o Unsigned octal number
s String
x Unsigned hexadecimal number
% Print a %; no argument consumed
Functions:
The awk language has a variety of builtin functions: arithmetic, string, input/output,
and general.
Arithmetic Functions:
The arithmetic functions, except for int, are based on the C Standard.
srand([expr]) Set the seed value for rand() to expr or to the time of day if expr is
omitted. The previous seed value is returned.
String functions:
gsub(ere,repl[,in]) Behaves like sub (see below), except that it replaces all
occurrences of the regular expression in $0 or in the in
argument, when specified.
split(s, a[, fs]) Splits the string s into array elements a[1], a[2],..., a[n], and
returns n. The separation is done with the extended regular
expression fs or with the field separator FS if fs isn’t given.
sub(ere, repl[, in]) Substitutes the string repl in place of the first instance of the
extended regular expression ere in string in and returns the
number of substitutions. If in is omitted, gawk uses the current
record ($0).
substr(s, m[, n]) Returns the n-character substring of s that begins at position m,
numbering from 1. If n is missing, the length of the substring is
limited by the length of the string s.
All of the preceding functions that take ere as a parameter expect a pattern or a string
valued expression that is a regular expression.
getline Sets $0 to the next input record from the current input file. This
form of getline sets NF, NR, and FNR variables.
getline < expression Sets $0 to the next record from the pathname expression. This
form of getline sets the NF variable.
getline var Sets variable var to the next input record from the current input
file. This form of getline sets FNR and NR variables.
getline var < expression
Sets var from the next record of expression, treated as a
pathname. This form of getline doesn’t set the NF, NR, and NFR
variables.
All forms of getline return 1 for successful input, zero for end of file, and -1 for an
error.
User-defined functions
The awk language also provides user-defined functions. You can define such functions
— in the pattern position of a pattern-action statement — as:
Print any line with a substring that matches the regular expression:
/(G|D) (2[0-9][[:alpha:]]*)/
Print the second to last field and the last field in each line; separate the fields by a
colon:
{OFS=":";print $(NF-1), $NF}
Print the line number and number of fields in each line. The three strings representing
the line number, the colon, and the number of fields are concatenated and the resulting
string is written to standard output:
{print NR ":" NF}
Print the first two fields in opposite order separated by the OFS:
{ print $2, $1 }
Same as above, with input fields separated by a comma or space and tab characters,
or a combination of all these:
Add up the first column, and print the sum and the average:
{s += $1 }
END {print "sum is ", s, " average is ", s/NR}
Print the fields in reverse order, one field per line (i.e. many lines out for each line in):
Print all lines between occurrences of the strings start and stop:
/start/, /stop/
Print all lines whose first field is different from the first field of the previous line:
Simulate echo:
BEGIN {
for (i = 1; i < ARGC; ++i)
printf "%s%s ", ARGV[i], i==ARGC-1? "\n ": " "
}
If there’s a file named myfile that contains page headers of the form:
Page #
/Page/{ $2 = n++; }
{ print }
Examples:
Print the file myfile, which contains page references, filling in page numbers starting
at 5:
Files:
By default, input files are text files that are read in order. You can modify either
variable ARGV or variable ARGC to place this default file processing under program
control.
The nature of the output files depends on your awk program.
Environment variables:
PATH Defines the search path when looking for commands executed by
system(expr), or input and output pipes.
Exit status:
0 All input files were processed successfully.
Contributing author:
GNU
See also:
python, sed
Dale Dougherty, sed & awk, O’Reilly and Associates, 1990.
A.V. Aho, Brian W. Kernighan, and Peter J. Weinberger, The AWK Programming
Language, Addison-Wesley, 1988.
We recommend you use qcc instead of invoking gcc directly. You can use the -V
option to qcc to invoke gcc. For example:
Syntax:
gcc_variant [ option | filename ]...
g++_variant [ option | filename ]...
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
The gcc_variant depends on the target platform, as follows:
Overall options
-c -S -E -o file -pipe -v -x language
C language options
-ansi -fallow-single-precision -fcond-mismatch
-fno-asm -fno-builtin -ffreestanding -fhosted
-fsigned-bitfields -fsigned-char
-funsigned-bitfields -funsigned-char
-fwritable-strings -traditional -traditional-cpp
-trigraphs
Warning options
-fsyntax-only -pedantic -pedantic-errors
-w -W -Wall -Waggregate-return
-Wbad-function-cast -Wcast-align -Wcast-qual
-Wchar-subscript -Wcomment -Wconversion -Werror
-Wformat -Wid-clash-len -Wimplicit -Wimplicit-int
-Wimplicit-function-declarations -Wimport -Winline
-Wlarger-than-len -Wmain -Wmissing-declarations
-Wmissing-prototypes -Wnested-externs
-Wno-import -Wold-style-cast -Woverloaded-virtual
-Wparentheses -Wpointer-arith -Wredundant-decls
-Wreorder -Wreturn-type -Wshadow -Wsign-compare
-Wstrict-prototypes -Wswitch -Wsynth
-Wtemplate-debugging -Wtraditional -Wtrigraphs
-Wundef -Wuninitialized -Wunused -Wwrite-strings
Debugging options
-a -ax -dletters -fpretend-float
-fprofile-arcs -ftest-coverage
-g -glevel -gcoff -gdwarf -gdwarf-1 -gdwarf-1+
-gdwarf-2 -ggdb -gstabs -gstabs+ -gxcoff -gxcoff+
-p -pg -print-file-name=library
-print-libgcc-file-name -print-prog-name=program
-print-search-dirs -save-temps
QNX extension:
-MAP
Optimization options
-fbranch-probabilities
-fcaller-saves -fcse-follow-jumps -fcse-skip-blocks
-fdelayed-branch -fexpensive-optimizations
-ffast-math -ffloat-store -fforce-addr -fforce-mem
-ffunction-sections -finline-functions
-fkeep-inline-functions -fno-default-inline
-fno-defer-pop -fno-function-cse
-fno-inline -fno-peephole -fomit-frame-pointer
-frerun-cse-after-loop -fschedule-insns
-fschedule-insns2 -fstrength-reduce -fthread-jumps
-funroll-all-loops -funroll-loops
-O -O0 -O1 -O2 -O3
Preprocessor options
-Aquestion(answer) -C -dD -dM -dN
-Dmacro[=defn] -E -H
-idirafter dir
-include file -imacros file
-iprefix file -iwithprefix dir
-iwithprefixbefore dir -isystem dir
-M -MD -MM -MMD -MG -nostdinc -P -trigraphs
-undef -Umacro -Wp,option
Assembler option
-Wa,option
Linker options
object-file-name -llibrary
-nostartfiles -nodefaultlibs -nostdlib
-s -static -shared -symbolic
-Wl,option -Xlinker option
-u symbol
Directory options
-Bprefix -Idir -I- -Ldir -specs=file
Target options
-b machine -V version
Machine-dependent options
PowerPC options:
-mcpu=cpu type
-mtune=cpu type
-mpower -mno-power -mpower2 -mno-power2
-mpowerpc -mno-powerpc
-mpowerpc-gpopt -mno-powerpc-gpopt
-mpowerpc-gfxopt -mno-powerpc-gfxopt
-mnew-mnemonics -mno-new-mnemonics
-mfull-toc -mminimal-toc -mno-fop-in-toc
-mno-sum-in-toc -mxl-call -mno-xl-call -mthreads
-mpe -msoft-float -mhard-float -mmultiple
MIPS options:
-mqnxpic
i386 options:
-mcpu=cpu type
-march=cpu type
-mieee-fp -mno-fancy-math-387
-mno-fp-ret-in-387 -msoft-float -msvr3-shlib
-mno-wide-multiply -mrtd -malign-double
-mreg-alloc=list -mregparm=num
-malign-jumps=num -malign-loops=num
-malign-functions=num
SH options:
Code-generation options
-fcall-saved-reg -fcall-used-reg
-ffixed-reg -finhibit-size-directive
-fcheck-memory-usage -fprefix-function-name
-fno-common -fno-ident -fno-gnu-linker
-fpcc-struct-return -freg-struct-return
-fshared-data -fpic -fPIC -fexceptions
-fshort-enums -fshort-double -fvolatile
-fvolatile-global -fverbose-asm -fpack-struct
-fstack-check +e0 +e1
• If you use exceptions, you must link with the -lang-c++ option to qcc. This
option is the default for QCC.
Even with exceptions disabled, the default new() operator throws a
std::out_of_memory exception if there isn’t enough memory. If you want new()
to return NULL instead of throwing an exception, overload the new() operator with
your own.
• On most platforms, the -fpic and -fPIC options are synonymous, but on PPC
they’re different and incompatible. We chose -fpic over -fPIC for performance
reasons, and our PPC OS is built that way.
If you see problems (such as relocation-truncation errors) at link time when you
build a shared object, consider splitting it into multiple shared objects.
-mno-fp-moves Prevent the code generator from using floating point registers to
move integers. Using floating point registers for this is very
slow on systems that use floating point emulation.
Description:
We recommend you use qcc or QCC instead of gcc to compile and link your programs.
For detailed documentation about gcc, see the GNU website at
http://www.gnu.org/.
If you have trouble using the default debug format (-gdwarf), switch to -gdwarf-2
or -gstabs.
Exit status:
0 Success.
Contributing author:
GNU
See also:
gcov, gdb, qcc
Syntax:
gcov_variant [options] sourcefile
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
The gcov_variant depends on the target platform, as follows:
-b or --branch-probabilities
Write branch frequencies to the output file and branch
summary info to standard output. This lets you see how often
each branch was taken.
-c or --branch-counts
Write branch frequencies as the number of branches taken
instead of the percentage of branches taken.
-f or --function-summaries
Output summaries for each function in addition to the file level
summary.
-l or --long-file-names
Create long file names for included source files.
For example, if x.h was included in a.c, then running
gcov -l on a.c will produce a.c##x.h.gcov instead of
x.h.gcov. This can be useful if x.h is included in multiple
source files.
-p or --preserve-paths
Preserve complete path information in the names of generated
.gcov files.
Without -p only the filename component is used. With -p, all
directories are used, with / characters translated to #
characters, . directory components removed and ..
components renamed to ˆ. This is useful if source files are in
several different directories.
The -p option also affects the -l option.
-v or --version Display the gcov version number on the standard output and
exit.
Description:
The gcov utility produces code coverage data for an application compiled with the
-Wc,-fprofile-argcs -Wc,-ftest-coverage options to qcc (or the
-fprofile-arcs -ftest-coverage options to gcc). This data is interpreted
visually for you by the Code Coverage perspective in the QNX Momentics IDE.
For detailed documentation about gcov, see the gcc documentation on the GNU
website at http://www.gnu.org/.
Exit status:
0 Success.
Contributing author:
GNU
See also:
gcc, qcc
Syntax:
gdb_variant [options] [executable] [ core_file | pid ]
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
The gdb_variant depends on the target platform, as follows:
-b bps Set the line speed (baud rate or bits per second) of any serial
interface used by gdb for remote debugging.
-batch Run in batch mode. Exit with status 0 after processing all the
command files specified with -x (and all commands from
initialization files, if not inhibited with -n). Exit with nonzero
status if an error occurs in executing the gdb commands in the
command files.
Batch mode may be useful for running gdb as a filter, for example
to download and run a program on another computer. To make this
more useful, the message:
Program exited normally.
-cd=directory Run gdb using directory as its working directory, instead of the
current directory.
-command=file Execute gdb commands from file. See “Command files” in the full
online GNU documentation.
-directory=directory
Add directory to the path to search for source files.
-exec=file Use file as the executable file to execute when appropriate, and for
examining pure data in conjunction with a core dump.
-fullname GNU Emacs sets this option when it runs gdb as a subprocess. It
tells gdb to output the full filename and line number in a standard,
recognizable fashion each time a stack frame is displayed (which
includes each time your program stops). This recognizable format
looks like two \032 characters, followed by the file name, line
number and character position separated by colons, and a newline.
The Emacs-to-gdb interface program uses the two \032
characters as a signal to display the source code for the frame.
-help Display all available options and briefly describe their use.
-interpreter=file
Select a specific interpreter or user interface.
This option depends on operating system facilities that aren’t supported on all
systems.
If memory-mapped files are available on your system through the
mmap() system call, you can use this option to have gdb write the
symbols from your program into a reusable file in the current
directory.
For example, if the program you’re debugging is called
/tmp/fred, the mapped symbol file is ./fred.syms. Future
gdb debugging sessions notice the presence of this file, and can
quickly map in symbol information from it, rather than read the
symbol table from the executable program.
The .syms file is specific to the host machine where gdb is run. It
holds an exact image of the internal gdb symbol table. It can’t be
shared across multiple host platforms.
-readnow Read each symbol file’s entire symbol table immediately, rather
than read it incrementally as needed. This makes startup slower,
but makes future operations faster.
The -mapped and -readnow options are typically combined in
order to build a .syms file that contains complete symbol
information. (For more information, see “Commands to specify
files” in the full online GNU documentation.)
Here’s how you can build a .syms file for future use:
-se=file Read the symbol table from file and use it as the executable file.
-tty=device Run using device for your program’s standard input and output.
Description:
Invoke the GNU Debugger by running gdb. Once started, gdb reads commands from
the terminal until you tell it to exit.
If you start gdb from the command line on a self-hosted QNX Neutrino system, gdb
sets the LD_BIND_NOW to 1 to force all binding to be done immediately instead of
lazily. For more information, see “Optimizing the runtime linker” in the Compiling
and Debugging chapter of the QNX Neutrino Programmer’s Guide.
You can abbreviate a gdb command to the first few letters of the command name, if
that abbreviation is unambiguous; and you can repeat certain gdb commands by
typing just Enter. You can also use the Tab key to get gdb to fill out the rest of a word
in a command (or to show you the alternatives available, if there’s more than one
possibility).
You can also run gdb with a variety of arguments and options, to specify more of your
debugging environment at the outset.
Unless you specify the -nx option, this utility runs commands in an initialization file
before running any command-line options. This file may be specific to the gdb_variant
invoked, for instance, if you invoke ntoppc-gdb, the utility runs the commands in the
${HOME}/.ntoppc-gdbinit file. If no such gdb_variant initialization file exists,
the utility runs commands found in the generic ${HOME}/.gdbinit file instead. If
you specify -command, file overrides these default files.
The command-line options described here are designed to cover a variety of situations;
in some environments, some of these options might not work.
You can start with both an executable program and a core file specified:
Contributing author:
GNU
See also:
Using GDB in the QNX Neutrino Programmer’s Guide
Syntax:
getconf system_var
getconf path_var pathname
Runs on:
Neutrino
Options:
None.
Description:
This utility gets system configuration values, including:
• configurable limits associated with a path, whose names start with _PC_
The names of these variables are in uppercase, but getconf and setconf let you use
any case, omit the leading underscore, or the entire prefix — provided that the rest of
the name is unambiguous.
The first form writes to standard output the value of the specified system variable. The
possible values of system_var are those for sysconf() and confstr() (see the Library
Reference):
_CS_ARCHITECTURE
The name of the instruction set architecture for this node’s
CPU(s).
A hostname can consist only of letters, numbers, and hyphens, and must not start or
end with a hyphen. For more information, see RFC 952.
_CS_HW_PROVIDER
The name of the hardware manufacturer.
_SC_AIO_PRIO_DELTA_MAX
The maximum amount by which a process can decrease its
asynchronous I/O priority level from its own scheduling
priority.
_SC_CLK_TCK The number of intervals per second used to express the value in
type clock_t.
_SC_DELAYTIMER_MAX
The maximum number of times a timer can overrun and you
can still detect it.
_SC_GETGR_R_SIZE_MAX
If defined (not -1), the maximum size of buffer that you need to
supply to getgrgid_r() for any memory that it needs to allocate.
_SC_GETPW_R_SIZE_MAX
If defined (not -1), the maximum size of buffer that you need to
supply to getpwent_r(), getpwuid_r(), getspent_r(), or
getspnam_r() for any memory that they need to allocate.
_SC_JOB_CONTROL
If this variable is defined, then job control is supported.
_SC_NGROUPS_MAX
The maximum number of simultaneous supplementary group
IDs per process.
_SC_OPEN_MAX Maximum number of files that one process can have open at
any given time.
_SC_PAGESIZE The default size of a thread’s guard area.
_SC_SAVED_IDS If this variable is defined, then each process has a saved
set-user ID and a saved set-group ID.
_SC_SEM_NSEMS_MAX
The maximum number of semaphores that one process can
have open at a time. The getconf utility reports a value of -1
to indicate that this limit is indeterminate because it applies to
both named and unnamed semaphores. The kernel allows an
arbitrary number of unnamed semaphores (they’re kernel
synchronization objects, so the number of them is limited only
by the amount of available kernel memory).
_SC_SIGQUEUE_MAX
The maximum number of outstanding realtime signals sent per
process.
_SC_THREAD_STACK_MIN
The minimum stack size for a thread.
_SC_TZNAME_MAX
The maximum length of the names for time zones.
_SC_VERSION The current POSIX version that is currently supported. A value
of 198808L indicates the August (08) 1988 standard, as
approved by the IEEE Standards Board.
The second form writes to standard output the value of the specified path variable for
the given path. The possible values of path_var are those for pathconf() (see the
Library Reference):
_PC_CHOWN_RESTRICTED
If defined (not -1), indicates that the use of the chown function
is restricted to a process with root privileges, and to changing
the group ID of a file to the effective group ID of the process or
to one of its supplementary group IDs.
_PC_LINK_DIR Defined (not -1) if the filesystem permits the unlinking of a
directory.
_PC_PRIO_IO Defined (not -1) if prioritized I/O is supported for the file.
_PC_SYNC_IO Defined (not -1) if synchronous I/O is supported for the file.
_PC_VDISABLE If defined (not -1), this is the character value which can be used
to individually disable special control characters in the
termios control structure.
Examples:
$ getconf _CS_PATH
/bin
$ getconf _SC_ARG_MAX
61440
$ getconf _PC_LINK_MAX /bin
65535
Environment variables:
LANG The locale to use for the locale categories.
Exit status:
0 Successful completion.
1 An error occurred.
See also:
setconf
confstr(), pathconf(), sysconf() in the Library Reference
“Configuration strings” in the Configuring Your Environment chapter of the Neutrino
User’s Guide
Syntax:
getty
Runs on:
QNX Neutrino
Options:
None.
Description:
The getty utility sets the terminal mode.
Files:
/etc/config/gettytab, /etc/config/gettytab.${HOSTNAME}
Terminal configuration database.
See also:
tinit
Syntax:
gf-calib [options]
Runs on:
Neutrino
Options:
-3 Use the 3-point calibration method. This is the default method.
-g input_group Specify the GFI input group to attach to. The input group is
created and enumerated by a devi-* driver configured to export
input groups. The default input group is 1.
-l idx (“el”) The layer index. The default is the main layer.
-O Set the touch matrix’s origin to the lower right corner. Used by
the 3-point method only.
-t n Set the new bullseye target size, in pixels. The default is 47;
suggested values are between 30 and 100.
-v Be verbose.
Description:
The gf-calib utility is used to calibrate a touchscreen on a GF-embedded device.
Once the touchscreen is successfully configured it must be calibrated. The calib
utility saves a configuration file at /etc/system/config/calib.$(hostname).
You can use the -f option to specify a different configuration file. For information
about this file format, see the “Calibration file format” section of the “Writing an Input
Device Driver” chapter of the Input DDK documentation.
To invoke the calibration screen:
2 Start devi-* with the appropriate command-line options for the touchscreen
device.
3 Run gf-calib.
See also:
calib
Syntax:
gns [-cv] [nodename ...]
gns [-sv] [nodename]
Runs on:
Neutrino
Options:
-c Run in client mode. This is the default.
-v Be verbose.
Description:
The global name service (gns) manager is a standalone resource manager. With the
help of gns, an application could advertise, look up, and use (connect to) a service
across network, without knowing the detail of where the service is, or who is the
provider.
GNS runs in two different modes: server and client. A server-mode manager is a
central database that stores advertised services, and handles lookup and connect
requests. A client-mode manager relays advertise, lookup, and connect requests
between a local application and the gns server.
Although we have used the name_* API for the implementation of GNS, there is
slight behavior change with respect to the previous implementation of the Neutrino
realtime operating system.
Before, when an application called name_open() to connect to a service, the server
was not aware of that. This has been changed now —an _IO_CONNECT/_IO_OPEN
message is sent to the server.
The server application has to be modified to handle a possible _IO_CONNECT
message coming in. For an example, see the documentation for name_attach() in the
Neutrino Library Reference.
Path namespace
A service is represented by a path namespace (without a leading “/”) and is registered
under /dev/name/global or /dev/name/local, depending on how it attaches
itself.
Every machine running a gns client or server on the same network has the same view
of the /dev/name/global namespace. Each machine also has a /dev/name/local
namespace that’s local to each machine, and therefore, is different.
For details, see the Examples section.
• If a service provider exists in the same machine as the application that requested
the service, the gns manager tries to connect to the local service provider first. If
the connection succeeds, the application communicates with its service provider
locally, to gain better performance.
• If there’s no local service provider, or, for some reason, the local service provider
refuses to provide the service, the gns manager tries to connect to other providers.
If there are multiple remote service providers, the order of trying them (i.e. who
gets the connection first) isn’t defined.
You can set some clients to connect to server1, and some clients to server2. This
creates separate “service domains,” where clients connected to server1 (in “service
domain1”) can’t use services registered on server2 (in “service domain2”).
On some clients:
# gns -c server1
On others:
# gns -c server2
Since the GNS server is a central database, the loss of redundant GNS servers could
mean the interruption of service (advertise, lookup, use) across the network. To solve
this problem, you can start multiple GNS servers and point clients to all of them.
On server1:
# gns -s
On server2:
# gns -s
On all clients:
In this case, every time an application tries to register a global service, the registration
is sent to both server1 and server2. Every time an application tries to connect to a
global service, the request is attempted on both server1 and server2.
The GNS on server1 doesn’t communicate with the GNS on server2. This means
that if an application on server1 wants to register a global service on client nodes,
the gns process on server1 can’t forward the request to server2, because a gns
process can’t act as a client and server at the same time. This however, doesn’t affect
the applications that try to connect to that service because both servers are attempted.
Auto-scanning client
Each GNS manager is registered under /dev/name/gns_server or
/dev/name/gns_client. If you start a GNS client without specifically assigning a
target server, it performs an auto-scan to find the GNS server(s) on the local network.
On a client:
# gns -c
An auto-scan isn’t guaranteed to find a server. This is because the Qnet network isn’t
guaranteed to have all local machines under /net.
The benefit of an auto-scan client lies in the event of losing the connection to a server.
The client will rescan to find another server when this happens. This makes it easy to
start another GNS server, synchronize it with the first one (we’ll discuss synchronizing
later), and then kill the first GNS server.
If a client starts specifying specific GNS server(s) on the command line, it won’t
perform an auto-scan. If it loses the connection to its server, it tries to reestablish the
connection every time a registration, lookup, or connect request is made.
# gns -s
# gns -s node1
The GNS manager on node2 synchronizes with the GNS manager on node1, gets all
the global service information from node1, and stores it locally.
All GNS clients that are already connected to the GNS server on node1 are notified
about the new server on node2, and they connect to it. These clients then have
multiple servers, as if they had been started as follows:
# gns -s
On other clients:
When a service provider registers its global service name from a client node (not
running gns -c), the information is directly sent to the GNS manager on server.
Subsequently, if a service consumer tries to look up the service name, the lookup
message is sent to the GNS manager on server, which then returns the service provider
information.
If a service provider registers a local service name, it simply registers itself in the local
path manager. The local path manager serves a service consumer when it starts to look
up the local service.
You must take note of the differences of running the GNS manager in client mode
rather than using the prefixes described above. A client-mode GNS manager running
locally may cache some service provider information, such that every lookup does not
need to go to the GNS manager on the server. This ensures that a lookup usually
succeeds even if there is a period of lost connection with the GNS manager.
Also, if the path namespace is prefixed, the client can’t look at the /dev/name/net
directory to tell which node provides which services. This information is, however, not
important in normal advertise/lookup operations.
Special pathname
All GNS managers are registered as /dev/name/gns_server or
/dev/name/gns_client. This pathname can provide some statistical information
about the GNS manager. For example:
$ cat /dev/name/gns_client
Global Name Service Mode: Client
Server: xtang (connected)
Registered services:
net/netsrv.ott.qnx.com/0,1818649,1,0,-1 (No Expiration)
network/tcpip/51,20533309,1,0,12 (Fri Feb 7 13:57:39 2003)
printer/ps/techpub/0,1826845,1,0,12 (No Expiration)
From the above, we infer that the gns process is a client, it has only one server (the
machine named xtang), and it’s already connected to the server. This also lists all the
services known to the GNS manager. Note that the network/tcpip service has an
expiration time, suggesting that this is a cached entry resulting from querying the gns
server.
Examples:
A typical network with gns looks like this:
Server node:
# gns -s
Client(s) node:
$ ls -l /dev/name/global/
total 2
dr-xr-xr-x 0 root techies 1 Feb 06 16:20 net
dr-xr-xr-x 0 root techies 1 Feb 06 16:21 printer
$ ls -l /dev/name/global/printer/ps
total 1
dr-xr-xr-x 0 root techies 1 Feb 06 16:21 techpub
Multiple application servers on different machines can attach to the same service.
Therefore one pathname could represent multiple servers. In order to show that, the
GNS manager automatically creates a name in the format nd pid chid handle file_type
under the registered pathname, as follows:
$ ls /dev/name/global/printer/ps/techpub
0,16834613,1,0,12
8,1826845,1,0,12
From the above, you conclude that there are two applications attached to the
printer/ps/techpub service.
Sometimes, you may wish determine what service machine netsrv.ott.qnx.com
provides. To find that out, you can look into
/dev/name/global/net/netsrv.ott.qnx.com — it shows the services attached
by a process on netsrv.ott.qnx.com:
$ ls /dev/name/global/net/netsrv.ott.qnx.com/printer/ps/techpub
0,1826845,1,0,12
From the above, you conclude that a process on machine xtang.ott.qnx.com with
process ID 16834613 has registered the printer/ps/techpubservice; meanwhile,
process 1826845 on machine netsrv.ott.qnx.com also registered the same
service.
See also:
name_attach(), name_close(), name_open(), name_detach() in the Library Reference.
“Locating services using GNS” in the Transparent Distributed Processing Using Qnet
chapter of the Programmer’s Guide.
Syntax:
gprof_variant options [executable [data-files...]] [> outfile]
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
The gprof_variant depends on the target platform, as follows:
Description:
The gprof utility produces code-profiling data for an application compiled with the
-p option to qcc (or the -pg option to gcc). This data is interpreted visually for you
by the Application Profiler perspective in the QNX Momentics IDE.
For detailed documentation about gprof, see the the GNU website at
http://www.gnu.org/.
Exit status:
0 Success.
Contributing author:
GNU
See also:
gcc, qcc
Syntax:
grep [-E|-F] [-chilnqsvx]
[-e expression | -f expression_file]...
[file...]
grep [-E|-F] [-chilnqsvx] expression [file...]
Historical UNIX versions:
egrep [-cilnqsvx]
[-e expression | -f expression_file]...
[file...]
egrep [-cilnqsvx] expression [file...]
fgrep [-cilnqsvx]
[-e expression | -f expression_file]...
[file...]
fgrep [-cilnqsvx] expression [file...]
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
-c Write only a count of selected lines to standard output.
-n Before each output line, display the line’s line number in the
file.
-v Select only those lines that don’t match the specified patterns.
Description:
The grep utility searches input for lines matching the expression(s) given. When an
input line matches any of the expressions, it is said to be “selected.” By default,
selected lines are written to standard output.
Numerous options allow variations upon the output format. For example, to reverse
the meaning of the output, the -v option could be used.
There are three types of regular expressions understood by grep: basic, extended, and
fixed. If you don’t specify -E or -F, the expression(s) are taken to be basic regular
expressions.
Basic and extended regular expressions are similar to arithmetic expressions in that
larger expressions are formed by combining smaller expressions and operators
according to some precedence rule.
Regular expressions have an “invisible” operator, i.e. concatenation. The
concatenation of two expressions means match the one on the left, then the one on the
right.
The smallest expression is a single character.
Expression Meaning
\( expression \) Subexpression. Match the pattern expression. Used
for back references (see below), and precedence
\N Back-reference. Match the exact string that the Nth
subexpression did
. (Dot) match any single character
[charset] Match any member of the set charset (see below)
c Match any nonspecial character
\c Match literal c. The character may not be (, ), {,
}, or any digit from 1 through 9. The \ is usually
used to escape *, $, ˆ, ., [ and ]. \\ matches a
literal “\”. \ has no special meaning inside a
bracket expression.
limited_expression* Match any number of repetitions of
limited_expression including zero.
limited_expression\{M \} Match exactly M repetitions of limited_expression
limited_expression\{,N \} Match zero to N repetitions of limited_expression
limited_expression\{M ,N \} Match M to N repetitions of limited_expression
expr0expr1 (Concatenation) match expr0 then expr1
ˆexpression Match expression only at beginning of line
expression$ Match expression only at end of line
Expression Meaning
c Any character c
c-d Any character in the range from c to d
[:alpha:] Any alphabetic character
[:upper:] Any uppercase character
[:lower:] Any lowercase character
[:digit:] Any numeric character
continued. . .
Expression Meaning
[:alnum:] Any numeric or alphabetic character
[:xdigit:] Any character used to represent a hexadecimal number
[:space:] Any character that is a whitespace
[:print:] Any printable character
[:punct:] Any character that is punctuation
[:graph:] Any character with a graphic representation
[:cntrl:] Any character used for control
If the charset begins with the caret (ˆ), the set is inverted. For example:
[ˆ[:alpha:]]
Expression Meaning
(expression) Match expression; useful for altering precedence
. (Dot) match any single character
c Match any nonspecial character c
\c Match literal c. Normally used to escape ERE
special characters.
[charset] Match any element of charset
limited_expression* Match any number of repetitions of
limited_expression, including zero
limited_expression+ Match 1 to any number of repetitions of
limited_expression
continued. . .
Expression Meaning
limited_expression? limited_expression is optional (match 0 or 1
repetition)
limited_expression\{M \} Match exactly M repetitions of limited_expression
limited_expression\{,N \} Match zero to N repetitions of limited_expression
limited_expression\{M ,N \} Match M to N repetitions of limited_expression
expr0expr1 (Concatenation) match expr0 then expr1
expr0|expr1 (Alternation) match expr0 or expr1 (not both)
ˆexpression Match expression only at the beginning of a line
expression$ Match expression only at the end of a line
Examples:
Display lines in Phone.List containing telephone numbers:
Display all occurrences of the words “steve” and “barney” in the Phone.List file:
Exit status:
0 Lines were found matching the expression provided.
See also:
flex, gawk, sed
Syntax:
gunzip [-cfhLlNnqrtvV] [name...]
Runs on:
QNX Neutrino, Microsoft Windows
Options:
See gzip for a complete listing.
Description:
The gunzip utility uncompresses files that have been compressed with gzip. It’s
equivalent to gzip -d. See gzip for more details.
This utility is subject to the GNU Public License (GPL). We’ve included it for use on
development systems.
Contributing author:
GNU
See also:
freeze, gzip, pax
Backing Up and Recovering Data in the Neutrino User’s Guide
Syntax:
Compress/uncompress files:
Runs on:
QNX Neutrino, Microsoft Windows
Options:
-c Write output on standard output; keep original files unchanged. If there
are several input files, the output consists of a sequence of independently
compressed members. To obtain better compression, concatenate all
input files before compressing them.
-d Decompress.
You need to use the -f option when compressing or expanding files in a RAM
(/dev/shmem) filesystem.
Description:
The gzip utility reduces the size of the named files, using Lempel-Ziv coding (LZ77).
Whenever possible, each file is replaced by one with the extension .gz, while keeping
the same ownership modes, access and modification times. (The extension is -z for
VMS, z for MSDOS, OS/2 and Atari.) If no files are specified, the standard input is
compressed to the standard output. If the new file name is too long, gzip truncates it
and keeps the original file name in the compressed file. The gzip utility attempts to
compress only regular files. In particular, it ignores symbolic links.
You can use gzip -d, gunzip, or zcat to restore compressed files to their original
form.
These utilities are subject to the GNU Public License (GPL). We’ve included them for
use on development systems.
The gunzip utility takes a list of files on its command line and replaces each file
whose name ends with .gz or .GZ or -z and which begins with the correct magic
number with an uncompressed file without the original extension. This utility also
recognizes the special extensions .tgz and .taz as shorthands for .tar.gz or
.tar.GZ.
The gunzip utility can currently decompress files created by gzip, zip, compress
or pack. The detection of the input format is automatic. When using the first two
formats, gunzip checks a 32-bit CRC. For pack, gunzip checks the uncompressed
length. The compress format wasn’t designed to allow consistency checks. However
gunzip is sometimes able to detect a bad .GZ file. If you get an error when
uncompressing a .GZ file, don’t assume that the .GZ file is correct just because the
standard uncompress doesn’t complain. This generally means that the standard
uncompress doesn’t check its input, and happily generates garbage output.
You can use gzip to uncompress files created by zip only if they have a single
member compressed with the “deflation” method. This feature is intended only to help
conversion of tar.zip files to the tar.gz format. To extract zip files with several
members, obtain and use unzip instead of gunzip. (Note that unzip isn’t shipped as
part of QNX Neutrino.)
The zcat utility is identical to gunzip -c. (On some systems, zcat may be
installed as gzcat to preserve the original link to compress.) The zcat utility
uncompresses either a list of files on the command line or its standard input and writes
the uncompressed data on standard output. It uncompresses files that have the correct
magic number whether they have a .gz suffix or not.
The gzip utility uses the Lempel-Ziv algorithm used in zip and PKZIP. The amount
of compression obtained depends on the size of the input and the distribution of
common substrings. Typically, text such as source code or English is reduced by
60-70%. Compression is generally much better than that achieved by LZW (as used in
compress), Huffman coding (as used in pack), or adaptive Huffman coding
(compact).
Compression is always performed, even if the compressed file is slightly larger than
the original. The worst case expansion is a few bytes for the gzip file header, plus 5
bytes every 32K block, or an expansion ratio of 0.015% for large files. The gzip
utility preserves the mode, ownership and timestamps of files when compressing or
decompressing.
You can concatenate multiple compressed files. In this case, gunzip extracts all
members at once. For example:
gunzip -c foo
is equivalent to:
Environment variables:
GZIP A set of default options for gzip. These options are interpreted first and
can be overwritten by explicit command line parameters. For example:
Exit status:
2 The operation succeeded but perhaps not 100%; a warning was generated in the
process.
Contributing author:
GNU
Caveats:
The .gz extension is already also used by UNIX pack. You can link gzip to pcat to
get transparent decompression for programs expecting .gz files to be in pack format.
See also:
bzip2, freeze, pax, tar
Backing Up and Recovering Data in the Neutrino User’s Guide
Syntax:
ham [options]
Runs on:
Neutrino
Options:
-? Display the usage message.
Description:
The ham utility is the high-availability manager, which you can use to monitor and
restart critical processes in your system. When a HAM starts, it also starts the
Guardian process for itself.
To stop the HAM, you must use either the ham_stop() function (see the High
Availability Framework Developer’s Guide) or the hamctrl utility. These are the only
correct (and the only guaranteed) ways to stop the HAM.
See also:
hamctrl
High Availability Framework Developer’s Guide
Syntax:
hamctrl [options]
Runs on:
Neutrino
Options:
-node node_name
Control the high-availability manager (HAM) on the specifed node.
Description:
You can use the hamctrl utility to control or stop a high-availability manager, ham.
See also:
ham
High Availability Framework Developer’s Guide
Syntax:
hd [-8] [-A format] [-n count] [-s skip]
[-t format[fmt_string]] [-v] [file...]
Runs on:
QNX Neutrino, Microsoft Windows
Options:
-8 Use 8-bit ASCII characters (default 7).
-A format Display the file offset field in the specified format. Valid formats are:
• d — decimal, 9 digits
• n — none (omit this field)
• o — octal, 10 digits
• x — hexadecimal, 7 digits.
-n count Display only count bytes of input. You can add a trailing character to
specify units of blocks (b), kilobytes (k), or megabytes (m).
-s skip Ignore the first skip bytes of data. You can add a trailing character to
specify units of blocks (b), kilobytes (k), or megabytes (m).
-t format[fmt_string]
Use this output/display format; see “Output formats,” below.
The default format is x1.
file The pathname of an input file. If you don’t specify any files, hd reads
from standard input. If a file is a hyphen (-), hd reads from the standard
input at that point in the sequence.
Description:
The hd utility displays data in decimal, hex, octal, or ASCII. The name “hd” (hex
dump) is derived from the default output format.
The hd utility processes input in 16-byte units that are formatted into a line. In the
default output format:
For example:
$ echo "abcdefghijklmnopqrstuvwxyz01234" | hd
0000000: 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 abcdefghijklmnop
0000010: 71 72 73 74 75 76 77 78 79 7a 30 31 32 33 34 0a qrstuvwxyz01234.
To exclude part of the input, use the -n and -s options. You can specify the arguments
to these options in hex (using a 0x prefix) or octal (using a 0 prefix). The default units
for these options are bytes, but you can specify different units as follows:
Output formats
To specify the output format, use the -t option. The format argument — which you
can specify in decimal, hex, or octal — tells hd which format to use for presenting the
output:
d[1|2|4|C|S|I|L]
Decimal, in objects the size of an int by default.
f[4|8|F|D|L] Floating point, in objects the size of an float by default.
o[1|2|4|C|S|I|L]
Octal, in objects the size of an int by default.
u[1|2|4|C|S|I|L]
Unsigned decimal, in objects the size of an int by default.
x[1|2|4|C|S|I|L]
Hexadecimal, in objects the size of an int by default.
The input, processed in 16-byte units formatted into a line, is displayed according to
the size you choose:
Examples:
Display the second to eleventh sectors of the hard disk, /dev/hd0:
hd -s 1b -n 10b /dev/hd0
Exit status:
0 All input files were processed successfully.
See also:
od
Syntax:
head [-l] [-number] [-c number] [-n number] [file]...
Runs on:
Neutrino
Options:
-number Deprecated; use -n number instead.
-l (“el”) Measure the quantity of output in lines; this is the default unit of
measure.
file The pathname of an input file. If you don’t specify any files, the
standard input is used.
Description:
The head utility copies its input files to the standard output. The utility ends the
output for each file at a point designated by the -c or -n option. If you don’t specify
either of these options, head copies the first ten lines of the file.
If you specify multiple -c, -l, and -n options, the last one takes precedence.
If you specify multiple files, head prints an identifying header before the output for
each file.
Examples:
Display the first ten lines of all files in the current directory:
head *
head -c 16 myfile | hd
(Note that in this case, the same functionality is offered through command-line options
to hd.)
Exit status:
0 Successful completion.
See also:
cat, less, more, tail
Syntax:
helpviewer [-b color] [-f color] [-F start_page]
[-h height[%]] [-l color] [-m] [-o]
[-r topic.toc] [-S i|m|n] [-s server]
[-t topic_dir] [-u home_page]
[-w width[%]] [-x position[%][r]]
[-y position[%][r]] [url]
Runs on:
Neutrino
Options:
-b color Set background color to the hex RBG value.
-o Keep the topics in the same order as the TOC file (default is to
sort the top two levels of topics).
-r topic.toc Display only the specified topics from the topic root. You can
specify more than one -r option.
-u home_page Set the home page. This is the page helpviewer displays when
you click the Home button, or select File→Home.
Description:
The helpviewer application displays online help, with several navigational aids
including contents, text search, history, and bookmarks.
The helpviewer supports online help documents written in HTML. However, the
helpviewer can access only local files and therefore can’t be used as an Internet Web
browser. It also supports GIF, JPEG, and BMP image formats.
You can specify which HTML file to open using either URLs or topic paths:
• The URL specifies the filesystem path where the help text is located on the local
network. Here’s an example of a URL:
$QNX_TARGET/usr/help/product/neutrino/user_guide/examples.html
URLs are case-sensitive. These URLs are restricted in scope to the local help files;
they can’t be used to access the Web.
The helpviewer loads the table of contents either from a single topic file (with a
.toc extension) or from a directory. By default the topic files are loaded from the
$QNX_TARGET/usr/help/product directory. The format of topic files is described
in “Creating topic files” below.
• If you aren’t using ksh or sh as your login shell, the environment variables that the
helpviewer uses aren’t initialized. To fix this, set QNX_HELP_HOME_PAGE
to
/usr/qnx650/target/qnx6/usr/help/product/momentics/bookset.html,
and QNX_HELP_PATH to
/usr/qnx650/target/qnx6/usr/help/product (assuming you installed
QNX SDP in the default location).
• The helpviewer might not display all the images in a document. If this happens,
click the Options button, click the Others tab, and then increase the size of the
image cache.
You should take care not to include features above HTML level 3.2 in your help files
(they might cause helpviewer to crash).
Supported elements
The following table shows the HTML elements and attributes supported by the
helpviewer:
continued. . .
continued. . .
Supported entities
The Helpviewer also supports the standard HTML1/ISO entities for characters, plus:
Don’t use the vertical bar (|) in topic titles, because it’s used as a delimiter in the TOC
files.
Usually there’s an entry in the topic file corresponding to each HTML heading level in
your help files. The topic title doesn’t have to be identical to the title in your help file.
Each topic can refer to an HTML file or a topic file. If the topic refers to an HTML
file, that file is displayed when the topic is selected. If the topic refers to a topic file,
helpviewer reads the subtopics from that file and displays them, but no HTML is
displayed.
If the HTML file is in a subdirectory of the parent topic, helpviewer scans the
directory for topic files (this happens up to topic level 4 only). You don’t have to
specify the topic file explicitly in this case.
You can increase the performance of the helpviewer by creating toc_index files in
directories that contain several TOC files. A toc_index simply lists the TOC files in
that directory, and is created by typing
ls *.toc > toc_index.
The helpviewer assumes that your help is maintained in a three-level directory
hierarchy. The levels and the types of files that should be kept at each level are listed
below.
Level 1
• a folder and top level TOC for the IDE help, ide_en and ide_en.toc.
• The TOC has a single level-1 entry pointing to the top level HTML file for the
bookset, com.qnx.doc.ide.userguide/topic/coverpage.html.
Level 2
• user_guide.toc—a TOC file with a single level-2 entry pointing to the top level
HTML file for the book, user_guide/about.html.
Level 3
• about.html—an HTML file that contains all the content for the book
• book.toc—a TOC file that contains all the help topic entries for the table of
contents.
Your help must use the same three-level hierarchy, even if there is only one book. The
helpviewer uses a combination of the topic level in the TOC file and the directory level
of the TOC file to nest topics in the contents pane.
An example
photon_2.0_en.toc
photon_2.0_en/
The photon_2.0_en directory contains a TOC file and a directory for each book. For
example, for the Programmer’s Guide, the directory includes:
prog_guide.toc
prog_guide/
2|Programmer’s Guide|./prog_guide/about.html
The prog_guide directory contains the HTML files, and a book.toc file that
identifies the topic titles in the HTML files:
If the .toc files contain non-ASCII characters, they must be in multibyte format to be
displayed correctly in the Contents pane.
The Photon ped editor allows the entry of UTF-8 characters. For more information,
see the ped man page.
You can either include your table of contents in the default table of contents (along
with our online documentation) or keep it separate and specify where helpviewer
can find the table of contents.
Including your help in the default help
To include your help in the default table of contents, you must create a top-level topic
file and include it in the root help directory (/usr/help/product). The
helpviewer reads all topic files from the root directory and sorts the topics
alphabetically.
Keeping your help separate
Similarly, to start the helpviewer with your own table of contents and help files,
change the default help file directory using the -t option, like this:
helpviewer -t /home/user/mytopics
The helpviewer application displays your table of contents and home page only.
You won’t be able to access the default table of contents.
Searching
You can search the documentation by entering keywords in the Find field and then
pressing the Go! button. The following characters are considered to be separators:
,.:&()[]/\"#{};?-+=!\n space
Using the above characters, the helpviewer splits your input into keywords. It then
searches its database for each keyword and keeps only the results that include all the
keywords. If you haven’t checked Match Whole Words, the search is a partial match
search for each of the keywords. For example, “Toggle” will match “PtToggle”. Check
Case sensitive to match the case of the keywords.
You can use a space as an AND operator. For example, if you search for Photon
coordinate space in the document text, the helpviewer finds all the documents
that contain the words Photon, coordinate, and space. It doesn’t necessarily mean
that the listed documents include the full string Photon coordinate space.
Files:
$QNX_TARGET/usr/help/product
Default topic directory.
˜/.ph/phelp/options
Configuration file.
˜/.ph/phelp/bookmarks
Your bookmarks.
˜/.ph/phelp/history
A list of the documents you’ve viewed.
Environment variables:
QNX_HELP_PATH
Sets the default help file directory. This has the same meaning as the -t
command line option.
QNX_HELP_HOME_PAGE
Set the default help home page. This has the same meaning as the -u command
line option.
These environment variables are set by default by the sh and ksh shells, and are
specified in /etc/profile.d/qnxsdk.sh. If you use a different shell (such as esh
or bsh), you need to explicitly set these environment variables or helpviewer will
not display the default QNX help.
See also:
“Getting help with the Helpviewer” in the Using the Photon microGUI chapter of the
Neutrino User’s Guide
• You must start io-hid before you use the hidview utility.
Syntax:
hidview [-a] [-d devno] [-N name] [-r] [-R]
Runs on:
Neutrino
Options:
-a Display raw data coming from devices.
Description:
The hidview utility displays information about human-interface devices (HID).
Examples:
Here’s a sample of output from a hidview command:
Device Address : 0
Vendor : 0x05c7 (QTRONIX)
Product : 0x2011 (USB Keyboard and Mouse)
Version : r1.00
Usage : Keyboard
Device Address : 1
Vendor : 0x05c7 (QTRONIX)
Product : 0x2011 (USB Keyboard and Mouse)
Version : r1.00
Usage : Mouse
See also:
devh-usb.so, devh-ps2ser.so, devh-*, io-hid
Syntax:
hogs [options] [pids ...]
Runs on:
Neutrino
Options:
-n Show the names of processes (hogs always displays the process IDs).
-p priority Run hogs at the given priority (default: the same as the parent
process).
-% num Show only processes that consume this percentage or more CPU. You
can use this option to reduce the amount of output.
Description:
The hogs utility displays a list of processes in descending order by percentage of CPU
usage (i.e. it shows who’s hogging the processor). It loops forever, sleeping between
updates.
The format of the output is tabular, and includes:
NAME The name of the process (included only if you specify the -n option).
MSEC The number of milliseconds for which this process has been running
since the last iteration.
PIDS The amount of time that the process ran in this iteration, as a percentage
of the times of all the other processes running.
SYSTEM The amount of time that the process ran in this iteration, as a percentage
of the iteration time.
• The SYSTEM column is incorrect on multicore systems; the numbers in this column
will add up to (roughly) the number of processors times 100%. Use the top utility
instead.
• The numbers from hogs are approximate. For more precise data, use
tracelogger and the System Analysis Toolkit (see the SAT User’s Guide).
Examples:
Display the processes that are using 10% or more of the CPU. Include the name of the
processes:
$ hogs -n -% 10
PID NAME MSEC PIDS SYSTEM
1 2023 78% 67%
8200 devb-eide 384 14% 12%
See also:
pidin, ps, top, tracelogger
System Analysis Toolkit User’s Guide
Fine-Tuning Your System in the Neutrino User’s Guide
Syntax:
host [-aCdlnrsTwv] [-c class] [-N ndots] [-R number]
[-t type] [-W wait] [-m flag] [-4] [-6] {name}
[server]
Runs on:
Neutrino
Options:
See http://netbsd.gw.com/cgi-bin/man-cgi?host++NetBSD-5.0 in the
NetBSD documentation.
Description:
The host utility is for performing DNS lookups. You normally use it to convert
names to IP addresses and vice versa. For more information, see
http://netbsd.gw.com/cgi-bin/man-cgi?host++NetBSD-5.0 in the
NetBSD documentation.
See also:
dig, named in the NetBSD documentation
Syntax:
hostapd [-BdhKtv] config-file ...
Runs on:
Neutrino
Options:
-B Detach from the controlling terminal and run as a daemon process in
the background.
config-file Use the settings in the specified configuration file; the name of the
specified wireless interface is contained in this file. See
hostapd.conf in the NetBSD documentation for a description of the
configuration file syntax.
Description:
The hostapd utility is an authenticator for IEEE 802.11 networks. It provides full
support for WPA/IEEE 802.11i and can also act as an IEEE 802.1X Authenticator
with a suitable backend Authentication Server (typically FreeRADIUS). The hostapd
utility implements the authentication protocols that piggyback on top of the normal
IEEE 802.11 protocol mechanisms.
To use hostapd as an authenticator, the underlying device must support some basic
functionality, such as the ability to set security information in the 802.11 management
frames. Beware that not all devices have this support.
The hostapd utility is designed to be a daemon program that runs in the background
and acts as the backend component controlling the wireless connection. It supports
separate front-end programs such as the text-based front-end, hostapd_cli.
You can reload changes to the configuration file by sending a SIGHUP signal to the
hostapd processor, or by using the hostapd_cli reconfigure command.
See also:
ifconfig
hostapd.conf, hostapd_cli, in the NetBSD documentation at
http://www.netbsd.org/docs/
Syntax:
hostname [-s] [name_of_host]
Runs on:
QNX Neutrino, Microsoft Windows
Options:
-s Trim off any domain information from the printed name.
Description:
When the system starts, it initializes the hostname. As superuser, you can use the
hostname utility to change the hostname.
Without a name_of_host argument, hostname prints the name of the current host.
This utility sets or gets the value of the _CS_HOSTNAME configuration string, not that
of the HOSTNAME environment variable.
See also:
gethostname() in the Library Reference
Name:
/etc/hosts
Description:
The /etc/hosts file contains information regarding the known hosts on the network.
For each host, a single line should be present with the following information:
Items are separated by any number of spaces or tabs, or both; however, spaces or tabs
aren’t allowed before the IP address. A # indicates the beginning of a comment — any
characters after a #, up to the end of the line, aren’t interpreted by routines that search
the file.
If you’re using a name server, this file provides a backup when the server isn’t
running. In this case, you should include only a few addresses in this file. These
include addresses for the local interfaces that ifconfig needs at boot time and a few
machines on the local network.
Network addresses are specified in the conventional “.” (dot) notation using the
inet_addr() routine from the internet address manipulation functions. Hostnames may
contain any printable character other than a field delimiter, newline, or comment
character.
See also:
ifconfig
gethostname() in the Library Reference
DNS and BIND by Paul Albitz and Cricket Liu, O’Reilly & Associates (ISBN
1-56592-010-4)
Name:
/etc/hosts.equiv
Description:
The /etc/hosts.equiv and ˜/.rhosts files provide the “remote authentication”
database for the lpd, rcp, rlogin, and rsh commands and the rcmd() function.
These files bypass the standard password-based user authentication mechanism. They
specify remote hosts and users that are considered trusted (i.e. are allowed to access
the local system without supplying a password):
The file permissions for the ˜/.rhosts file must be as follows or its contents will be
ignored:
The ruserok() function sets the effective userid to that of the remote user, but doesn’t
change the effective group ID. The user must have search permissions for the
directories contained in the pathname of an .rhosts file (i.e. if the file resides in
/home/user/.rhosts, the user must have search permissions for /home/user/).
The library routine ruserok() (see also rcmd()) performs the remote authentication. It
determines whether a particular remote user from a particular remote host is allowed
to access the local system as a (possibly different) particular local user:
• For non-root users, this routine checks /etc/hosts.equiv, and then the
.rhosts file in the home directory of the local user attempting access.
• For root, access is handled as a special case to help maintain system security; only
root’s .rhosts file is checked.
The rlogind daemon doesn’t allow root to log in without a password. When rsh is
specified without command options, rlogind (not rshd) is invoked on the remote
side.
If the remote authentication fails, lpd, rcp and rsh fail, but rlogin falls back to the
standard password-based login procedure.
Both files are formatted as a list of one-line entries of the form:
hostname [username]
where hostname must be the fully qualified domain name (FQDN) of the host, not one
of its aliases.
The entries in these files are either positive, to explicitly allow access without a
password, or negative, to deny it. Authentication succeeds as soon as a matching
positive entry is found, but fails when a matching negative entry is found, or if no
matching entries are found in either file. Therefore, the order of entries is important: if
the files contain both matching positive and negative entries, the entry that appears
first prevails.
Positive entries
Positive entries take these forms:
hostname All users from the named host are trusted and may access the system
with the same user name as they have on the remote system. You can
use this form in both /etc/hosts.equiv and individual users’
.rhosts files.
hostname username
The meaning of this form depends on which file it’s in:
• .rhosts file in a local user’s home directory — the named user
from the named host can access the system as that local user.
• /etc/hosts.equiv — the named remote user can access the
system as any local user.
You can use the special character “+” as a wild card in place of either hostname or
username to match any host or user:
+ Any user from any remote host can access the system, with the same
username.
+ username The named user from any remote host can access the system.
hostname + Any user from the named host can access the system as the local user.
Negative entries
Negative entries have a “-” character preceding either the hostname or username field.
For example:
hostname -username
Deny access to the named user if they attempt to access your system from the
named host without providing a password.
Caveats:
Use extreme caution in /etc/hosts.equiv with positive entries that include a
username field (either an individual named user, a netgroup, or “+” sign). Because
/etc/hosts.equiv applies system-wide, these entries allow one or a group of
remote users to access the system as any local user without providing a password. This
can be a security hole.
The file permissions for the ˜/.rhosts file must be as follows or its contents will be
ignored:
See also:
/etc/hosts, lpd, rcp, ˜/.rhosts, rlogin, rlogind, rsh
rcmd() in the Library Reference
Syntax:
id [username]
id -G [-n] [username]
id -g [-nr] [username]
id -u [-nr] [username]
Runs on:
Neutrino
Options:
-G Write the real (and effective, if different) group ID only.
-g Write the effective group ID only.
-u Write the effective user ID only.
-n In combination with -G, -g, or -u, write the ID as its name instead of as an
unsigned integer.
-r In combination with -g or -u, write the real ID instead of the effective ID.
Description:
The id utility writes the current real and/or effective user ID and group ID. When no
options are specified, output is as follows:
uid=nnn(username) gid=nnn(groupname)
If the effective user ID is different from the real user ID, the effective user ID also
appears:
... euid=nnn(effective_username)
Likewise, if the effective group ID is different from the real group ID, the effective
group ID appears as well:
... egid=nnn(effective_groupname)
If no entry exists for an ID in the /etc/passwd or /etc/group files, the output
lacks the (name) after the numerical value. No error is generated.
If a username is supplied as an operand, the effective uid and gid don’t appear since
there’s no process associated with it — the information is simply looked up in the
/etc/passwd and /etc/group files.
When options are specified, the requested data is written as an unsigned integer, unless
option -n is specified, in which case the data is written as the corresponding user or
group name. With option -G, the id utility might produce two lines of output (one
value per line) if the real and effective IDs differ. In all other cases, id always
produces one line of output.
Examples:
Write information on current IDs (real and effective):
$ id
uid=109(eric) gid=120(techies)
$ id -g
120
$ id -gn
techies
Files:
/etc/passwd Password file; defines user IDs, home directories, etc.
/etc/group Group file; defines the valid group IDs for the system, also lists
user IDs who may change to each group.
Exit status:
0 Successful completion.
See also:
who
Logging In, Logging Out, and Shutting Down in the Neutrino User’s Guide
Syntax:
if_up [-alp] [-r retries] [-s seconds] interface...
Runs on:
Neutrino
Options:
-a Wait until all specified interfaces are configured. The default is to wait
until a single interface is configured.
-l (“el”) Wait for the network link to be marked as being up. This causes
if_up to wait until the physical network link is up. This option may
not be supported by some drivers.
-p Wait only until the specified interfaces are present. The default is to
wait until the interfaces are both present and configured. This is useful
if you intend to configure the interface manually, after it is present
(e.g. using the ifconfig utility).
-r retries The number of times to walk the interface list. The default is 5.
-s seconds Wait this number of seconds before rewalking the interface list. The
default is 1.
Description:
You can use this convenience utility while booting to ensure a TCP/IP interface is
available to those utilities that require one. It’s primarily intended for use with the
dhcp.client. When if_up is run in the foreground in a startup script, the script
doesn’t continue until the specified interfaces are marked as “UP” and have been
assigned an IP address, or the utility has timed out.
Examples:
See dhcp.client.
Files:
libsocket.so The if_up utility requires the libsocket.so shared library.
/usr/sbin/if_up
The if_up utility is located in the /usr/sbin/ directory, which
isn’t included in the default PATH of non-root users. If you
aren’t root, specify the full path.
Exit status:
0 Success.
See also:
dhcp.client, ifconfig
Syntax:
ifconfig interface address_family [address [dest_address]]
[parameters]
ifconfig [-hLmvz] interface [protocol_family]
ifconfig -a [-bdhLmsuvz] [protocol_family]
ifconfig -l [-b] [-d] [-u] [-s]
ifconfig -s interface
ifconfig -C
Runs on:
Neutrino
Options:
-a Display information about all of the interfaces in the system. You
can use the -d, -u, -b, and -s options with this option to limit
this display.
-m Display all of the supported media for all of the interfaces in the
system (used in conjunction with -a).
If you specify the -m option before an interface name, ifconfig
displays all of the supported media for the specified interface.
-z Similar to the -v flag, except that it zeros the interface’s input and
output statistics after printing them.
address_family The address family that affects the interpretation of the remaining
parameters. Specifying an address family is recommended since
an interface can receive transmissions in differing protocols with
different naming schemes. Address or protocol families currently
supported are inet, inet6, atalk, iso, and ns.
Description:
The ifconfig utility is used to assign an address and/or configure parameters for a
network interface. This utility must be run at boot time to define the network address
of each interface present on a machine; it may also be run later on to redefine an
interface’s address or to configure other interface parameters.
Parameters
You may set the following parameters with the ifconfig utility, if the driver supports
them. The output from ifconfig for an interface lists the supported parameters.
chanlist channels Set the channels to use when scanning for access points,
neighbors in an IBSS network, or looking for unoccupied
channels when operating as an access point.
Specify the set of channels as a comma-seperated list, with
each element in the list representing either a single channel
number of a range of the form a-b. Channel numbers must be
in the range 1 through 255 and be permissible according to the
operating characteristics of the device.
eui64 (inet6 only) Fill the interface index (the lowermost 64 bits of
an IPv6 address) automatically.
instance minst Set the media instance to minst. This is useful for devices that
have multiple physical layer interfaces (PHYs). Setting the
instance on such devices may not be strictly required by the
network interface driver because the driver may take care of
this automatically; see the driver’s documentation for more
information.
ip4csum, ip4csum-rx, ip4csum-tx
Enable hardware-assisted IPv4 header checksums, if they’re
supported. You can restrict this action to either the Rx or Tx
direction, if the hardware permits it.
-ip4csum, -ip4csum-rx, -ip4csum-tx
Disable hardware-assisted IPv4 header checksums.
-link[0-2] Disable special processing at the link level with the specified
interface.
media type Set the media type of the interface to type. Some interfaces
support the mutually exclusive use of one of several different
physical media connectors. For example, a 10 Mb/s Ethernet
interface might support the use of either AUI or twisted-pair
connectors. Setting the media type to 10base5 or AUI would
change the currently active connector to the AUI port. Setting it
to 10baseT or UTP would activate twisted pair. Refer to the
interfaces’ driver-specific documentation for a complete list of
the available types.
mediaopt opts Set the specified media options on the interface. The opts
argument is a comma-delimited list of options to apply to the
interface. For information about the available options, see the
documentation for each driver.
-mediaopt opts Disable the specified media options on the interface.
metric n Set the routing metric of the interface to n. The default is 0.
The routing metric is used by the routing protocol (routed).
Higher metrics have the effect of making a route less favorable;
metrics are counted as additional hops to the destination
network or host.
mode mode If the driver supports the media selection system, set the
specified operating mode on the interface to mode. For IEEE
802.11 wireless interfaces that support multiple operating
modes, this directive is used to select between 802.11a (11a),
802.11b (11b), and 802.11g (11g) operating modes.
mtu n Set the maximum transmission unit of the interface to n. Most
interfaces don’t support this parameter.
netmask mask (inet, inet6, and ISO) Specify how much of the address to
reserve for subdividing networks into subnetworks. The mask
includes the network part of the local address and the subnet
part, which is taken from the host field of the address. You can
specify the mask as a single hexadecimal number with a leading
0x, with a dot-notation Internet address, or with a
pseudo-network name listed in the network table, networks.
The mask contains ones for the bit positions in the 32-bit
address that are to be used for the network and subnet parts, and
zeroes for the host part. The mask should contain at least the
standard network portion, and the subnet field should be
contiguous with the network portion.
For INET and INET6 addresses, you can also give the netmask
with slash-notation after the address (e.g. 192.168.17.3/24).
nsellength n (ISO only) This specifies a trailing number of bytes for a
received NSAP used for local identification, the remaining
nwkey key (IEEE 802.11 devices only) Enable WEP encryption for IEEE
802.11-based wireless network interfaces with the key. The key
can either be a string, a series of hexadecimal digits preceded
by 0x, or a set of keys in the form n:k1,k2,k3,k4, where n
specifies which of keys will be used for all transmitted packets,
and four keys, k1 through k4, are configured as WEP keys.
Note that the order must be matched within same network if
you use multiple keys. For IEEE 802.11 wireless network, the
length of each key is restricted to 40 bits, i.e. a 5-character
string or 10 hexadecimal digits, while the WaveLAN/IEEE
Gold cards accept the 104 bits (13 characters) key.
nwkey persist (IEEE 802.11 devices only) Enable WEP encryption for IEEE
802.11-based wireless network interfaces with the persistent
key written in the network card.
nwkey persist:key (IEEE 802.11 devices only) Write the key to the persistent
memory of the network card, and enable WEP encryption for
IEEE 802.11-based wireless network interfaces with the key.
-nwkey (IEEE 802.11 devices only) Disable WEP encryption for IEEE
802.11-based wireless network interfaces.
pltime n (inet6 only) Set the preferred lifetime for the address, in
seconds.
prefixlen n (inet and inet6 only) Similar to netmask, but you can
specify the length of the prefix.
ssid id (IEEE 802.11 devices only) Configure the Service Set Identifier
(also known as the network name) for IEEE 802.11-based
vlan tag If the interface is a vlan pseudo-interface, set the VLAN tag to
tag. This is a 12-bit number which is used to create an 802.1Q
VLAN header for packets sent from the vlan interface. Note
that you must set vlan and vlanif at the same time.
vltime n (inet6 only) Set the valid lifetime for the address.
list active Display the list of channels available for use, taking into account
any restrictions set with the chanlist directive. See the
description of list chan for more information.
list caps Display the adaptor’s capabilities, including the operating modes
supported.
list chan Display the list of channels available for use. Channels are shown
with their IEEE channel number, equivalent frequency, and usage
modes. Channels identified as “11g” are also usable in “11b”
list mac Display the current MAC Access Control List state. Each address
is prefixed with a character that indicates the current policy applied
to it:
list scan Display the access points and/or ad hoc neighbors located in the
vicinity. You can use the -v option to display long SSIDs. This
information may be updated automatically by the adaptor and/or
with a scan request. You can also use list ap to request this
information.
list sta When operating as an access point, display the stations that are
currently associated. When operating in ad hoc mode, display
stations identified as neighbors in the IBSS. Capabilities advertised
by the stations are described under the scan request. Depending on
the capabilities of the stations the following flags can be included
in the output:
You can use the list scan request to show recent scan results
without initiating a new scan. You can use the -v option to prevent
the shortening of long SSIDs.
Diagnostics
Depending on the error, the utility may display messages indicating:
Examples:
Enable hardware-assisted TCP/IPv6 checksums on an interface:
See also:
/etc/autoconnect, /etc/hosts netmanager, netstat, phlip, routed
gif, gre, vlan in the NetBSD documentation at http://www.netbsd.org/docs/
QNX Neutrino Core Networking User’s Guide
Syntax:
ifwatchd [-hiqv] [-A arrival-script] [-c carrier-script]
[-D departure-script] [-d down-script]
[-n no-carrier-script] [-u up-script] ifname(s)
Runs on:
Neutrino
Options:
-A arrival-script Specify the command to invoke when new interfaces (such as
PCMCIA cards) arrive.
-c carrier-script Specify the command to invoke when the carrier status changes
from no carrier to carrier.
-D departure-script Specify the command to invoke when an interface departs (for
example a PCMCIA card is removed.)
-d down-script Specify the command to invoke on “interface down” events (or
on the deletion of an address from an interface).
-h Show the synopsis.
-i Inhibit a call to the up-script on startup for all watched interfaces
already marked up. If you don’t specify this option, ifwatchd
checks all watched interfaces on startup whether they’re already
marked up and, if they are, calls the up-script with appropriate
parameters.
Since ifwatchd typically is started late in the system boot
sequence, some of the monitored interfaces may already have
come up when it finally starts, but their up-scripts haven’t been
called. By default, ifwatchd calls them on startup to account
for this (and make the scripts easier.)
-n no-carrier-script
Specify the command to invoke when the carrier status
transitions from carrier to no carrier.
-q Be quiet and don’t log non-error messages to slogger.
-u up-script Specify the command to invoke on “interface up” events (or on
the addition of an address to an interface).
-v Run in verbose debug mode and don’t detach from the
controlling terminal. Output verbose progress messages, and flag
those errors that are ignored during normal operation. Don’t use
this option in /etc/rc.conf.
ifname(s) The name of the interface to watch. You can specify multiple
interfaces. Events for other interfaces are ignored.
Description:
The ifwatchd utility is used to monitor dynamic interfaces (for example PPP
interfaces) for address changes, and to monitor static interfaces for carrier changes.
Sometimes these interfaces are accompanied by a daemon program, which can take
care of running any necessary scripts (such as pppd or isdnd), but sometimes the
interfaces run completely autonomously (such as pppoe).
The ifwatchd utility provides a generic way to watch these types of changes. It
works by monitoring the routing socket and interpreting RTM_NEWADDR (address
added), RTM_DELADDR (address deleted) and RTM_IFINFO (carrier detect or loss of
carrier) messages. It doesn’t need special privileges to do this. The scripts called for
up or down events are run with the same user ID as for ifwatchd.
Examples:
# ifwatchd -u /etc/ppp/ip-up -d /etc/ppp/ip-down pppoe0
If your pppoe0 interface is your main connection to the Internet, the typical use of the
up/down scripts is to add and remove a default route. This is an example of an up
script that does this:
#! /bin/sh
/sbin/route add default $5
As described below, the fifth command line parameter contains the peer address of the
pppoe link. The corresponding ip-down script is:
#! /bin/sh
/sbin/route delete default $5
This isn’t a good idea if you have pppoe0 configured to connect only on demand (via
the link1 flag), but works well for all permanent connected cases. Use:
Syntax:
indent [input-file [output-file]] [options...]
Runs on:
QNX Neutrino
Options:
The first option of a pair is described; the second option disables the first. The second
option (disabled) is default.
-bl, -br Move the first brace ({) of a compound statement to the next line.
-nce, -ce Don’t place else statements adjacent to the preceding closing brace
(}).
-ei, -nei Indent an if following an else the same as the preceding if.
-in Specify the number of spaces for one indentation level. The default
is 4.
-ln Specify the maximum length of an output line. The default is 75.
-nlp, -lp Don’t line up parameters that overflowed onto the next line.
-pcs, -npcs Place a space between procedure names and the following
parenthesis (().
-npsl, -psl Don’t place column 1 procedure types on the previous line.
-nsc, -sc Disable the placement of asterisks (*) at the left edge of comments.
-troff Format for processing by troff. If you use this option, the output
is sent to stdout by default.
Description:
The indent utility formats C source code.
Files:
./.indent.pro, ˜/.indent.pro
Profile files.
See also:
unifdef
Syntax:
inetd [-Dd] [configuration_file]
Runs on:
Neutrino
Options:
-D Force inetd to daemonize by calling procmgr_daemon() instead of calling
daemon().
You need to specify the -D option to inetd if you’re running it under the control of
the High Availability Manager. The HAM can see death messages only from tasks that
are running in session 1, and the call to daemon() doesn’t put the caller into that
session. For more information about HAM, see the High Availability Framework
Developer’s Guide.
-d Turn on debugging.
Description:
The inetd daemon listens for connections on certain well-known ports. When it finds
a connection on one of its sockets, the daemon decides what service the socket
corresponds to and invokes a program to service the request. After that program is
finished, inetd continues to listen on the socket (except in some cases, described
below). Essentially, inetd lets you run one daemon to invoke several others, reducing
load on the system.
When it starts, inetd reads its configuration information from a configuration file; by
default, this is /etc/inetd.conf.
If any errors occur, inetd sends messages to slogger; use sloginfo to view the
system log.
Internal services
The inetd daemon provides several “trivial” services internally by using routines
within itself. These services are:
Effects of SIGHUP
When it receives SIGHUP, inetd rereads its configuration file, which may cause
services to be added, deleted, or modified.
Files:
The inetd daemon requires the libsocket.so shared library.
If you use RPC-based services, the librpc.so shared library must exist.
See also:
ftpd, /etc/inetd.conf, rlogind, rshd, slogger, sloginfo, telnetd, tftpd
TCP/IP Networking in the Neutrino User’s Guide
Name:
/etc/inetd.conf
Description:
The /etc/inetd.conf file is the default configuration file for the inetd
(super-server) daemon. As shipped, this file describes all currently supported QNX
Neutrino TCP/IP daemons and some nonstandard pidin services. Unless you want to
add or remove daemon definitions, you don’t need to modify this file.
The file must have an entry in each of its fields, with each field separated by a tab or a
space. Comments are denoted by a pound sign (#) at the beginning of a line.
The fields in the configuration file are:
[addr:]service-name | service-name/version
socket-type
protocol[,sndbuf=size][,rcvbuf=size]
wait|nowait[:max]
user[:group]
server-program
server program arguments
addr The local host address that inetd uses when listening for a
service. (Not applicable to RPC-based services.) A single
asterisk character (*) indicates that it is to listen on all local
addresses (INADDR_ANY).
When a line contains an address specifier and colon only (no
service-name field is specified), the address specifier is assumed
for all further lines until another line with an explicit address
specifier appears, or until the end of the file is reached.
rcvbuf=size
sndbuf=size Size of the send or receive buffer for the listening socket. This
may be useful for the TCP protocol because the window scale
factor, that’s based on the receive socket buffer size, is advertised
when the connection handshake occurs. Therefore, the socket
buffer size for the server must be set on the listening socket. In
some situations, you may realize better TCP performances when
increasing the socket buffer sizes. The socket buffer sizes are
specified by appending their values to the protocol specification
as follows:
tcp,rcvbuf=16384
tcp,sndbuf=64k
tcp,rcvbuf=64k,sndbuf=1m
wait|nowait Tell inetd if it should wait for the server program to return, or to
continue processing connections on the socket. Sockets other
than datagram sockets should have a nowait entry in this space.
If a datagram server connects to its peer, freeing the socket so
inetd can receive further messages on the socket, it’s said to be
a multi-threaded server and should use the nowait entry.
If a datagram server processes all incoming datagrams on a socket
and eventually times out, that server is said to be single-threaded
and should use a wait entry. The tftpd daemon is an exception;
it’s a datagram server that establishes pseudo-connections. It
must be listed as wait in order to avoid a race; the server reads
the first packet, creates a new socket, and then forks and exits to
let inetd check for new service requests to spawn new servers.
Stream servers are usually marked as nowait, but if a single
server process is to handle multiple connections, it may be
marked as wait. The master socket is passed as fd 0 to the
server, which then needs to accept the incoming connection. The
server should eventually time out and exit when no more
user Name of the user that the server runs as. This allows servers to be
given less permission than root.
direction bypass
direction entrust
direction ipsec request ...
See “Setting the policy” in the IPsec protocols page for detailed descriptions of the
arguments.
Examples:
The following is an example from a working inetd.conf file:
where:
/usr/sbin/ftpd
Is the server program.
See also:
inetd, setkey
IPsec protocol in the Library Reference
TCP/IP Networking in the Neutrino User’s Guide
Syntax:
inflator [-b num] [-v[v...]] [mountpoints...]
[!exclude...]
Runs on:
Neutrino
Options:
-b num The number of decompression buffers (default: 8).
If you specify the -v option, you need to start inflator in the background. If you
don’t use this option, inflator automatically daemonizes itself.
Description:
The inflator resource manager sits in front of other filesystems and inflates files
that were previously deflated using the deflate utility. It’s typically used when the
underlying filesystem is a flash filesystem — it can almost double the effective size of
the flash memory.
When started without arguments, inflator takes over /, placing it in front of any
existing filesystems. It then catches each open() first. If the file is being opened for
read, inflator attempts to open the file itself on an underlying filesystem. It reads
the first 16 bytes and checks for the signature of a deflated file. If the file was deflated,
inflator places itself between the application and the underlying filesystem. All
reads return the original file data before it was deflated.
From the application’s point of view, the file appears to be uncompressed. Random
seeks are also supported. If the application does a stat() on the file, the size of the
inflated file (the original size before it was deflated) is returned. If it’s necessary to
open a deflated file and see the deflated data or the deflated size, append .˜˜˜ to the
filename and open that. For example:
$ deflate file1 # Deflate a file
$ wc file1 # wc sees the contents of the original file
$ wc file1.˜˜˜ # wc sees the contents of the deflated file
$ ls -l file1 # ls reports the size of the original file
$ ls -l file1.˜˜˜ # ls reports the size of the deflated file
If a file opened for read doesn’t have the deflate signature, inflator returns
ENOENT, which gives the file to the next underlying filesystem. In this manner,
inflator gets out of the way. Likewise if a file is opened for any write mode,
inflator again returns ENOENT and gets out of the way. You can use the -v option
to monitor the opens that inflator receives and which ones it accepts. You can use
multiple -v options to obtain more verbosity.
By default, inflator maintains 8 inflation buffers that are used to decompress data.
If more than 8 files are being processed at one time, the buffers are used as a cache. If
a buffer is stolen away from a file, a subsequent read on that file requires the data to be
reread and inflated again. A single -v prints a message each time a buffer is stolen,
allowing you to tune your system. Since memory is often in short supply in embedded
systems, you should use the minimum number of buffers needed to achieve acceptable
performance.
The size of the buffers is determined by the deflate utility. It defaults to 8K, but may
be set to any of 4K, 8K, 16K or 32K. In effect, the file is broken into smaller
compression blocks instead of compressing the entire file as a whole. Without this,
random seeking in the file would be a performance nightmare. On fast processors
(200MHz), the cost of inflating the data shouldn’t be significant. On slower processors,
it may be a performance issue as the inflation code competes for processor cycles.
Some versions of the flash filesystem (devf-*) also support compression. For most
systems, inflator provides better compression and comparable, if not better,
performance.
Examples:
Take over / and inflate files that have been deflated when they’re opened for reading
by applications:
inflator
Take over / as above, but pass on any files under /tmp to any underlying filesystems
without examining them in any way:
inflator / !/tmp
Take over directories where executables are usually located. Inflate files that have been
deflated when they’re opened for reading by applications:
inflator /sbin /bin /usr/sbin /usr/bin /usr/photon/bin
Take over / as above, but output some diagnostics (note the ampersand, which is
needed to make inflator run in the background when -v is specified):
inflator -v &
Caveats:
You can’t run inflator twice on the same mountpoint.
See also:
deflate, devf-*
Syntax:
infocmp [-1CILQ] [-w width] [terminal_name]
Runs on:
Neutrino
Options:
-1 (“one”) Force the output to contain one entry per line. Without this
option, output is printed to a maximum width of 60 characters,
each line containing as many entries as can fit on that line.
-Q Use the names that map onto the QNX console capabilities.
Description:
The infocmp utility is used to output the contents of a previously compiled
terminfo capability file in a number of formats. The default format is suitable for
editing and recompilation with the tic utility. The output is sorted such that the
Boolean capabilities are output first, followed by the integer capabilities and then the
string fields. The infocmp utility, executed without any options, produces the
terminfo description of the currently defined terminal in a form suitable for editing
and recompilation with the tic utility.
If no options are specified and zero or one terminal name is specified, the -I option is
assumed.
See also:
tic
Strang, John, Linda Mui, and Tim O’Reilly. 1988. termcap & terminfo. Sebastopol,
CA: O’Reilly and Associates. ISBN 0937175226.
Syntax:
input-cfg [-s server_name] [-x position[%][r]
[-y position[%][r]
Runs on:
Neutrino
Options:
-s server_name The name of the Photon server:
Description:
You can use input-cfg to configure input devices, such as a mouse:
You can:
This utility needs to have the setuid (“set user ID”) bit set in its permissions. If you use
mkefs, mketfs, or mkifs on a Windows host to include this utility in an image, use
the perms attribute to specify its permissions explicitly, and the uid and gid
attributes to set the ownership correctly.
See also:
devi-*, inputtrap
Using the Photon microGUI in the Neutrino User’s Guide
Syntax:
inputtrap [-f device] [-l device] [-s]
[-T] [-t trapfile] [-V...]
[-v[v]...] [-X class]... [-x device]...
[start] [query]
Runs on:
Neutrino
Options:
-f device Probe for device first.
start Start the driver. Once one input device from each class of device is
recognized, inputtrap starts the driver for the first device found in
each class.
Description:
The inputtrap utility detects input devices and optionally starts the input manager.
It runs in one of the following ways:
This utility needs to have the setuid (“set user ID”) bit set in its permissions. If you use
mkefs, mketfs, or mkifs on a Windows host to include this utility in an image, use
the perms attribute to specify its permissions explicitly, and the uid and gid
attributes to set the ownership correctly.
Probing
If probing, inputtrap probes for input devices, and writes to slogger the
invocation commands along with the appropriate options and arguments for starting
the found devices. If you specify the query option, inputtrap also writes the
commands to standard output.
The probing order is as follows:
1 Keyboard (kbd)
The device names (given above) are recognized as arguments to the -f and -x options.
Using a trapfile
To override the options that inputtrap uses by default, probe the devices, using the
query option as described above, redirect the output to a file, and then edit the file.
When the options are correct, move or copy the trapfile to
/etc/system/trap/input.${HOSTNAME}.
If the /etc/system/trap/input.${HOSTNAME} file exists, inputtrap uses the
contents of this file as arguments to start a devi-* driver.
Each line of the trapfile corresponds to a separate invocation of a devi-* driver. The
first word on the line indicates the driver to start. For example:
The above line tells inputtrap to start the Elographics touchscreen driver.
If the line doesn’t start with the name of a devi-* driver, inputtrap starts
devi-hirun. For example:
CAUTION:
! Adding invalid information to the input.hostname file can cause the system to hang.
If your hardware changes, remember to remove the old input.hostname file.
Examples:
Probe for input devices, but don’t start the input driver:
inputtrap
Probe for input devices. Don’t start the input driver, but write the command line for
the driver on standard output:
inputtrap query
Probe for input devices. Once one of each class of device has been recognized, spawn
devi-hirun with an appropriate command line:
inputtrap start
See also:
devi-*, input-cfg, slogger
Connecting Hardware in the Neutrino User’s Guide
Syntax:
io-audio [-d driver [driver_options]] [-o opt[,opt[,opt]]]
[v[v]...]
Runs on:
Neutrino
Options:
-d driver [driver_options]
Load the specified driver and pass it the given driver_options.
For information on the drivers and their syntax and options, see
the deva-* entries:
• disable_sw_mixer
On cards that have only a single channel in hardware, do not
use software techniques to increase the maximum number
of playing channels.
See the list of shared objects (below) for details about local options for specific
drivers.
Description:
The io-audio manager provides support for dynamically loaded audio-driver
modules. This utility enables you to load the audio drivers specified by the -d options
when you start io-audio.
• You can start more than one driver by using multiple -d command-line options, but
don’t try to start more than one instance of io-audio.
• Graphics drivers run at a higher priority than applications, but they shouldn’t run at
a higher priority than the audio, or else breaks in the audio occur. You can use the
on command to adjust the priorities of the audio and graphics drivers.
Once io-audio has started, you can dynamically load and unload drivers using the
mount and umount commands. E.g. this command:
io-audio &
mount -T io-audio vortex
mount -T io-audio audiopci
When searching for shared objects, the io-audio manager uses the
LD_LIBRARY_PATH environment variable.
umount /dev/snd/controlC0
Examples:
Provide support for Aureal Vortex sound card:
Files:
The io-audio command can load the following shared objects:
deva-ctrl-4dwave.so
Sound driver for the Trident 4DWave!.
deva-ctrl-audiopci.so
Sound driver for the AudioPCI chip family.
deva-ctrl-cs4281.so
Sound driver for the CS4281.
deva-ctrl-ess1938.so
Sound driver for the ESS1938.
deva-ctrl-geode.so
Sound driver for the National Semiconductor Geode family of chips.
deva-ctrl-i8x0.so
Sound driver for the Intel 8X0.
deva-ctrl-nmg6.so
Sound driver for the Neomagic 6 family of chips.
deva-ctrl-via686.so
Sound driver for the VIA686.
deva-ctrl-vortex.so
Sound driver for the Vortex.
deva-ctrl-ymfds1.so
Sound driver for the Yamaha DS1.
deva-mixer-ac97.so
Mixer DLL for the AC97 codec.
deva-ak4531.so
Mixer DLL for the AK4531 codec.
deva-util-restore.so
Shared object used to restore an audio driver’s state.
See also:
Connecting Hardware in the Neutrino User’s Guide
Syntax:
driver [blk option[,option...]] [fstype [options]]
Runs on:
Neutrino
Options:
The driver is one of the devb-* drivers, such as devb-eide, and option is one of the
options described below.
The optional fstype argument is one of the filesystem drivers (fs-*); you can follow it
with options specific to the filesystem.
• b — bytes
• k — kilobytes
• m — megabytes
• g — gigabytes
• p — pages
• h — hours
• m — minutes
• s — seconds
blk options
You can specify the following options only in the blk section:
cd fs-cd.so
dos fs-dos.so
ext2 fs-ext2.so
mac fs-mac.so
nt fs-nt.so
qnx4 fs-qnx4.so
qnx6 fs-qnx6.so (Power-Safe filesystem)
udf fs-udf.so
You can’t locate the filename file in the filesystem to be automounted: it has to be
available in an existing filesystem such as the image filesystem. Optionally, you could
locate it in any devb filesystem that’s already running.
To mount multiple filesystems on a (removable) device, specify
that the device is shared with a + prefix. For example,
automount=+fd0:/dos/a:dos,automount=+fd0:/fd:qnx4
cache=total[:hash] Specify the total size of the disk buffer cache. The buffer cache
is used as intermediate storage for all disk I/O, as well as
providing LRU caching for dirty delayed-write blocks and
recently-read blocks.
By default, 15% of system RAM is assigned, with a minimum
of 512 KB and a maximum of 512 MB. If you specify an
explicit size, bounds of 512 KB and 3 GB are applied.
Normally this cache is allocated at startup; if you specify
alloc=demand, or the initial allocation failed, then the cache
is dynamically grown as required up to the specified size.
The optional hash argument specifies the size of the buffer
cache hash list. You can specify any of the suffixes described
above. The default is 25% of the number of entries in the
cache.
delwri=delay1[:delay2[:postpone]]
Specify the delay time for write-behinds to the media. A dirty
disk block may remain in the cache without being physically
written to the disk, to improve performance. The default is up
to 3 seconds (delay1) for fixed media, and 1 second (delay2)
for removable media. For more information, see “Controlling
writing operations,” below.
The postpone argument specifies the number of seconds for
which to keep a dirty disk block in memory if it’s being
continuously modified, before physically writing it to the disk.
This applies only to fixed media; for removable media, writes
aren’t delayed beyond the delay2 period. By default, postpone
is the same as delay1.
devno=type Controls how major device numbers are requested; type is one
of:
• name — use the name of the device (e.g. hd, cd).
• class — use the CAM class of the device (e.g. direct,
readonly).
• common — use a single class for all block devices.
The default is name.
enumpart=order Set the order for enumerating disk partitions; one of the
following:
• forward — enumerate slots 1 through 4, followed by any
extended partitions.
fdinfo=mode Specify the storing of open file names for the iofdinfo() query.
The options for mode are:
• ncache — try to reconstruct the file name from the
contents of the directory name cache. Don’t rely on this
option to supply the names of all open files (a file’s name is
supplied only if all components of its pathname are in the
name cache).
• always — store the name used in each open() call to
ensure that this name is always available.
• never — never supply the name of an open file.
The default is always.
memory=type1[:type2[:type3[:type4]]]
Specify the typed memory pool or pools to use. For example,
memory=sysram&below4G:sysram says to try sysram with
the below4G modifier, and if no such region exists, then try
plain sysram. (The same option works on systems with more
or less than 4 GB of RAM.)
naming=scheme Set the device/partition naming scheme. The default is 0#. For
more information, see “Naming schemes,” below.
ncache=size[:hash] Specify a name cache of size entries. Using more name cache
entries speeds up path/file lookups at the expense of memory.
Setting the size to 0 disables name caching. If this option isn’t
specified, the size is determined from the vnode option.
The hash argument specifies the size of the associated hash
list; the default is 1/6 of the size of the number of entries in the
name cache.
The initial contents of this memory device are unspecified, so you must format it
before using it as a filesystem (for example, with dinit for a QNX 4 filesystem).
thread=max[:low[:high]]
Set the thread pool parameters (maximum, low water, and high
water). The default is 12:2:5.
Filesystem options
You can apply the following options globally (in the blk section) or to a specific
filesystem (for example, in the qnx4 section for a QNX 4 filesystem):
after Mount the filesystem so that it’s resolved after any other
filesystems mounted at the same pathname (in other words, it’s
placed behind any existing mount). When you access a file, the
system looks on this filesystem last, and only if the file wasn’t
found on any other filesystems.
before Mount the filesystem so that it’s resolved before any other
filesystems mounted at the same pathname (in other words, it’s
placed in front of any existing mount). When you access a file,
the system looks on this filesystem first.
commit=level Set the committing level of the filesystem, which controls how
dirty system/user blocks are written to disk. The level is one of
none, low, medium (the default), and high. If it’s none, all
writes are time-delayed (as specified by the delwri option); at
high, all writes are performed synchronously. For more
information, see “Controlling writing operations,” below.
error=action Set the action to perform when a fs-* filesystem module detects
an internal error. The action is one of:
• ebadfsys — simply return EBADFSYS to the client.
• mountro — return EBADFSYS to the client and remount the
affected filesystem as read-only.
The default is ebadfsys.
[no]atime Update/don’t update the file’s directory entry if the only change
is the access time. The noatime option isn’t strict POSIX
1003.2 behavior, but it’s faster.
For more information about the before and after options, see “Ordering
mountpoints” in the Process Manager chapter of the System Architecture guide.
Description:
The io-blk.so library provides block I/O support, as used by the devb-*, drivers,
and loads filesystem drivers (fs-*) as necessary.
The default values of the map and ncache options are based on the value of the
vnode option. This arrangement lets you configure a system by specifying the cache
size and the number of files, and letting the library set the other options.
Synchronous (SYNC)
Start immediately and wait for completion.
Asynchronous (ASYNC)
Start immediately but don’t wait for completion.
Delayed (DELWRI)
Don’t start until after a timeout period and then perform as
asynchronous. The blk delwri= option controls the timeout for the
delayed format; if you set this option to 0, a delayed writing operation
is the same as asynchronous.
If a file has no links, the “as required” form of write operation is used, never going to
disk unless the buffer or cache is needed (since the file has no links, the data isn’t
expected to be accessible after a power failure). If you open a file with O_SYNC, the
synchronous format is always used.
Otherwise, the blk commit level controls the type of write to use for each level of
data:
CAUTION: If you specify commit=none, you lose all write ordering (both for single
! multiblock updates and multiple-user operations). Hence, your chances of a useful
recovery following a power failure are poor. We recommend that you use this option
only if you have a uninterruptible power supply (UPS), or if you don’t mind using
dinit on your filesystem as a recovery tool.
Calling close() might force a metadata update, but does nothing to the user data.
Calling fsync() always forces out any delayed-write blocks for the file, and so is useful
only when commit isn’t high.
Naming schemes
You can use the naming=scheme option to specify the naming scheme to use for
devices and partitions. The format of scheme is as follows:
0a (actually any digit and any letter; these set the first/base name)
The raw devices are named 0,1,..., and partitions are named a, b, and so on (e.g.
/dev/hd0, /dev/hd0a, /dev/hd0b, /dev/hd0c, and so on). The name
doesn’t indicate the OS type of the partitions, just the order in which they were
found.
a1 (actually any letter and any digit; these set the first/base name)
The raw devices are named a, b, and so on. Primary partitions are named 1, 2, 3,
and 4; if you don’t have four of them, the unused numbers are skipped. Any
extended partitions are numbered without gaps from 5 (e.g. /dev/hda,
/dev/hda1, /dev/hda2, /dev/hda5, and so on).
The name doesn’t indicate the OS type of the partition, just its location. This is
the Linux naming scheme.
• Don’t use a different scheme unless you’re in control of the entire system (e.g.
don’t change it in a desktop installation, where diskboot scans for well-known
hd0t77-style names).
• If you use a different scheme, you’ll need some external knowledge about what
filesystem to mount on a partition, because you won’t have the tXXX naming hint.
See also:
devb-*, fs-*, mount
Filesystems chapter of the System Architecture guide
Working with Filesystems chapter, and “Filesystems and block I/O (devb-*) drivers”
in the Fine-Tuning Your System chapter of the QNX Neutrino User’s Guide
Syntax:
io-display [-fv] [-d device] [-c config_file]
[-p priority]
Runs on:
Neutrino
Options:
-c Specify a path to the configuration file. The default is
/etc/system/config/display.conf. See below for the
configuration file’s format.
-d device Load the graphics driver specified by the device. These options must
match an entry in the io-display configuration file (see below).
The format of the device string is:
vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
Where:
For PCI devices, you can use the pci utility to display PCI information about installed
graphics devices on a machine running Neutrino.
-p priority Set the priority of pulses to be used by device drivers, e.g. when
delivering interrupt events; io-display inherits the priority of
received pulses, which can cause priority inversion problems for client
applications that block on io-display. The default value is 21.
-v Be verbose.
Description:
The io-display manager provides support for direct rendering to graphics devices
using the QNX Graphics Framework and OpenGL ES by loading the driver specified
by the -d option.
Once io-display has started, applications can use the QNX Graphics Framework
library (libgf) and OpenGL ES libraries to acquire a graphics context and render to
the device.
QNX Graphics Framework applications must be privileged in order to run, since they
directly access the graphics hardware when rendering. This means they either have to
be run by root, or by a member of the display group. Applications that are a
member of the display group can directly access the graphics hardware, without
having supervisor (root) privileges.
There is one restriction however, which currently only applies to x86 systems. Some
drivers for older video devices may need to perform accesses to I/O mapped registers
when rendering. In this case, the thread performing the rendering will need to have I/O
privilege. In order to obtain I/O privilege, the process must run as root. A process with
I/O privilege on an x86 system does not have full superuser privileges, however, so the
extra requirement to run as root with some graphics devices introduces minimal risk.
The top-level section is device, which describes a graphics device. It has these
options and subsections:
noautoshutdown
Set to 1 to prevent the display from being turned off when all
applications exit. If not specified, the default 0 is used.
drivername A string describing the devg-* driver that io-display loads for
this device. The string must match the name of the driver. For
example, coral matches devg-coral.so.
vid The vendor ID, in hexadecimal. In the case of a PCI device, this is
the PCI vendor ID.
did The device ID, in hexadecimal. In the case of a PCI device, this is
the PCI device ID.
modeopts A string passed directly to the driver. For example, in the case of
the Coral driver, it can specify a configuration file with additional
hardware-specific settings.
yres=480
refresh=60
pixel_format=argb1555
}
}
device {
noautoshutdown=1
drivername=coral
vid=0x10cf
did=0x201e
deviceindex=0
modeopts=/usr/photon/config/coral.conf
display {
xres=640
yres=480
refresh=60
pixel_format=argb1555
}
}
3 Start Photon.
By default, Photon runs on the display’s main layer. Therefore you should run GF and
OpenGL ES applications on a different layer.
Examples:
Start io-display, and load and initialize the driver for the Fujitsu Coral PA chipset:
io-display -dvid=0x10cf,did=0x201e
See also:
io-graphics, dispconf
Syntax:
io-graphics [-aCehLlv] [-c file]
[-d vid=vid,did=did[,deviceindex=index]*]
[-f global|local|none ] [-n name] [-P priority]
[-p num_points] [-w size]
Runs on:
Neutrino
Options:
-a Enable anti-aliasing on polylines (currently only for diagonal lines
of width 1). This anti-aliasing is only for CRT or LCD (video)
targets, not printer targets.
-f mode Set the mode of operation for the font service; one of the
following values:
-h For HW Wait Idle calls, wait only for the specified video card; the
default behavior is to wait for all cards in use.
-v Be verbose.
-w size Set the buffer size for the render library workspace (default: 300
KB). The size can include a case-insensitive suffix of K or M.
Description:
The io-graphics command starts a graphics driver.
Files:
The devg-* drivers generally require libffb.so.2 and libdisputil.so.2 at
runtime.
Environment variables:
PHFONT_USE_EXTERNAL
If this environment variable exists, io-graphics does not run an internal font
server. You should set this environment variable for systems that have remote
clients accessing font services on the host machine (e.g. phindows, phditto).
See also:
io-display, dispconf
Syntax:
io-hid [-n name] -d driver [driver_options]... [-v] [-V] &
Runs on:
Neutrino
Options:
-d driver [driver_options]
Load the specified driver and pass it the given driver_options. For
information on the drivers and their syntax and options, see the devh-*
entries:
-v Be verbose.
Description:
The io-hid manager provides support for input devices and input clients. You can
load drivers when you start io-hid by specifying the -d command-line option.
Clients such as devc-con and devi-hid connect to io-hid and interact with
human-interface devices through io-hid.
You can start more than one driver by using multiple -d command-line options.
Once io-hid has started, you can dynamically load and unload modules using the
mount and umount commands.
The io-hid manager uses the LD_LIBRARY_PATH environment variable when
searching for the shared objects. If LD_LIBRARY_PATH is not set, or the shared
object in question isn’t in one of its directories, or you want to override the default,
specify the full path in the mount command.
Examples:
Load USB HID devices, PS/2 mouse, serial mouse on COM1 directly, and a PS/2
keyboard:
io-hid &
mount -T io-hid devh-usb.so
mount -T io-hid devh-ps2ser.so \
ps2mouse:mousedev:msoft:uart,1:kbd:kbddev
Unload a module:
umount /dev/io-hid/devh-usb
See also:
devc-con-hid, devh-usb.so, devh-ps2ser.so, devh-*, devi-hid, hidview,
mount, umount
Connecting Hardware in the Neutrino User’s Guide
Syntax:
io-pkt-variant [-d driver [driver_options]] [-i instance]
[-p protocol [protocol_options]] [-t threads] [-v]
where variant is one of v4, v4-hc, or v6-hc.
Runs on:
Neutrino
Options:
-d driver [driver_options]
Start the specified devn-* or devnp-* driver:
• You can specify driver without the devn- or devnp- prefix or the
.so extension. For example, to start the devnp-i82544.so
driver, specify -d i82544. If you specify the driver this way,
io-pkt* looks for a devnp- version first. If there isn’t one,
io-pkt* loads the legacy io-net (devn-) version, using a
special “shim” layer, devnp-shim.so.
• If you want to load a specific version of a driver, specify the full
path of the module (e.g. /lib/dll/devn-i82544.so).
The driver_options argument is a list of driver-specific options that
the stack passes to the driver.
-i instance The stack instance number, which is useful if you’re running multiple
instances of io-pkt. The io-pkt manager will service mount
requests of type io-pktX, where X is the instance number. For
example:
io-pkt-v4 -i1 -ptcpip prefix=/alt
mount -Tio-pkt1 /lib/dll/devnp-i82544.so
-p protocol [protocol_options]
The protocol to start, followed by a list of protocol-specific options.
Protocol Module
autoip lsm-autoip.so
qnet lsm-qnet.so
tcpip The stack includes TCP/IP; you need to specify this
protocol only if you want to pass additional parameters (e.g.
prefix=) to it. For more information about the options,
see below.
-v If any errors occur while loading drivers and protocols, io-pkt sends
messages to slogger. If you specify this option, io-pkt also
displays them on the console.
If you specify the -p tcpip protocol, the protocol_options list can consist of one or
more of the following, separated by commas without whitespace:
fastforward=X Enable (1) or disable (0) fastforwarding path. This is useful for
gateways. This option enables, and is enabled by, forward; to
enable only forward, specify forward,fastforward=0.
mbuf_cache=X As mbufs are freed after use, rather than returning them to the
internal pool for general consumption, up to X mbufs are
cached per thread to allow quicker retrieval on the next
allocation.
pagesize=X The smallest amount of data allocated each time for the internal
memory pools. This quantum is then carved into chunks of
varying size, depending on the pool.
pkt_cache=X As mbuf and cluster combinations are freed after use, rather
than return them to the internal pool for general consumption,
up to X mbufs and clusters are cached per thread to allow
quicker retrieval on the next allocation.
pkt_typed_mem=object
Allocate packet buffers from the specified typed memory
object. For example:
recv_ctxt=X Specify the size of the receive context buffer, in bytes. The
default is 65536; the minimum is 2048.
reuseport_unicast
If using the SO_REUSEPORT socket option, received unicast
UDP packets are delivered to all sockets bound to the port. The
default is to deliver only multicast and broadcast to all sockets.
rx_prio=X
rx_pulse_prio=X The priority for receive threads to use (the default is 21). A
driver-specific priority option (if supported by the driver) can
override this priority.
stacksize=X Specify the size of each thread’s stack, in bytes. The default is
4096.
threads_min=X Specify the minimum number of threads. The default is 15, and
the minimum is 4.
Description:
The io-pkt manager provides support for Internet domain sockets, Unix domain
sockets, and dynamically loaded networking modules. It comes in several stack
variants:
• GRE / GRF
• Multicast routing
• Multipoint PPP
io-pkt-v4-hc IPv4 version of the stack that has full encryption and Wi-Fi
capability built in and includes hardware accelerated
cryptography capability (Fast IPsec).
io-pkt-v6-hc IPv6 version of the stack (includes IPv4 as part of v6) that has
full encryption and Wi-Fi capability, also with hardware
accelerated cryptography.
You can use the mount command to start drivers after you’ve launched io-pkt*. If
you want to pass options to the driver, use the -o option before the name of the shared
object. For example:
• You can use umount to unmount legacy io-net drivers, but not io-pkt* drivers.
Other drivers may allow you to detach the driver from the stack, by using
ifconfig’s destroy command (if the driver supports it).
• If io-pkt runs out of threads, it sends a message to slogger, and anything that
requires a thread blocks until one becomes available.
• Native io-pkt and ported NetBSD drivers don’t put entries into the
/dev/io-net namespace, so a waitfor command for such an entry won’t work
properly in buildfiles or scripts. Use if_up -p instead; for example, instead of
waitfor /dev/io-net/en0, use if_up -p en0.
• If a TCP/IP packet is smaller than the minimum Ethernet packet size, the packet
may be padded with random data, rather than zeroes.
This option doesn’t work with legacy io-net legacy drivers. If you attempt to use this
option with a devn- driver, the driver won’t be loaded, and the log will include an
“unknown option” error.
The stack also processes the following driver options for all USB drivers using the
NetBSD-to-QNX conversion library to let you identify a particular USB device using
information obtained from running usb -v:
For example:
Examples:
Start the v4 TCP/IP variant of io-pkt using the devnp-bcm1250.so driver on
BCM91480A eth0:
io-pkt-v4 -d /lib/dll/devnp-bcm1250.so \
memrange=0x10064000,irq=0x80050024,mac=001122334455
ifconfig bcm0 10.184
See also:
devn-*, devnp-*, ifconfig, lsm-autoip.so, lsm-qnet.so, mount, umount
QNX Neutrino Core Networking User’s Guide
Syntax:
io-usb [-d dll [opts] ] [-n name] [-P priority]... [-V] [-v]
Runs on:
Neutrino
Options:
-c Do not select a device configuration if the device has more than one
configuration. See “Selecting a driver configuration” below.
-d dll [opts] Load the specified host controller DLL and opts and pass it the dll.
For information on the drivers and their syntax and options, see the
devu-* entries.
-P priority The priority to use for the server; the default is 21.
-v Be verbose.
Description:
The io-usb server contains USB protocols and communicates with clients (class
drivers). The USB stack is a server/dll interface which the server uses to load the
DLLs that manage the USB chips. You can load drivers when you start io-usb by
specifying the -d command-line option.
You can start more than one driver by using multiple -d command-line options.
Once io-usb has started, you can dynamically load and unload modules using the
mount and umount commands.
The io-usb controller uses the LD_LIBRARY_PATH environment variable when
searching for the shared objects. If LD_LIBRARY_PATH is not set, or the shared
object in question isn’t in one of its directories, or you want to override the default,
specify the full path in the mount command.
For example, to mount the EHCI (high speed) USB driver:
• If you specify the -c option, io-usb will not select a device’s configuration,
leaving the configuration selection to the launcher application.
• If you do not specify the -c option, io-usb will automatically select the device’s
first configuration.
Some devices may not be able to switch the configuration once an initial configuration
is selected.
Examples:
Start the USB 2.0 stack and USB drivers:
io-usb &
mount -T io-usb devu-ehci.so /dev/io-usb/io-usb
mount -T io-usb devu-ohci.so /dev/io-usb/io-usb
mount -T io-usb devu-uhci.so /dev/io-usb/io-usb
Unload a module:
umount /dev/io-usb/devu-ehci.so
See also:
devu-ehci.so, devu-ohci.so, devu-uhci.so, devu-*, mount, umount, usb
Connecting Hardware in the Neutrino User’s Guide
Syntax:
join [-1 n] [-2 n]
[-a file_number] [-e string]
[-j file_number n]
[-o list] [-t char] [-v file_number]
file1 file2
Runs on:
Neutrino
Options:
Options -a, -j, and -v use the file_number argument. Specify 1 to refer to file1, or 2
to refer to file2.
-1 n (One) Join on the nth field of file1. Fields are numbered, starting
with 1.
-2 n Join on the nth field of file2. Fields are numbered, starting with
1.
-o list Produce output in which each line comprises the fields specified
in list. Each entry in list has the form:
file_number.field
where field is a field number. You can use a space or a comma to
separate entries.
Output is written only for lines with matching join fields. The
join field isn’t written unless it’s included in list.
-t char Use the character char as a separator, for both input and output.
Every appearance of char in a line is significant. When this
option is specified, the collating sequence should be the same as
that produced by sort, without the -b option.
-v file_number Instead of the default output, produce a line only for every
unpairable line in file_number.
file1 file2 The names of the text files. If either file1 or file2 is -, the
standard input is used.
Description:
The join utility forms a “join” of the two relations specified by the lines of file1 and
file2. The join is written to the standard output.
The files file1 and file2 are compared on the basis of a “join field” found in both files.
For every pair of lines in file1 and file2 that have identical join fields, join prints one
output line. The output line normally consists of the join field, followed by the rest of
the line from file1 and then the rest of the line from file2. By default, the join field is
the first field in each line.
Both file1 and file2 should be sorted in an increasing collating sequence on their join
fields (i.e. the same sequence performed by sort -b). Otherwise, some field matches
may not be reported. Note, however, that when option -t is specified, the collating
sequence should be the same as that produced by sort, without the -b option.
The default input field separators are blanks. In this case, multiple separators count as
one field separator; leading separators are ignored. The default output field separator is
a space.
Examples:
Join the password file and group file, matching on the numeric group ID and
outputting the login name, group name, and login directory. It’s assumed that the files
have been sorted in collating sequence on the group ID fields.
Exit status:
0 All input files were output successfully.
See also:
gawk, sort, uniq
Syntax:
kill [-n node] [-signal_name | -signal_number] pid...
kill -l
Runs on:
QNX Neutrino
Options:
-signal_name The name of the signal to be sent to the specified process. Values
of signal_name are recognized in case-independent fashion, with
or without the SIG prefix.
-n node Kill the process on the specified node. This option isn’t available
in the shell builtin version of kill.
CAUTION: Don’t use a pid of zero when logged on as root. Signalling all the
! background processes owned by superuser and any current superuser foreground
processes (e.g. backups in progress) may produce unpredictable results.
Description:
The kill utility sends a signal to the process(es) specified by each pid operand. By
default, kill sends the SIGTERM signal, but you may override this default by naming
a signal to be sent.
To print the list of signals that may be sent, use kill with the -l option:
kill -l
The kill command is available both as a standalone utility and as a shell builtin. To
make sure that you’re using the utility, specify the full path. For information about the
builtin command, see esh and ksh.
Examples:
Any of the commands:
sends the SIGKILL signal to the process whose process ID is 100 and to all processes
whose process group ID is 16, assuming the sending process has permission to send
that signal to the specified processes, and that they exist.
Exit status:
0 At least one matching process was found for each pid option, and the specified
signal was successfully sent to each matching process.
Caveats:
Some shells include a builtin kill command. To make sure you’re using the kill
utility, specify the the full path to it.
See also:
esh, ksh, pidin
Syntax:
ksh [+-abCefhikmnprsuvxX] [+-o option]
[ [ -c command-string [command-name]
| -s | file ] [argument...] ]
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
You can specify the following options only on the command line:
-c command-string
Execute the command(s) contained in command-string.
-i Use interactive mode.
-l Login shell; also implies interactive mode.
-s The shell reads commands from standard input; all non-option arguments are
positional parameters.
-r Use restricted mode.
In addition to the above, you can use the options described for the set builtin
command on the command line.
Description:
The ksh is a public-domain version of the Korn shell. It’s a command interpreter
that’s intended for both interactive and shell script use.
This shell isn’t the same as the standard QNX 4 shell, which was modeled after
ksh86.
Shell startup
If neither the -c nor the -s option is specified, the first non-option argument specifies
the name of a file the shell reads commands from; if there are no non-option
arguments, the shell reads commands from standard input. The name of the shell (i.e.
the contents of the $0 parameter) is determined as follows: if the -c option is used and
there’s a non-option argument, it’s used as the name; if commands are being read from
a file, the file is used as the name; otherwise the name the shell was called with (i.e.
argv[0]) is used.
A shell is interactive if the -i option is used or if both standard input and standard
error are attached to a tty. An interactive shell has job control enabled (if available),
ignores the SIGINT, SIGQUIT and SIGTERM signals, and prints prompts before
reading input (see PS1 and PS2 parameters). For noninteractive shells, the trackall
option is on by default (see the set command below).
A shell is restricted if the -r option is used or if either the basename of the name the
shell is invoked with or the SHELL parameter match the pattern *r*sh (e.g. rsh,
rksh, and so on). The following restrictions come into effect after the shell processes
any profile and $ENV files:
A shell is privileged if the -p option is used or if the real userid or group ID doesn’t
match the effective userid or group ID (see getuid(), and getgid()). A privileged shell
doesn’t process $HOME/.profile or the ENV environment variable (see below);
instead it processes the /etc/suid_profile file. Clearing the privileged option
causes the shell to set its effective userid (group ID) to its real userid (group ID).
If the basename of the name the shell is called with (i.e. argv[0]) starts with - or if the
-l option is used, the shell is assumed to be a login shell, and the shell reads and
executes the contents of /etc/profile and $HOME/.profile if they exist and
are readable.
If the ENV environment variable is set when the shell starts (or, in the case of login
shells, after any profiles are processed), its value is subjected to parameter, command,
arithmetic and tilde substitution and the resulting file (if any) is read and executed. If
ENV isn’t set (and not null) and ksh was compiled with the DEFAULT_ENV macro
defined, the file named in that macro is included (after the above mentioned
substitutions have been performed).
The exit status of the shell is 127 if the command file specified on the command line
couldn’t be opened, or nonzero if a fatal syntax error occurred during the execution of
a script. In the absence of fatal errors, the exit status is that of the last command
executed, or zero, if no command is executed.
Command syntax
The shell begins parsing its input by breaking it into words. Words, which are
sequences of characters, are delimited by unquoted whitespace characters (space, tab
and newline) or meta-characters (<, >, |, ;, &, ( and )). Aside from delimiting words,
spaces and tabs are ignored, while newlines usually delimit commands. The
meta-characters are used in building the following tokens:
| Creates pipelines.
; Separates commands.
( .. ) Create subshells.
You can quote whitespace and meta-characters individually using backslash (\), or in
groups using double (") or single (’) quotes. Note that the following characters are
also treated specially by the shell and you must quote them if they’re to represent
themselves:
#!/bin/csh
As words and tokens are parsed, the shell builds commands, of which there are two
basic types: simple commands, typically programs that are executed, and compound
commands, such as for and if statements, grouping constructs and function
definitions.
• For external commands, this is related to the status returned by wait() (if the
command couldn’t be found, the exit status is 127, if it couldn’t be executed, the
exit status is 126).
The exit status of a command consisting only of parameter assignments is that of the
last command substitution performed during the parameter assignment, or zero if there
were no command substitutions.
The ? special parameter stores the exit status of the last nonasynchronous command.
For example, you can display the exit status by typing:
echo $?
You can chain commands together using the | token to form pipelines in which the
standard output of each command but the last is piped (see pipe()) to the standard input
of the following command. The exit status of a pipeline is that of its last command.
You can prefix a pipeline with the ! reserved word, which causes the exit status of the
pipeline to be logically complemented: if the original status is 0 the complemented
status is 1, and if the original status isn’t 0, then the complemented status is 0.
You can create lists of commands by separating pipelines by any of the following
tokens:
&&, || Conditional execution: cmd1 && cmd2 executes cmd2 only if the exit status
of cmd1 is zero; || is the opposite — cmd2 is executed only if the exit
status of cmd1 is nonzero.
The && and || tokens have equal precedence, which is higher than that of
&, |& and ;, which also have equal precedence.
& Causes the preceding command to be executed asynchronously, that is, the
shell starts the command, but doesn’t wait for it to complete (the shell does
keep track of the status of asynchronous commands — see “Job control,”
below). When an asynchronous command is started when job control is
disabled (i.e. in most scripts), the command is started with signals INT and
QUIT ignored and with input redirected from /dev/null (however,
redirections specified in the asynchronous command have precedence).
Note that a command must follow the && and || operators, while a command need not
follow &, |& and ;. The exit status of a list is that of the last command executed, with
the exception of asynchronous lists, for which the exit status is 0.
Compound commands
Compound commands are created using the following reserved words. These words
are recognized only if they’re unquoted and are used as the first word of a command
(i.e. you can’t put any parameter assignments or redirections before them):
Some shells (but not this one) execute control structure commands in a subshell when
one or more of their file descriptors are redirected, so any environment changes inside
them may fail. To avoid problems with portability, you should use the exec statement
instead to redirect file descriptors before the control structure.
if list then list [elif list then list] ... [else list] fi
If the exit status of the first list is zero, the second list is
executed; otherwise the list following the elif, if any, is
executed with similar consequences. If all the lists following the
if and elif clauses fail (i.e. exit with nonzero status), the list
following the else is executed.
The exit status of an if statement is that of the nonconditional
list that’s executed; if no nonconditional list is executed, the exit
status is zero.
select name [ in word ... term ] do list done
The select statement provides an automatic method of
presenting the user with a menu and selecting from it. An
enumerated list of the specified words (where term is either a
newline or a ;) is printed on standard error, followed by a
prompt (PS3, normally "#? "). A number corresponding to
one of the enumerated words is then read from standard input,
name is set to the selected word (or is unset if the selection isn’t
• There are two additional binary operators, < and > that return
true if their first string operand is less than or greater than
their second string operand.
• The single argument form of test, which tests if the
argument has nonzero length, isn’t valid; you must always
use explicit operators. For example, instead of:
[ str ]
use:
[[ -n str ]]
Quoting
Quoting is used to prevent the shell from treating characters or words specially:
• A backslash (\) quotes the following character, unless it’s at the end of a line, in
which case both the backslash and the newline are stripped.
• A single quote (’) quotes everything up to the next single quote (this may span
lines).
• A double quote (") quotes all characters, except $, ‘ and \, up to the next unquoted
double quote. The $ and ‘ characters inside double quotes have their usual
meaning (i.e. parameter, command or arithmetic substitution), except no field
splitting is carried out on the results of double-quoted substitutions.
If a \ inside a double-quoted string is followed by \, $, ‘ or ", it’s replaced by the
second character; if it’s followed by a newline, both the \ and the newline are
stripped; otherwise, both the \ and the character following are unchanged.
See “POSIX mode,” below, for a special rule regarding sequences of the form
"...‘...\"...‘...".
Aliases
There are two types of aliases: normal command aliases and tracked aliases.
Command aliases are normally used as shorthand for a long or often used command.
The shell expands command aliases (i.e. substitutes the alias name for its value) when
it reads the first word of a command. An expanded alias is reprocessed to check for
more aliases. If a command alias ends in a space or tab, the following word is also
checked for alias expansion. The alias expansion process stops when a word that isn’t
an alias is found, when a quoted word is found or when an alias word that’s currently
being expanded is found.
The shell automatically defines the following command aliases:
autoload=’typeset -fu’
functions=’typeset -f’
hash=’alias -t’
history=’fc -l’
integer=’typeset -i’
local=’typeset’
login=’exec login’
newgrp=’exec newgrp’
nohup=’nohup ’
r=’fc -e -’
stop=’kill -STOP’
suspend=’kill -STOP $$’
type=’whence -v’
Tracked aliases allow the shell to remember where it found a particular command. The
first time the shell does a path search for a command that’s marked as a tracked alias, it
saves the full path of the command. The next time the command is executed, the shell
checks the saved path to see that it’s still valid, and if so, avoids repeating the path
search. You can create and list tracked aliases by using alias -t.
Changing the PATH parameter clears the saved paths for all tracked aliases.
If the trackall option is set (i.e. set -o trackall or set -h), the shell tracks
all commands. This option is set automatically for noninteractive shells. For
interactive shells, only the following commands are automatically tracked: cat, cc,
chmod, cp, date, grep, ls, make, mv, pr, rm, sed, sh, and who.
Substitution
The first step the shell takes in executing a simple command is to perform substitutions
on the words of the command. There are three kinds of substitution:
If a substitution appears outside of double quotes, the results of the substitution are
generally subject to word or field splitting according to the current value of the IFS
(internal field separators) parameter.
The IFS parameter specifies a list of characters that are used to break a string up into
several words; any characters from the set space, tab and newline that appear in the
IFS characters are called IFS whitespace. Sequences of one or more IFS whitespace
characters, in combination with zero or one non-IFS whitespace characters delimit a
field. As a special case, leading and trailing IFS whitespace is stripped (i.e no leading
or trailing empty field is created by it); leading or trailing non-IFS whitespace does
create an empty field.
For example: if IFS is set to <space>:, the sequence of characters
<space>A<space>:<space><space>B::D contains four fields: A, B, an empty
field, and D. Note that if the IFS parameter is set to the null string, no field splitting is
done; if the parameter is unset, the default value of space, tab, and newline is used.
The results of substitution are, unless otherwise specified, also subject to brace
expansion and filename expansion (see the relevant sections below).
A command substitution is replaced by the output generated by the specified
command, which is run in a subshell. For $(command) substitutions, normal quoting
rules are used when command is parsed, however, for the ‘command‘ form, a \
followed by any of $, ‘ or \ is stripped (a \ followed by any other character is
unchanged).
As a special case in command substitutions, a command of the form < file is
interpreted to mean substitute the contents of file. For example, $(< foo) has the
same effect as $(cat foo), but the former is carried out more efficiently because no
process is started.
Arithmetic substitutions are replaced by the value of the specified expression. For
example, the command echo $((2+3*4)) prints 14. See “Arithmetic expressions”
for a description of an expression.
Parameters
Parameters are shell variables; you can assign values to them and access their values
using a parameter substitution. A parameter name is either one of the special single
punctuation or digit character parameters described below, or a letter followed by zero
or more letters or digits (the underscore (_) counts as a letter). Parameter substitutions
take the form $name or ${name}, where name is a parameter name. If substitution is
performed on a parameter that isn’t set, a null string is substituted unless the nounset
option (set -o nounset or set -u) is set, in which case an error occurs.
You can assign values to parameters in a number of ways:
• The shell implicitly sets some parameters, such as #, PWD, and so on; this is the
only way the special single character parameters are set.
• You can assign values to parameters on the command line. For example, FOO=bar
sets the parameter FOO to bar; you can do multiple parameter assignments on a
single command line and follow them by a simple command, in which case the
assignments are in effect only for the duration of the command (such assignments
are also exported — see below for implications of this).
You must leave both the parameter name and the = unquoted for the shell to recognize
a parameter assignment.
• You can set parameters with the export, readonly, and typeset commands;
see their descriptions in “Command execution and builtin commands.”
• The for and select loops set parameters as well as the getopts, read, and set
-A commands.
• You can assign values to parameters using assignment operators inside arithmetic
expressions (see “Arithmetic expressions,” below) or using the ${name=value}
form of parameter substitution (see below).
Parameters with the export attribute (set using the export or typeset -x
commands, or by parameter assignments followed by simple commands) are put in the
environment (see environ() in the Library Reference) of commands run by the shell as
name=value pairs. The order in which parameters appear in the environment of a
command is unspecified. When the shell starts up, it extracts parameters and their
values from its environment and automatically sets the export attribute for those
parameters.
You can apply modifiers to the ${name} form of parameter substitution:
${name:-word} If name is set and not null, it’s substituted, otherwise word is
substituted.
${name:+word} If name is set and not null, word is substituted, otherwise nothing
is substituted.
${name:=word} If name is set and not null, it’s substituted, otherwise it’s assigned
word and the resulting value of name is substituted.
${name:?word} If name is set and not null, it’s substituted, otherwise word is
printed on standard error (preceded by name:) and an error
occurs (normally causing termination of a shell script, function or
.-script). If word is omitted, the string parameter null or
not set is used instead.
In the above modifiers, you can omit the :, in which case the conditions depend only
on name’s being set (as opposed to set and not null). If word is needed, parameter,
command, arithmetic and tilde substitution are performed on it; if word isn’t needed, it
isn’t evaluated.
You can also use the following forms of parameter substitution:
${name%pattern}
${name%%pattern} Like ${...#...} substitution, but it deletes from the end of
the value.
The shell implicitly set the following special parameters; you can’t set them directly
using assignments:
$ The process ID of the shell, or the PID of the original shell if it’s a
subshell.
- The concatenation of the current single letter options (see the set
command below for a list of options).
? The exit status of the last nonasynchronous command executed. If the last
command was killed by a signal, $? is set to 128 plus the signal number.
0 The name the shell was invoked with (i.e. argv[0]), or the command-name
if it was invoked with the -c option and the command-name was supplied,
or the file argument, if it was supplied. If the posix option isn’t set, $0 is
the name of the current function or script.
1 ... 9 The first nine positional parameters that were supplied to the shell,
function or .-script. You can access further positional parameters by using
${number}.
@ Same as $*, unless it’s used inside double quotes, in which case a separate
word is generated for each positional parameter — if there are no
positional parameters, no word is generated (you can use $@ to access
arguments, verbatim, without losing null arguments or splitting arguments
with spaces).
CDPATH The search path for the cd builtin command. Works the same
way as PATH for those directories not beginning with / in cd
commands. Note that if CDPATH is set and doesn’t contain .
or an empty path, the current directory isn’t searched.
EDITOR If the VISUAL parameter isn’t set, this parameter controls the
command line editing mode for interactive shells. See VISUAL
parameter below for how this works.
HISTFILE The name of the file used to store history. When assigned to,
history is loaded from the specified file. Also, several
invocations of the shell running on the same machine share
their history if their HISTFILE parameters all point at the
same file.
If HISTFILE isn’t set, no history file is used. This is different from the original Korn
shell, which uses $HOME/.sh_history; in the future, ksh may also use a default
history file.
HOME The default directory for the cd command and the value
substituted for an unqualified ˜ (see “Tilde expansion,” below).
This parameter isn’t imported from the environment when the shell is started.
KSH_VERSION The version of shell and the date the version was created
(readonly). See also the version commands in “emacs
interactive input-line editing” below.
MAIL If set, you’re told of the arrival of mail in the named file. This
parameter is ignored if the MAILPATH parameter is set.
MAILCHECK How often, in seconds, the shell checks for mail in the file(s)
specified by MAIL or MAILPATH. If 0, the shell checks
before each prompt. The default is 600 (10 minutes).
OPTARG When using getopts, this parameter contains the argument for
a parsed option, if it requires one.
OPTIND The index of the last argument processed when using getopts.
Assigning 1 to this parameter causes getopts to process
arguments from the beginning the next time it’s invoked.
POSIXLY_CORRECT
If set, this parameter causes the posix option to be enabled.
See “POSIX mode,” below.
PS2 Secondary prompt string, by default "> ", used when more
input is needed to complete a command.
PWD The current working directory. May be unset or null if the shell
doesn’t know where it is.
SECONDS The number of seconds since the shell started or, if the
parameter has been assigned an integer value, the number of
seconds since the assignment plus the value that was assigned.
Tilde expansion
Tilde expansion, which is done in parallel with parameter substitution, is done on
words starting with an unquoted ˜. The characters following the tilde, up to the first
slash (/), if any, are assumed to be a login name. If the login name is empty, + or -,
the value of the HOME, PWD, or OLDPWD parameter is substituted, respectively.
Otherwise, the password file is searched for the login name, and the tilde expression is
substituted with the user’s home directory. If the login name isn’t found in the
password file or if any quoting or parameter substitution occurs in the login name, no
substitution is performed.
In parameter assignments (those preceding a simple command or those occurring in
the arguments of alias, export, readonly, and typeset), tilde expansion is done
after any unquoted colon (:), and login names are also delimited by colons.
The home directory of previously expanded login names are cached and reused. You
can use the alias -d command to list, change and add directory aliases to this cache.
For example:
prefix{str1,...,strN}suffix
are expanded to N words, each of which is the concatenation of prefix, stri and suffix.
For example, a{c,b{X,Y},d}e expands to four words: ace, abXe, abYe, and ade).
As noted in the example, you can nest brace expressions, and the resulting words
aren’t sorted. Brace expressions must contain an unquoted comma (,) for expansion to
occur (i.e. {} and {foo} aren’t expanded). Brace expansion is carried out after
parameter substitution and before filename generation.
Filename patterns
A filename pattern is a word containing one or more unquoted ? or * characters or
[...] sequences. Once brace expansion has been performed, the shell replaces
filename patterns with the sorted names of all the files that match the pattern (if no
files match, the word is left unchanged). The pattern elements have the following
meanings:
[...] Matches any of the characters inside the brackets. You can specify ranges
of characters by separating two characters with a -. For example,
[a0-9] matches the letter a or any digit. In order for a - to represent
itself, you must either quote it or use it as the first or last character in the
character list. Similarly, you must quote a ] or use it as the first character
in the list if it’s to represent itself instead of the end of the list.
Also, a ! appearing at the start of the list has special meaning (see
below), so to represent itself, you must quote it or use it later in the list.
[!...] Like [...], except it matches any character not inside the brackets.
Note that none of the above pattern elements match either a period (.) at the start of a
filename or a slash (/), even if they are explicitly used in a [...] sequence.
CAUTION: In QNX Neutrino 6.5.0 and later, the pattern .* matches the . and ..
! names. This could cause problems with scripts that assume that the shell never
matches these names.
If the markdirs option is set, any directories that result from filename generation are
marked with a trailing /.
The POSIX character classes (i.e [:class-name:] inside a [...] expression) aren’t
yet implemented.
Input/output redirection
When a command is executed, its standard input, standard output and standard error
(file descriptors 0, 1 and 2, respectively) are normally inherited from the shell. Three
exceptions to this are commands in pipelines, for which standard input and/or standard
output are those set up by the pipeline, asynchronous commands created when job
control is disabled, for which standard input is initially set to be from /dev/null,
and commands for which any of the following redirections have been specified:
> file Standard output is redirected to file. If file doesn’t exist, it’s created; if
it does exist, is a regular file and the noclobber option is set, an
error occurs, otherwise the file is truncated. Note that this means the
command cmd < foo > foo opens foo for reading and then
truncates it when it opens it for writing, before cmd gets a chance to
actually read it.
>| file Same as >, except the file is truncated, even if the noclobber option
is set.
>> file Same as >, except an existing file is appended to instead of being
truncated. Also, the file is opened in append mode, so writes always
go to the end of the file (see open()).
< file Standard input is redirected from file, which is opened for reading.
<> file Same as <, except the file is opened for reading and writing.
<< marker After reading the command line containing this kind of redirection
(called a here document), the shell copies lines from the command
source into a temporary file until a line matching marker is read.
When the command is executed, standard input is redirected from the
temporary file.
The line at the end of the “here document” must match marker exactly; it must not
have any leading or trailing whitespace characters.
If marker contains no quoted characters, the contents of the
temporary file are processed as if enclosed in double quotes each time
the command is executed, so parameter, command and arithmetic
substitutions are performed, along with backslash (\) escapes for $, ‘,
\ and \newline. If multiple here documents are used on the same
command line, they’re saved in order.
<<- marker Same as <<, except leading tabs are stripped from lines in the here
document.
<& fd Standard input is duplicated from file descriptor fd. The fd can be a
single digit, indicating the number of an existing file descriptor, the
letter p, indicating the file descriptor associated with the output of the
current coprocess, or the character -, indicating standard input is to
be closed.
In any of the above redirections, you can explicitly give the file descriptor that’s
redirected (i.e. standard input or standard output) by preceding the redirection with a
single digit. Parameter, command and arithmetic substitutions, tilde substitutions and
filename generation are all performed on the file, marker and fd arguments of
redirections. Note however, that the results of any filename generation are only used if
a single file is matched; if multiple files match, the word with the unexpanded filename
generation characters is used. Note that in restricted shells, you can’t use redirections
that can create files.
For simple commands, redirections may appear anywhere in the command; for
compound commands (if statements, and so on), any redirections must appear at the
end. Redirections are processed after pipelines are created and in the order they are
given, so:
Arithmetic expressions
You can use integer arithmetic expressions with the let command, inside $((...))
expressions, inside array references (e.g. name[expr]), as numeric arguments to the
test command, and as the value of an assignment to an integer parameter.
Expressions may contain alphanumeric parameter identifiers, array references, and
integer constants. You can combine expressions with the following C operators (listed
and grouped in increasing order of precedence):
Unary operators + - ! ˜ ++ --
Binary operators ,
= *= /= %= += -= <<= >>= &= ˆ= |=
||
&&
|
ˆ
&
== !=
< <= >= >
<< >>
+ -
* / %
Grouping operators
( )
You can specify integer constants with arbitrary bases by using the notation
base#number, where base is a decimal integer specifying the base, and number is a
number in the specified base.
The operators are evaluated as follows:
Unary - Negation.
= Assignment; the variable on the left is set to the value on the right.
&& Logical AND; the result is 1 if both arguments are nonzero, 0 if not. The
right argument is evaluated only if the left argument is nonzero.
< Less than; the result is 1 if the left argument is less than the right, 0 if
not.
<= >= > Less than or equal, greater than or equal, greater than. See <.
<< >> Shift left (right); the result is the left argument with its bits shifted left
(right) by the amount given in the right argument.
Coprocesses
A coprocess, which is a pipeline created with the |& operator, is an asynchronous
process that the shell can both write to (using print -p) and read from (using read
-p). The input and output of the coprocess can also be manipulated using >&p and
<&p redirections, respectively. Once a coprocess has been started, another can’t be
started until the coprocess exits, or until the coprocess input has been redirected using
an exec n>&p redirection. If a coprocess’s input is redirected in this way, the next
coprocess to be started shares the output with the first coprocess, unless the output of
the initial coprocess has been redirected using an exec n<&p redirection.
Some notes concerning coprocesses:
• The only way to close the coprocess input (so the coprocess reads an end-of-file) is
to redirect the input to a numbered file descriptor and then close that file descriptor
(e.g. exec 3>&p;exec 3>&-).
• In order for coprocesses to share a common output, the shell must keep the write
portion of the output pipe open. This means that end of file won’t be detected until
all coprocesses sharing the coprocess output have exited (when they all exit, the
shell closes its copy of the pipe). You can avoid this by redirecting the output to a
numbered file descriptor (as this also causes the shell to close its copy).
This behavior is slightly different from the original Korn shell, which closes its copy
of the write portion of the coprocess’s output when the most recently started coprocess
(instead of when all sharing coprocesses) exits.
• The print -p command ignores SIGPIPE signals during writes if the signal isn’t
being trapped or ignored; the same isn’t true if the coprocess input has been
duplicated to another file descriptor and print -un is used.
Functions
Functions are defined using either Korn shell function name syntax or the
Bourne/POSIX shell name() syntax (see below for the difference between the two
forms). Functions are like .-scripts in that they are executed in the current
environment, however, unlike .-scripts, shell arguments (i.e. positional parameters, $1,
and so on) are never visible inside them. When the shell is determining the location of
a command, functions are searched after special builtin commands, and before regular
and nonregular builtins, and before the PATH is searched.
You can delete an existing function by using unset -f function-name. You can list
the functions by executing typeset +f, and list the function definitions by executing
typeset -f. You can use the autoload command (which is an alias for typeset
-fu) to create undefined functions; when an undefined function is executed, the shell
searches the path specified in the FPATH parameter for a file with the same name as
the function, which, if found is read and executed. If after executing the file, the
named function is found to be defined, the function is executed, otherwise, the normal
command search is continued (i.e. the shell searches the regular builtin command table
and PATH). Note that if a command isn’t found using PATH, the shell tries to
• The $0 parameter is set to the name of the function (Bourne-style functions leave
$0 untouched).
• Parameter assignments preceding function calls aren’t kept in the shell environment
(executing Bourne-style functions keeps assignments).
• OPTIND is saved/reset and restored on entry and exit from the function so you can
use getopts properly both inside and outside the function (Bourne-style functions
leave OPTIND untouched, so using getopts inside a function interferes with
using getopts outside the function).
• The EXIT trap, if set in a function, will be executed after the function returns.
POSIX mode
The shell is intended to be POSIX compliant, however, in some cases, POSIX
behavior is contrary either to the original Korn shell behavior or to user convenience.
How the shell behaves in these cases is determined by the state of the posix option
(set -o posix); if it’s on, the POSIX behavior is followed, otherwise it isn’t. The
posix option is set automatically when the shell starts up if the environment contains
the POSIXLY_CORRECT parameter. (The shell can also be compiled so that it’s in
POSIX mode by default, however this usually isn’t desirable).
The following is a list of things that are affected by the state of the posix option:
kill -l output In POSIX mode, signal names are listed one a single line; in
non-POSIX mode, signal numbers, names and descriptions are
printed in columns. In future, a new option (-v perhaps) will be
added to distinguish the two behaviors.
set exit status In POSIX mode, the exit status of set is 0 if there are no errors;
in non-POSIX mode, the exit status is that of any command
substitutions performed in generating the set command. For
example, set -- ‘false‘; echo $? prints 0 in POSIX
mode, 1 in non-POSIX mode. This construct is used in most
shell scripts that use the old getopt command.
Signal specification
In POSIX mode, you can specify signals as digits only if the
signal numbers match POSIX values (i.e. SIGHUP=1, SIGINT=2,
SIGQUIT=3, SIGABRT=6, SIGKILL=9, SIGALRM=14, and
SIGTERM=15); in non-POSIX mode, signals can always be
digits.
Alias expansion In POSIX mode, alias expansion is only carried out when reading
command words; in non-POSIX mode, alias expansion is carried
out on any word following an alias that ended in a space. For
example, the following for loop:
1 Special builtin
2 Function
3 Regular builtin
Special builtin commands differ from other commands in that the PATH parameter
isn’t used to find them, an error during their execution can cause a noninteractive shell
to exit and parameter assignments that are specified before the command are kept after
the command completes. Just to confuse things, if the posix option is turned off (see
set command below) some special commands are very special in that no field
splitting, file globing, brace expansion nor tilde expansion is performed on arguments
that look like assignments. Regular builtin commands are different only in that the
PATH parameter isn’t used to find them.
The original ksh and POSIX differ somewhat in which commands are considered
special or regular.
The POSIX special commands are:
In the future, the additional ksh special and regular commands may be treated
differently from the POSIX special and regular commands.
Once the type of the command has been determined, any command-line parameter
assignments are performed and exported for the duration of the command.
The following sections describe the builtin commands:
Execute the commands in file in the current environment. The file is searched for in
the directories of PATH. If arguments are given, you can use the positional parameters
to access them while file is being executed. If no arguments are given, the positional
parameters are those of the environment the command is used in.
Without arguments, alias lists all aliases. For any name without a value, the existing
alias is listed. Any name with a value defines an alias (see “Aliases,” above).
When listing aliases, one of two formats is used:
• If options were preceded with + or a lone + is given on the command line, only
name is printed.
In addition, if the -p option is used, each alias is prefixed with the string alias .
The -x option sets (+x clears) the export attribute of an alias, or, if no names are
given, lists the aliases with the export attribute (exporting an alias has no affect).
The -t option indicates that tracked aliases are to be listed/set (values specified on the
command line are ignored for tracked aliases). The -r option indicates that all tracked
aliases are to be reset.
The -d option causes directory aliases, which are used in tilde expansion, to be listed
or set (see “Tilde expansion,” above).
bg builtin command
bg [job ...]
Resume the specified stopped job(s) in the background. If no jobs are specified, %+ is
assumed. This command is only available on systems that support job control. See
“Job control,” below, for more information.
cd builtin command
cd [-LP] [dir]
Set the working directory to dir. If the parameter CDPATH is set, it lists the search
path for the directory containing dir. A null path means the current directory. If dir is
missing, the home directory $HOME is used. If dir is -, the previous working
directory is used (see OLDPWD parameter). If -L option (logical path) is used or if
the physical option (see the set command below) isn’t set, references to .. in dir
are relative to the path used to get to the directory. If -P option (physical path) is used
or if the physical option is set, .. is relative to the filesystem directory tree. The
PWD and OLDPWD parameters are updated to reflect the current and old working
directory, respectively.
cd [-LP] old new
The string new is substituted for old in the current directory, and the shell attempts to
change to the new directory.
If neither the -v nor -V option is given, cmd is executed exactly as if the command
hadn’t been specified, with two exceptions:
• Special builtin commands lose their specialness (i.e redirection and utility errors
don’t cause the shell to exit, and command assignments aren’t permanent).
If you specify the -p option, a default search path is used instead of the current value
of PATH. The actual value of the default path is system-dependent: on POSIXish
systems, it’s the value returned by:
getconf _CS_PATH
If the -v option is given, instead of executing cmd, information about what would be
executed is given (and the same is done for arg . . . ): for special and regular builtin
commands and functions, their names are simply printed, for aliases, a command that
defines them is printed, and for commands found by searching the PATH parameter,
the full path of the command is printed. If no command is found, (i.e. the path search
fails), nothing is printed and command exits with a nonzero status. The -V option is
like the -v option, except it’s more verbose.
Jump to the beginning of the levelth innermost for, select, until, or while loop.
The level defaults to 1.
Concatenate the arguments (with spaces between them) to form a single string that the
shell then parses and executes in the current environment.
Exit from the shell with the specified exit status. If status isn’t specified, the exit status
is the current value of the ? parameter.
Set the export attribute of the named parameters. Exported parameters are passed in
the environment to executed commands. If values are specified, the named parameters
also assigned.
If no parameters are specified, the names of all parameters with the export attribute are
printed one per line, unless the -p option is used, in which case export commands
defining all exported parameters, including their values, are printed.
fc builtin command
fc [-e editor | -l [-n]] [-r] [first [last]]
The first and last arguments select commands from the history. You can select
commands by history number, or a string specifying the most recent command starting
with that string. The -l option lists the command on stdout, and -n inhibits the
default command numbers. The -r option reverses the order of the list. Without -l,
the selected commands are edited by the editor specified with the -e option, or if no
-e is specified, the editor specified by the FCEDIT parameter (if this parameter isn’t
set, /bin/ed is used), and then executed by the shell.
Reexecute the selected command (the previous command by default) after performing
the optional substitution of old with new. If -g is specified, all occurrences of old are
replaced with new. This command is usually accessed with the predefined alias r=’fc
-e -’.
fg builtin command
fg [job ...]
Resume the specified job(s) in the foreground. If no jobs are specified, %+ is assumed.
This command is available only on systems that support job control. See “Job
control,” below, for more information.
The getopts command is used by shell procedures to parse the specified arguments
(or positional parameters, if no arguments are given) and to check for legal options.
The optstring argument contains the option letters that getopts is to recognize. If a
letter is followed by a colon, the option is expected to have an argument. You can
group options that don’t take arguments into a single argument. If an option takes an
argument and the option character isn’t the last character of the argument it’s found in,
the remainder of the argument is taken to be the option’s argument, otherwise, the next
argument is the option’s argument.
Each time getopts is invoked, it places the next option in the shell parameter name
and the index of the next argument to be processed in the shell parameter OPTIND. If
the option was introduced with a +, the option placed in name is prefixed with a +.
When an option requires an argument, getopts places it in the shell parameter
OPTARG. When an illegal option or a missing option argument is encountered, a
question mark or a colon is placed in name (indicating an illegal option or missing
argument, respectively) and OPTARG is set to the option character that caused the
problem. An error message is also printed to standard error if optstring doesn’t begin
with a colon.
When the end of the options is encountered, getopts exits with a nonzero exit status.
Options end at the first (non-option argument) argument that doesn’t start with a -, or
when a -- argument is encountered.
You can reset option parsing by setting OPTIND to 1 (this is done automatically
whenever the shell or a shell procedure is invoked).
CAUTION: Changing the value of the shell parameter OPTIND to a value other than
! 1, or parsing different sets of arguments without resetting OPTIND may lead to
unexpected results.
Without arguments, any hashed executable command pathnames are listed. The -r
option causes all hashed commands to be removed from the hash table. If you specify
any names, the shell searches for each one as if it were a command name, and adds the
name to the hash table if it’s an executable command.
Display information about the specified jobs; if no jobs are specified, all jobs are
displayed. The -n option causes information to be displayed only for jobs that have
changed state since the last notification. If the -l option is used, the process ID of each
process in a job is also listed. The -p option causes only the process group of each job
to be printed. See “Job control,” below, for the format of job and the displayed job.
Send the specified signal to the specified jobs, process IDs, or process groups. If no
signal is specified, the signal TERM is sent. If a job is specified, the signal is sent to
the job’s process group. See “Job control,” below, for the format of job.
kill -l [exit-status ...]
Print the name of the signal that killed a process that exited with the specified
exit-statuses. If no arguments are specified, a list of all the signals, their numbers and a
short description of them are printed.
This command is also available as an executable; see kill.
If an error occurs during the parsing or evaluation of an expression, the exit status is
greater than 1.
Since expressions may need to be quoted, (( expr )) is syntactic sugar for let
"expr".
Print the arguments on the standard output, separated by spaces, and terminated with a
newline. The -n option suppresses the newline. By default, certain C escapes are
translated. These include \b, \f, \n, \r, \t, \v, and \0### (# is an octal digit, of
which there may be 0 to 3). \c is equivalent to using the -n option. You can inhibit
backslash expansion by using the -r option. The -s option prints to the history file
instead of standard output, the -u option prints to file descriptor n (n defaults to 1 if
omitted), and the -p option prints to the coprocess (see “Coprocesses,” above).
The -R option is used to emulate, to some degree, the BSD echo command, which
doesn’t process \ sequences unless the -e option is given. As above, the -n option
suppresses the trailing newline.
Print the present working directory. If -L option is used or if the physical option
(see the set command below) isn’t set, the logical path is printed (i.e. the path used to
cd to the current directory). If -P option (physical path) is used or if the physical
option is set, the path determined from the filesystem (by following .. directories to
the root directory) is printed.
This command is also available as an executable; see pwd.
Read a line of input from standard input, separate the line into fields using the IFS
parameter (see “Substitution,” above), and assign each field to the specified
parameters. If there are more parameters than fields, the extra parameters are set to
null, or alternatively, if there are more fields than parameters, the last parameter is
assigned the remaining fields (inclusive of any separating spaces). If no parameters are
specified, the REPLY parameter is used. If the input-line ends in a backslash and the
-r option wasn’t used, the backslash and newline are stripped and more input is read.
If no input is read, read exits with a nonzero status.
The first parameter may have a question mark and a string appended to it, in which
case the string is used as a prompt (printed to standard error before any input is read) if
the input is a tty (e.g. read nfoo?’number of foos: ’).
The -un and -p options cause input to be read from file descriptor n or the current
coprocess (see “Coprocesses,” above, for comments on this), respectively. If the -s
option is used, input is saved to the history file.
Set the readonly attribute of the named parameters. If values are given, parameters are
set to them before setting the attribute. Once a parameter is made readonly, it can’t be
unset and its value can’t be changed.
If no parameters are specified, the names of all parameters with the readonly attribute
are printed one per line, unless the -p option is used, in which case readonly
commands defining all readonly parameters, including their values, are printed.
Return from a function or . script, with exit status status. If no status is given, the exit
status of the last executed command is used. If used outside of a function or . script, it
has the same effect as exit. Note that ksh treats both profile and $ENV files as .
scripts, while the original Korn shell only treats profiles as . scripts.
You can use the set command to set (-) or clear (+) shell options, set the positional
parameters, or set an array parameter. You can change options by using the +-o option
syntax, where option is the long name of an option, or by using the +-letter syntax,
where letter is the option’s single letter name (not all options have a single letter
name). The following table lists both option letters (if they exist) and long names
along with a description of what the option does.
continued. . .
continued. . .
These options can also be used upon invocation of the shell. You can find the current
set of options (with single letter names) in the parameter -. The set -o command
with no option name lists all the options and whether each is on or off; set +o prints
the long names of all options that are currently on.
Remaining arguments, if any, are positional parameters and are assigned, in order, to
the positional parameters (i.e. 1, 2, and so on). If options are ended with -- and there
are no remaining arguments, all positional parameters are cleared. If no options or
arguments are given, then the values of all names are printed. For unknown historical
reasons, a lone - option is treated specially: it clears both the -x and -v options.
or:
[ expression ]
Evaluate the expression and return zero status if true, and 1 status if false and greater
than 1 if there was an error. It’s normally used as the condition command of if and
while statements.
Calling an executable file test is a common mistake. If you don’t specify the path to
the file, the builtin command is executed.
str The str has nonzero length. Note that there is the potential for
problems if str turns out to be an operator (e.g. -r) — it’s
generally better to use a test like:
[ X"str" != X ]
instead (double quotes are used in case str contains spaces or file
globing characters).
-o option The shell option is set (see the set command above for list of
options). As a nonstandard extension, if the option starts with a !,
the test is negated; the test always fails if option doesn’t exist
(thus:
[ -o foo -o -o !foo ]
returns true if and only if option foo exists).
file -nt file The first file is newer than the second file.
file -ot file The first file is older than the second file.
file -ef file The first file is the same file as the second file.
-t [fd] The file descriptor is a tty device. If the posix option (set -o
posix, see “POSIX mode,” above) isn’t set, you can leave out the
fd, in which case it’s taken to be 1 (the behavior differs due to the
special POSIX rules described below).
You can combine the above basic expressions, in which unary operators have
precedence over binary operators, with the following operators (listed in increasing
order of precedence):
( expr ) Grouping.
Print the accumulated user and system times used by the shell and by processes which
have exited that the shell started.
Set the trap handler that’s to be executed when any of the specified signals are
received.
The handler is either a null string, indicating the signals are to be ignored, a minus (-),
indicating that the default action is to be taken for the signals (see signal()), or a string
containing shell commands to be evaluated and executed at the first opportunity (i.e.
when the current command completes, or before printing the next PS1 prompt) after
receipt of one of the signals.
The signal is the name of a signal (e.g. SIGPIPE or SIGALRM) or the number of the
signal (see the kill -l command above). There are two special signals:
• EXIT (also known as 0), which is executed when the shell is about to exit
• ERR which is executed after an error occurs (an error is something that causes the
shell to exit if the -e or errexit option is set — see the set command above).
EXIT handlers are executed in the environment of the last executed command. Note
that for noninteractive shells, the trap handler can’t be changed for signals that were
ignored when the shell started.
With no arguments, trap lists, as a series of trap commands, the current state of the
traps that have been set since the shell started.
The original Korn shell’s DEBUG trap and the handling of ERR and EXIT traps in
functions aren’t yet implemented.
Display or set parameter attributes. With no name arguments, parameter attributes are
displayed: if no options are used, the current attributes of all parameters are printed as
typeset commands; if an option is given (or - with no option letter) all parameters
and their values with the specified attributes are printed; if options are introduced with
+, parameter values aren’t printed.
If name arguments are given, the attributes of the named parameters are set (-) or
cleared (+). Values for parameters may optionally be specified. If typeset is used
inside a function, any newly created parameters are local to the function.
When -f is used, typeset operates on the attributes of functions. As with
parameters, if no names are given, functions are listed with their values (i.e.
definitions) unless options are introduced with +, in which case only the function
names are reported.
The options are:
-Ln Left justify attribute: n specifies the field width. If n isn’t specified, the
current width of a parameter (or the width of its first assigned value) is used.
Leading white space (and zeros, if used with the -Z option) is stripped. If
necessary, values are either truncated or space padded to fit the field width.
-Rn Right justify attribute: n specifies the field width. If n isn’t specified, the
current width of a parameter (or the width of its first assigned value) is used.
Trailing white space are stripped. If necessary, values are either stripped of
leading characters or space padded to make them fit the field width.
-Zn Zero fill attribute: if not combined with -L, this is the same as -R, except zero
padding is used instead of space padding.
-in Integer attribute: n specifies the base to use when displaying the integer (if not
specified, the base given in the first assignment is used). You can use
arithmetic expressions to assign values to parameters that have this attribute.
-U Unsigned integer attribute: integers are printed as unsigned values (only
useful when combined with the -i option). This option isn’t in the original
Korn shell.
-l Lower case attribute: all upper case characters in values are converted to
lower case. (In the original Korn shell, this parameter meant “long integer”
when used with the -i option).
-p Print complete typeset commands that you can use to recreate the attributes
(but not the values) of parameters. This is the default action (option exists for
ksh93 compatibility).
-r Readonly attribute: parameters with the this attribute may not be assigned to
or unset. Once this attribute is set, it can not be turned off.
-t Tag attribute: has no meaning to the shell; provided for application use.
For functions, -t is the trace attribute. When functions with the trace attribute
are executed, the xtrace (-x) shell option is temporarily turned on.
-u Upper case attribute: all lower case characters in values are converted to
upper case. (In the original Korn shell, this parameter meant “unsigned
integer” when used with the -i option, which meant uppercase letters would
never be used for bases greater than 10. See the -U option).
For functions, -u is the undefined attribute. See “Functions,” above for the
implications of this.
Display or set process limits. If no options are used, the file size limit (-f) is assumed.
The value, if specified, may be either be an arithmetic expression or the word
unlimited. The limits affect the shell and any processes created by the shell after
they’re imposed. Note that some systems may not allow limits to be increased once
they are set. Also note that the types of limits available are system dependent — some
systems have only the -f limit.
The options are:
-H Set the hard limit only (default is to set both hard and soft limits).
-S Set the soft limit only (default is to set both hard and soft limits).
-f Impose a size limit of n blocks on files written by the shell and its child
processes (files of any size may be read).
-p Impose a limit of n processes that can be run by the user at any one time.
Display or set the file permission creation mask, or umask (see umask). If the -S
option is used, the mask displayed or set is symbolic, otherwise it’s an octal number.
This command is also available as an executable; see umask.
Symbolic masks are like those used by chmod:
[ugoa]{{=+-}{rwx}*}+[,...]
in which the first group of characters is the who part, the second group is the op part,
and the last group is the perm part. The who part specifies which part of the umask is
to be modified. The letters mean:
= Set.
+ Added to.
- Removed from.
The perm part specifies which permissions are to be set, added or removed:
r Read permission.
w Write permission.
x Execute permission.
When symbolic masks are used, they describe what permissions may be made
available (as opposed to octal masks in which a set bit means the corresponding bit is
to be cleared). For example, ug=rwx,o= sets the mask so files won’t be readable,
writable or executable by “others”, and is equivalent (on most systems) to the octal
mask 07.
Job control
Job control refers to the shell’s ability to monitor and control jobs, which are processes
or groups of processes created for commands or pipelines. At a minimum, the shell
keeps track of the status of the background (i.e. asynchronous) jobs that currently
exist; you can display this information by using the jobs command. If job control is
fully enabled (using set -m or set -o monitor), as it is for interactive shells, the
processes of a job are placed in their own process group, you can stop foreground jobs
by typing the suspend character from the terminal (normally Ctrl-Z), you can restart
jobs in either the foreground or background, using the fg and bg commands, and the
state of the terminal is saved or restored when a foreground job is stopped or restarted.
Note that you can stop only commands that create processes (e.g. asynchronous
commands, subshell commands, and nonbuiltin, nonfunction commands); you can’t
stop commands such as read.
When a job is created, it’s assigned a job number. For interactive shells, this number is
printed inside [...], followed by the process IDs of the processes in the job when an
asynchronous command is run. You can refer to a job in the bg, fg, jobs, kill and
wait commands either by the process ID of the last process in the command pipeline
(as stored in the $! parameter) or by prefixing the job number with a percent sign (%).
You can also use other percent sequences to refer to jobs:
%+ The most recently stopped job, or, if there are no stopped jobs, the oldest
running job.
%%, % Same as %.
%- The job that would be the %+ job, if the latter didn’t exist.
%?string The job containing the string string (an error occurs if multiple jobs are
matched).
%string The job starting with string string (an error occurs if multiple jobs are
matched).
When a job changes state (e.g. a background job finishes or foreground job is
stopped), the shell prints the following status information:
command The command that created the process. If there are multiple processes in
the job, then each process has a line showing its command and possibly
its status, if it’s different from the status of the previous process.
When an attempt is made to exit the shell while there are jobs in the stopped state, the
shell warns the user that there are stopped jobs and doesn’t exit. If another attempt is
immediately made to exit the shell, the stopped jobs are sent a SIGHUP signal and the
shell exits. Similarly, if the nohup option isn’t set and there are running jobs when an
attempt is made to exit a login shell, the shell warns the user and doesn’t exit. If
another attempt is immediately made to exit the shell, the running jobs are sent a
SIGHUP signal and the shell exits.
CAUTION: This mode is slightly different from the emacs mode in the original Korn
! shell; the 8th bit is stripped in emacs mode.
In this mode, various editing commands (typically bound to one or more control
characters) cause immediate actions without waiting for a new-line. Several editing
commands are bound to particular control characters when the shell is invoked; you
can use the following commands to change these bindings:
bind string=[editing-command]
Bind the specified editing command to the given string, which should
consist of a control character (which you can write using caret notation
ˆX), optionally preceded by one of the two prefix characters.
After invoking the bind command, typing the string causes the editing
command to be immediately invoked. Note that although only two
bind -l List the names of the functions to which keys may be bound.
bind -m string=[substitute]
The specified input string is afterward immediately replaced by the
given substitute string, which may contain editing commands.
The editing commands are listed below. Each description starts with the name of the
command, a n (if you can prefix the command with a count), and any keys the
command is bound to by default (written using caret notation, e.g. ASCII ESC
character is written as ˆ[). You can enter a count prefix for a command by using the
sequence ˆ[n, where n is a sequence of 1 or more digits; unless otherwise specified, if
a count is omitted, it defaults to 1. Note that editing command names are used only
with the bind command. Furthermore, many editing commands are useful only on
terminals with a visible cursor. The default bindings were chosen to resemble
corresponding emacs key bindings. The user’s tty characters (e.g. ERASE) are bound
to reasonable substitutes and override the default bindings.
beginning-of-line
Key binding: ˆA
Moves the cursor to the beginning of the edited input line.
capitalize-word n
Key binding: ˆ[c or ˆ[C
Uppercase the first character in the next n words, leaving the
cursor past the end of the last word.
If the current line doesn’t begin with a comment character, one
is added at the beginning of the line and the line is entered (as if
return had been pressed), otherwise the existing comment
characters are removed and the cursor is placed at the
beginning of the line.
complete-command
Key binding: ˆXˆ[
Automatically completes as much as is unique of the command
name having the partial word up to the cursor as its prefix, as in
the complete command described above.
delete-char-backward n
Key binding: ERASE, ˆ?, ˆH
Deletes n characters before the cursor.
delete-char-forward n
Key binding: none
Deletes n characters after the cursor.
delete-word-backward n
Key binding: ˆ[ERASE, ˆ[ˆ?, ˆ[ˆH, ˆ[h
Deletes n words before the cursor.
delete-word-forward n
Key binding: ˆ[d
Deletes characters after the cursor up to the end of n words.
newline-and-next
Key binding: ˆO
Causes the current input line to be processed by the shell, and
the next line from history becomes the current line. This is
useful only after an up-history or search-history.
Files:
• ˜/.profile
• /etc/profile
• /etc/suid_profile
Contributing author:
This shell is based on the public domain 7th edition Bourne shell clone by Charles
Forsyth and parts of the BRL shell by Doug A. Gwyn, Doug Kingston, Ron Natalie,
Arnold Robbins, Lou Salkind and others. The first release of pdksh was created by
Eric Gisin, and it was subsequently maintained by John R. MacMillan
(chance!john@sq.sq.com), and Simon J. Gerraty (sjg@zen.void.oz.au). The
current maintainer is Michael Rendell (michael@cs.mun.ca). The
CONTRIBUTORS file in the source distribution contains a more complete list of
people and their part in the shell’s development.
Report any bugs in ksh to pdksh@cs.mun.ca. Please include the version of ksh
(echo $KSH_VERSION shows it), the machine, operating system and compiler you
are using and a description of how to repeat the bug (a small shell script that
demonstrates the bug is best). The following, if relevant (if you aren’t sure, include
them), can also helpful: options you are using (both options.h options and set -o
options) and a copy of your config.h (the file generated by the configure script).
You can get new versions of ksh from ftp.cs.mun.ca:pub/pdksh/.
See also:
chmod, esh, fesh, gawk, getconf, rsh, sed, sh, stty, uesh, umask
dup(), environ(), errno, execve(), getgid(), getopt(), getuid(), open(), pipe(), rand(),
signal(), system(), wait() in the Library Reference
Using the Command Line and Writing Shell Scripts in the Neutrino User’s Guide
“Setting PATH and LD_LIBRARY_PATH” in the Configuring Your Environment
chapter of the Neutrino User’s Guide
The Korn Shell Command and Programming Language, Morris Bolsky and David
Korn, 1989, ISBN 0-13-516972-0.
UNIX Shell Programming, Stephen G. Kochan, Patrick H. Wood, Hayden.
IEEE Standard for Information Technology — Portable Operating System Interface
(POSIX) — Part 2: Shell and Utilities, IEEE Inc, 1993, ISBN 1-55937-255-9.
Syntax:
ld_variant [option...] objfile
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
The ld_variant depends on the target platform, as follows:
Description:
The ld linker combines a number of object and archive files, relocates their data, and
ties up symbol references. Usually the last step in compiling a program is to run ld.
For detailed documentation, see the GNU website at http://www.gnu.org/.
Contributing author:
GNU
See also:
qcc
dlopen() in the QNX Neutrino Library Reference
Syntax:
ldd program ...
Runs on:
Neutrino
Options:
None.
Description:
The ldd (“list dynamic dependencies”) command lists the shared objects that the
specified programs require. If you don’t specify the full path for a program, ldd looks
for it in your current directory.
You can use this utility to determine which shared objects to include in an OS image;
see the Sample Buildfiles appendix in Building Embedded Systems.
It’s worth noting that ldd is also the name of the runtime linker. In the .interp
section, it’s called ldqnx.so, and it’s in libc, which is why you need to create a
symbolic link like this:
[type=link] /usr/lib/ldqnx.so.2=/proc/boot/libc.so
Examples:
# ldd ‘which ksh‘
/bin/ksh:
libc.so.3 => /usr/lib/ldqnx.so.2 (0xb0300000)
# ldd ‘which appbuilder‘
/usr/qnx640/host/qnx6/x86/usr/photon/appbuilder/appbuilder:
libph.so.3 => /usr/lib/libph.so.3 (0xb8200000)
libphexlib.so.3 => /usr/lib/libphexlib.so.3 (0xb8311000)
libfont.so.1 => /lib/libfont.so.1 (0xb8340000)
libimg.so.1 => /lib/libimg.so.1 (0xb8348000)
libc.so.3 => /usr/lib/ldqnx.so.2 (0xb0300000)
Environment variables:
DL_DEBUG If this environment variable is set, the shared library loader displays
debugging information about the libraries as they’re opened.
See also:
objdump
dlopen() in the QNX Neutrino Library Reference
Syntax:
ldrel [options] infile outfile
Runs on:
QNX Neutrino
Targets:
x86
Options:
-a hex_align Change segment alignments (default to original alignment).
-o hex_off Assume this file will be copied to another file at this offset.
-p Pad segments so they don’t share address file data.
-S stacksize [K|M]
Note the maximum stack size in bytes, kilobytes (suffix K), or
megabytes (suffix M) as a suggestion to the loader. Specifying -S 0
resets the note; the loader will use its stack size.
-s pattern=filename
-s [!]*
-s pattern[*]
Copy sections matching pattern, from the file (if given). The section
must not overlay segments.
-t hex_addr Text segment address (default to just after headers).
-v Be verbose.
-x Expand segments with zeros to make the file size equal to memory
size.
-Z Load the whole input file into memory.
Description:
The ldrel utility relocates executables.
Syntax:
less [-[+]aBcCdeEfimMnNqQrsSuUw] [-b n] [-x n]
[-[z] n] [-h n] [-j n] [-p pattern]
[-y n] [-[oO] logfile] [-t tag]
[-T tagsfile] [+ cmd] [file...]
Runs on:
Neutrino
Options:
Most options may be changed while less is running, via the dash (-) command.
Options are also taken from the LESS environment variable. The environment
variable is parsed before the command line, so command-line options override the
LESS environment variable. If an option appears in the LESS environment variable,
you can reset it to its default on the command line by using the two-character
combination -+ at the beginning of the command line.
A dollar sign ($) may be used to signal the end of an option string. This is important
only for options such as -t that take a following string.
-a Start searches after the last line displayed on the screen, thus skipping
all lines displayed on the screen. By default, searches begin at the
second line on the screen (or after the last found line; see the -j
option).
-C Clear the screen, then do fullscreen redraws from the top line down. By
default, fullscreen redraws are done by scrolling from the bottom of the
screen.
-h n Don’t scroll backward any more than n lines. If it’s necessary to scroll
backward more than n lines, the screen is redrawn in a forward
direction instead. (If the terminal can’t scroll backward, -h 0 is
implied.)
-j n Use this line on the screen to position “target” lines. Target lines are
the object of text searches, tag searches, jumps to a line number, jumps
to a file percentage, and jumps to a marked position.
The screen line is specified by a number: the top line on the screen is 1,
the next is 2, and so on. The number may be negative to specify a line
relative to the bottom of the screen: the bottom line on the screen is -1
(the number one), the second to the bottom is -2, and so on.
With the -j option, searches begin at the line immediately after the
target line. For example, if -j4 is used, the target line is the fourth line
on the screen, so searches begin at the fifth line on the screen.
-m Prompt verbosely (like more), with the percent into the file. By default,
less prompts with a colon.
-n Suppress line numbers. The default (to use line numbers) may cause
less to run more slowly in some cases, especially with a very large
input file. Suppressing line numbers with -n avoids this problem.
Using line numbers means that the line number is displayed in the
verbose prompt and in the = command, and the v command passes the
current line number to the editor.
-O file Copy input to the named file as it’s being viewed. This applies only
when the input file is a pipe, not an ordinary file. If the file already
exists, less doesn’t ask for confirmation before overwriting it.
If no log file has been specified, you can use the -o and -O options
from within less to specify a log file. Without a filename, they simply
report the name of the log file.
-o file Copy input to the named file as it’s being viewed. This applies only
when the input file is a pipe, not an ordinary file. If the file already
exists, less asks for confirmation before overwriting it.
-p pattern Start at the first occurrence of pattern in the file. The -p option on the
command line is equivalent to specifying +/pattern.
-S Chop, rather than fold, lines longer than the screen width. That is, the
remainder of a long line is simply discarded. The default is to fold long
lines; that is, display the remainder on the next line.
-T tagsfile Use the specified tags file in place of the tags file.
-t tag Edit the file containing the specified tag. For this to work, there must
be a file called tags in the current directory.
-w Use blank lines to represent lines past the end of the file. By default, a
tilde (˜) character is used.
-[z] n Change the default scrolling window size to n lines. The default is one
screenfull. The z and w commands can also be used to change the
window size. Note that the z may be omitted (as in - n).
Description:
The less utility is a program similar to more, but less allows backward movement
in the file as well as forward movement. The less utility uses the system terminal
capability database, so it can run on a variety of terminals. There’s limited support for
hardcopy terminals (on a hardcopy terminal, lines that should be printed at the top of
the screen are prefixed with up-arrow).
The less utility displays a screenfull of information, then prompts for user input by
displaying a colon (:) prompt at the bottom of the screen. Commands can then be
entered from the keyboard.
Commands:
Commands may be preceded by a decimal number, called n in the following
descriptions. The number is used by some commands, as indicated.
[n] Space or [n] f Scroll forward n lines; default is one window (see the -z
option). If n is more than the screen size, only the final
screenfull is displayed.
[n] Enter Scroll forward n lines; the default is 1. The entire n lines are
displayed, even if n is more than the screen size.
[n] d Scroll forward (down) n lines; the default is 1/2 screen size. If
n is specified, it becomes the new default for subsequent d and
u commands.
[n] b Scroll backward n lines; the default is one window (see the -z
option). If n is more than the screen size, only the final
screenfull is displayed.
[n] k Scroll backward n lines; the default is 1. The entire n lines are
displayed, even if n is more than the screen size.
[n] u Scroll backward (up) n lines; the default is 1/2 screen size. If n
is specified, it becomes the new default for subsequent d and u
commands.
[n] F Scroll forward, and keep trying to read when the end of the file
is reached. Normally this command is used when already at the
end of the file. It’s a way to monitor the tail of a file which is
growing while it’s being viewed. (The behavior is similar to
the tail -f command.)
[n] G Go to line n in the file; the default is the end of the file. Note
that this may be slow if n is large, or if n isn’t specified and
standard input, rather than a file, is being read.
Esc Ctrl-F charchar Acts like {, but uses the two characters as open and close
brackets, respectively. For example, ESC ˆF <> could be used
to go forward to the > that matches the < in the top displayed
line.
Esc Ctrl-B charchar Acts like }, but uses the two characters as open and close
brackets, respectively. For example, ESC ˆB <> could be used
to go backward to the < that matches the > in the bottom
displayed line.
[n] /pattern Search forward in the file for the nth line containing the
pattern; n defaults to 1. The pattern is a regular expression, as
recognized by sed. The search starts at the second line
displayed (but see the -a and -j options, which change this).
[n] ?pattern Search backward in the file for the nth line containing the
pattern. The search starts at the line immediately before the top
line displayed.
Certain characters are special at the beginning of the pattern;
see the / command.
[n] n Repeat the previous search, for the nth line containing the last
pattern. If the previous search was modified by !, the search is
made for the nth line not containing the pattern. If the previous
search was modified by *, the search continues in the next (or
previous) file if not satisfied in the current file. There’s no
effect if the previous search was modified by @.
E Same as :e.
[n] :n Examine the next file (from the list of files given in the
command line). If a number n is specified, the nth next file is
examined.
+cmd Causes the specified cmd to be executed each time a new file is
examined. For example, +G causes less to initially display
each file starting at the end rather than the beginning.
q Exit less.
| m shell_command The m represents any mark letter. Pipe a section of the input
file to the given shell command. The section of the file to be
piped is between the current position and the position marked
by the letter. The m may also be ˆ or $ to indicate the
beginning or end of the file. If m is a dot (.) or newline, the
current screen is piped. The current screen is the minimum
amount piped in any case.
Files:
/usr/local/lib/less.hlp
Help file for less’s help command.
Environment variables:
COLUMNS Sets the number of columns on the screen. Takes precedence over the
number of columns specified by the TERM variable.
LINES Sets the number of lines on the screen. Takes precedence over the
number of lines specified by the TERM variable.
TERM The type of terminal on which less is being run. TERM must be
set.
TMPDIR Overrides the default location for temporary files (/tmp). The /tmp
directory or the one specified by TMPDIR must be a writable
filesystem.
Contributing author:
Mark Nudelman
Caveats:
The = command reports the line number of the line at the top of the screen, but the
byte and percent of the line at the bottom of the screen.
If the :e command is used to name more than one file and if one of the named files has
been viewed previously, the new files may be entered into the list in an unexpected
order.
See also:
cat, clear, ctags, head, more, tail, vi
Syntax:
link existing new
Runs on:
Neutrino
Options:
existing Pathname of an existing file.
Description:
The link utility creates a hard link, new, that points to another file, existing. To create
a symbolic link, use ln.
Exit status:
0 Successful completion.
See also:
ln, rm, unlink
Syntax:
ln [-f|-i] [-Psv] source_file target_file
Runs on:
QNX Neutrino, Microsoft Windows
Options:
-f Force existing destination pathnames to be removed before linking;
don’t prompt for confirmation.
source_file The pathname of a file to be linked. If -s is specified, this file need not
exist.
Description:
The ln utility has two syntax forms, as follows:
ln dir/dir/myfile /existingdir
creates /existingdir/myfile as a link to dir/dir/myfile.
This second syntax form is assumed when either the destination names an
existing directory, or when more than one source file is specified.
If the destination path exists and you have write permission for the existing destination
file, or if -f was specified, ln unlinks the destination, then creates the new link.
If you don’t have write permission for an existing directory path, and -f isn’t
specified, and if the standard input is a tty, ln prompts you for confirmation prior to
unlinking the existing file. If standard input isn’t a tty, ln writes a diagnostic message
to standard error, and goes on to the next source_file without unlinking the destination
file.
To create the new link, or replace a file with a link, you need write permissions for the
directory in which the new link is going to reside. Note that root always has this
permission regardless of the file permission settings.
Hard links are limited to within the same filesystem as the original file and aren’t
permitted on directories. With symbolic links, however, you can link any pathname to
a file. A symbolic link is a special file that has the destination pathname as its data.
For more information, see the section on symbolic links in System Architecture.
If the -P option is specified, the link is created within the pathname prefix tree
maintained in memory by the QNX Neutrino process manager, procnto. This lets
you create new pathname links without the need for a traditional filesystem. If the -s
option is specified, a symbolic redirection takes place. If -s isn’t specified, a direct
link to a named resource manager is made. The resource manager named in the source
must be of the form:
nid,pid,chid,handle
where
Examples:
Create a link to /home/curious/monkey called gorilla in the /home/george
directory:
ln /home/curious/monkey /home/george/gorilla
ln -s /home/fred /home/barney
Create a symbolic prefix link to /dev/shmem from /tmp. This simple link maps all
temporary files created under the /tmp directory into shared memory objects, thus
implementing a RAM disk.
Exit status:
0 All the specified files were linked successfully.
Caveats:
When creating a symbolic link, ln doesn’t check that the source_file named actually
exists, or even that it’s a valid pathname. If the file doesn’t exist or if the source_file
isn’t a valid pathname, any attempts to use the link fail.
See also:
cp, ln-w, mv
Syntax:
ln-w [-s] source [destination]
Runs on:
Microsoft Windows
Options:
-s Create a symbolic link.
Description:
The ln-w utility pretends to create a link on Windows machines; it actually copies the
given file to the specified destination. If you don’t specify a destination, ln-w copies
the specified file to the basename of the source.
See also:
basename, ln
Syntax:
logger [-is] [-f file] [-p pri] [-t tag]
[message ...]
Runs on:
Neutrino
Options:
-f file Log the specified file.
-p pri Enter the message with the specified priority. The priority may be
specified numerically or as a facility.level pair. For example, -p
local3.info logs the message(s) as informational level in the
local3 facility. The default is user.notice.
-t tag Mark every line in the log with the specified tag.
message Write the message to log; if not specified, and the -f flag isn’t provided,
standard input is logged.
Description:
The logger command provides a shell command interface to the syslogd daemon.
Examples:
Log the message “System rebooted”:
Files:
/usr/sbin/logger
The logger utility is located in the /usr/sbin/ directory, which is not
included in the default PATH of non-root users. If you are not root, specify the
full path.
Environment variables:
SYSLOG When defined, SYSLOG specifies which node syslogd is running on.
By default, the local node is assumed.
Exit status:
0 Successful completion.
Because the syslog API doesn’t return error codes, only argument errors can be
detected.
See also:
syslogd
syslog() in the Library Reference
Syntax:
login [-fpq] [-c|u] [-h host] [-t timeout]
[username [env1 env2 ...]]
Runs on:
Neutrino
Options:
-c Use only a QNX 4-compatible encryption.
-h host Specify for login purposes that you’re connecting from host.
Description:
The login command starts a session associated with a user. It’s used when someone
either first signs on to the computer, or wishes to log in as another user. If login is
invoked without a username, it prompts for one. It always prompts for a password.
This utility needs to have the setuid (“set user ID”) bit set in its permissions. If you use
mkefs, mketfs, or mkifs on a Windows host to include this utility in an image, use
the perms attribute to specify its permissions explicitly, and the uid and gid
attributes to set the ownership correctly.
The login command verifies the username and password against a password database
and, if verified, starts the user session. If either the username or password is
unacceptable, login asks again for both.
For compatibility, login checks the password using two encryption methods:
The check succeeds if either encryption matches the password. The -c and -u options
allow slightly more security by allowing only one encryption method.
The login utility sets the user ID and group ID as well as the current working
directory, then executes a shell according to specifications found in the password
database.
If execution of the shell fails, login prints the message No Shell and exits. The
shell is started with a dash (-) prepended to its name as argument 0. This informs the
shell to perform its startup routine.
The login utility sets the SHELL, HOME, LOGNAME, USERNAME (same as
LOGNAME), TERM (if set in the caller’s environment), and PATH (set to the value
defined by _CS_PATH) environment variables. For more information on setting
PATH, see “Setting PATH and LD_LIBRARY_PATH” in the Configuring Your
Environment chapter of the Neutrino User’s Guide.
The login utility also updates system accounting information in /var/log/utmp,
/var/log/wtmp, and /var/log/lastlog if they already exist.
The login utility also sets the environment variables specified in the
/etc/default/login file. This file lets you specify which environment variable
settings are to be used across login sessions. If a variable isn’t set when login is
started and this file contains a default for the variable, that default is used. If the file
doesn’t contain a default for the variable, the variable is cleared by login. If a
variable is already set when login is started and -p is specified, it’s preserved, even if
the /etc/default/login file contains a default for the variable. The -p option
allows site-specific environment variables to be passed from the system startup
processes down to applications.
You can set environment variables by specifying them on the command line after the
username, in the form VARIABLE[=VALUE]. For example:
APPLES = RED
TOMATOES = 1
Values passed on the command line are always added to the new environment
(regardless of the -p flag) and override the existing values. The SHELL, HOME,
TERM, LOGNAME, USER values set by login override the command-line values.
You can specify which environment variables are to be preserved when the -p flag
isn’t specified, by populating an /etc/default/login file with the names of the
environment variables you want to save. For example, if /etc/default/login
contains:
SYSNAME
TZ
PHOTON
then when you run login without the -p option, the SYSNAME, TZ and PHOTON
variables (if they exist) are propagated to the new environment. The values may be
overwritten by values on the command line.
You can execute login only from the login shell, or when no session is active; you
can’t nest login commands.
If you execute login from the login shell, the shell from which it is run is terminated.
This is because, by default, login is an alias for exec login.
Files:
/bin/sh The QNX Neutrino Korn shell command interpreter.
/etc/default/login
Sets login environment variables.
/etc/passwd Contains the user database (username, user ID, group ID, full
name, home directory, shell).
/var/log/utmp
/var/log/wtmp
/var/log/lastlog
Accounting records are appended to these files if they already
exist.
See also:
logout, newgrp, passwd, phlogin, sh, su
crypt(), endutent(), getutent(), getutid(), getutline(), pututline(), qnx_crypt(),
setutent(), utmpname() in the Library Reference
Logging In, Logging Out, and Shutting Down and Managing User Accounts in the
Neutrino User’s Guide
Syntax:
logout
Runs on:
Neutrino
Options:
None.
Description:
The logout command terminates a session. You can execute this command only from
a shell invoked by a login command; otherwise a message is printed and the logout
command is ignored.
See also:
login
Logging In, Logging Out, and Shutting Down in the Neutrino User’s Guide
Syntax:
lpd [-ln] [portnum]
Runs on:
Neutrino
Options:
-l (“el”) Log valid requests received from the network. This can be useful
for debugging purposes.
portnum Although the Internet port number used to rendezvous with other
processes is normally obtained with getservbyname(), you can use this
option to change the port number.
Description:
The lpd daemon makes a single pass through the printcap database, restarting any
printers that have jobs. The daemon listens for requests to:
In each case, lpd forks a child to handle the request, so that the parent can continue to
listen for more requests.
Access control is provided by two means:
• All requests must come from one of the machines listed in the file
/etc/hosts.equiv or /etc/hosts.lpd.
• If the rs capability is specified in the printcap entry for the printer being
accessed, lpr requests are honored only for those users with accounts on the
machine with the printer.
The lpd daemon uses simple text files as lock files for synchronization. The parent
daemon uses the file /usr/spool/output/lpd.lock, while its children use a
.lock file within each spool directory specified in the printcap file.
The lock file is kept in a readable ASCII form and contains two lines. The first line is
the pid of the daemon who owns the lock. The second line of the child’s lock file
contains the current job or status.
To keep a printer from filling your hard disk, a minfree file may be created in its
spool directory. This file should contain the number of blocks (in ASCII) to leave free.
If errors occur, lpd writes messages to the system log. In order to capture the log
messages, you need to have syslogd running.
If errors occur, lpd doesn’t send much information to standard error, but it saves lots
of information in the system log. If you have problems with lpd, the system log will
very likely help you figure out what’s wrong.
Files:
/etc/printcap Printer description file.
/usr/spool/*/minfree
Minimum free space to leave.
/etc/hosts.equiv
A list of machine names that are allowed to access the printers.
/etc/hosts.lpd A list of machine names that are allowed to access the printers,
but not under the same administrative control.
See also:
/etc/hosts.equiv, lpr, lprc, lprq, lprrm, /etc/printcap, syslogd
Printing chapter of the Neutrino User’s Guide
Syntax:
lpr [-#num] [-1234font] [-cdfghlmnprstv] [-C class]
[-i [numcols]] [-J job] [-Pprinter] [-T title]
[-U user] [-wnum] [filename...]
Runs on:
Neutrino
Options:
-#num The number of copies desired of each file named. For example:
-i [numcols] Indent the output. If the next argument is numeric (numcols), it’s
used as the number of blanks to be printed before each line;
otherwise, 8 characters are printed.
-J job The job name to print on the burst page. Normally, the first file’s
name is used.
-U user The user name to print on the burst page, also for accounting
purposes. This option is honored only if the real userid is daemon
(or that specified in the /etc/printcap file instead of daemon),
and is intended for those instances where print filters wish to
re-queue jobs.
Description:
The lpr utility uses the spooling daemon lpd to print the named files when facilities
become available. If no names appear, the standard input is assumed.
This utility needs to have the setuid (“set user ID”) bit set in its permissions. If you use
mkefs, mketfs, or mkifs on a Windows host to include this utility in an image, use
the perms attribute to specify its permissions explicitly, and the uid and gid
attributes to set the ownership correctly.
Diagnostics
If a user other than root prints a file and spooling is disabled, lpr prints a message
saying so and won’t put jobs in the queue.
If a connection to lpd on the local machine can’t be made, lpr says that the daemon
can’t be started.
Environment variables:
PRINTER An alternate default printer.
DONT_USE_LINK_UNLINK
Use rename() instead of link() or unlink().
Caveats:
If you try to spool a file that’s too large, it’s truncated.
If the lpd daemon has any problems (e.g. it can’t find the spool file), it might print
some diagnostics in its log file.
See also:
lpd, lprc, lprq, lprrm, pr, /etc/printcap
Printing chapter of the Neutrino User’s Guide
Syntax:
lprc [command [argument ...]]
Runs on:
Neutrino
Options:
None.
Description:
The system administrator (i.e. root) uses the lprc utility to control the operation of
the line printers that are configured in /etc/printcap. You can use lprc to:
Without any arguments, lprc prompts for commands from the standard input. If
arguments are supplied, lprc interprets the first argument as a command and the
remaining arguments as parameters to the command. You can redirect standard input
so that lprc reads commands from file. You can abbreviate the commands.
Here’s a list of recognized commands:
? [command ...]
help [command ...]
Print a short description of each command specified in the argument list. If
you don’t specify a command, lprc displays a list of the recognized
commands.
abort { all | printer }
Terminate an active spooling daemon on the local host immediately and
then disable printing (preventing new daemons from being started by lpr)
for the specified printers.
clean { all | printer }
Remove any temporary files, data files, and control files that can’t be
printed (i.e. that don’t form a complete printer job) from the specified
printer queue(s) on the local machine.
disable { all | printer }
Turn the specified printer queues off. This prevents lpr from adding new to
the queue.
up { all | printer }
Enable everything and start a new printer daemon. This command undoes
the effects of down.
Files:
/etc/printcap Printer description file.
Errors:
?Ambiguous command
Abbreviation matches more than one command.
?Invalid command
No match was found.
?Privileged command
The command can be executed only by root.
See also:
lpd, lpr, lprq, lprrm, /etc/printcap
Printing in the Neutrino User’s Guide
Syntax:
lprq [-l] [-Pprinter] [jobnum ...] [user ...]
Runs on:
Neutrino
Options:
-l Print information about each of the files comprising the job entry.
Normally, lprq displays only as much information as fits on one line.
-Pprinter The printer to query. If you don’t specify a printer, lprq queries the
default line printer (or the printer identified by the PRINTER
environment variable, if it’s set). All other arguments supplied are
interpreted as user names or job numbers to filter out only those jobs of
interest.
jobnum For each job submitted (i.e. invocation of lpr), lprq reports the user’s
name, current rank in the queue, the names of files comprising the job,
the job identifier (a number that you can give to lprrm to remove a
specific job), and the total size in bytes.
The order of the jobs depends on the algorithm used to scan the
spooling directory and is supposed to be FIFO (First in First Out).
Filenames comprising a job may be unavailable (when lpr is used as a
sink in a pipeline), in which case the file is indicated as “standard
input.”
If lprq warns that there’s no daemon present (i.e. due to some
malfunction), you can use lprc to restart the printer daemon.
Description:
The lprq utility examines the spooling area used by lpd for printing files on the line
printer, and reports the status of the specified jobs or all jobs associated with a user. If
you invoke lprq without any arguments, it lists any jobs that are currently in the
queue.
This utility needs to have the setuid (“set user ID”) bit set in its permissions. If you use
mkefs, mketfs, or mkifs on a Windows host to include this utility in an image, use
the perms attribute to specify its permissions explicitly, and the uid and gid
attributes to set the ownership correctly.
Files:
/etc/printcap Printer description file.
Environment variables:
PRINTER An alternate default printer.
Caveats:
Due to the dynamic nature of the information in the spooling directory, lprq may
report unreliably. Output formatting is sensitive to the line length of the terminal; this
can result in widely spaced columns.
See also:
lpd, lpr, lprc, lprrm, /etc/printcap
Printing chapter of the Neutrino User’s Guide
Syntax:
lprrm [-Pprinter] [-] [jobnum ...] [user ...]
Runs on:
Neutrino
Options:
-Pprinter Specify the queue associated with a specific printer; otherwise, the
default printer is used.
- Remove all of the jobs that you own. If the superuser (root) uses this
flag, lprrm empties the entire spool queue.
jobnum Remove the individual job specified by the given job number. You can
get this number from the lprq utility.
user Attempt to remove any jobs queued belonging to that user (or users).
This form of invoking lprrm is useful only to the superuser.
Description:
The lprrm utility removes one or more jobs from a printer’s spool queue. Since the
spooling directory itself is protected from users, lprrm is normally the only way that
you can remove a job. The job’s owner is determined by the user’s login name and
hostname on the machine where the lpr command was invoked.
This utility needs to have the setuid (“set user ID”) bit set in its permissions. If you use
mkefs, mketfs, or mkifs on a Windows host to include this utility in an image, use
the perms attribute to specify its permissions explicitly, and the uid and gid
attributes to set the ownership correctly.
Note that if you don’t specify any arguments or options, lprrm deletes the currently
active job if you own it.
The lprrm utility announces the names of any files it removes and is silent if the
queue contains no jobs that match the request list.
The utility kills off an active daemon, if necessary, before removing any spooling files.
If a daemon is killed, a new one is automatically restarted upon completion of file
removals.
Files:
/etc/printcap Printer description file.
Environment variables:
PRINTER An alternate default printer.
Errors:
Permission denied
Displayed when you try to remove print jobs that aren’t yours.
Caveats:
Since there are race conditions possible in the update of the lock file, the currently
active job may be incorrectly identified.
See also:
lpd, lpr, lprc, lprq, /etc/printcap
Printing chapter of the Neutrino User’s Guide
Syntax:
ls [-1CFRacdilqrstu] [-DLSbfghnopv] [file...]
Runs on:
QNX Neutrino, Microsoft Windows
Options:
-1 (“One”) Force output to be one entry per line.
-a List all files, including hidden ones i.e. those that start with a dot (.). By
default, these entries aren’t listed.
-c For sorting (-t) or printing (-l), use time of last change to the file’s status
information instead of time of last modification of the file itself.
-d Treat directories like files — give information on the directory itself, not on the
files or subdirectories it contains.
Character Meaning
/ Directories
* Executable files
| FIFOs (named pipes)
# Named special files (QNX Neutrino extension)
@ Symbolic links (QNX Neutrino extension)
-l (“el”) List in long format. This option provides most of the relevant file
information (filetype, permissions, link count, owner/group of the file, as well
as the size, date, and name of the file), as follows:
drwxrwxrwx 7 0 0 22528 Jan 17 15:38 Csrc
-rw-rw-rw- 1 0 0 22 Feb 14 13:41 barney
-rwxrwxrwx 1 0 0 22 Feb 14 13:41 exec
-rw-rw-rw- 1 0 0 22 Feb 14 13:41 fred
drwxrwxrwx 2 0 0 23040 Feb 12 10:56 libtests
drwxrwxrwx 2 0 0 2048 Sep 28 06:39 util
Note that the 10-character field (e.g. “drwxrwxrwx”) describes the filetype
and permissions (see below).
-q Force filename characters that aren’t included in the character set classification
in the current locale to be displayed as a question mark (?). This is the default
if output is to a terminal.
If you’re using Qnet, doing something like ls -R /net can take a very long time
because it recursively lists all the directories on all the machines on your network.
-r Reverse the order of the sort to get either oldest files first (if files are being
sorted by time) or reverse collating sequence.
-t Sort by time modified (most recently modified first) before sorting the files by
the collating sequence.
-u For sorting (-t) or printing (-l), use time of last access (i.e. last use), instead
of time of last modification of the file.
file The pathname of a file to be listed. If the file specified isn’t found, a diagnostic
message is output on standard error. Files are displayed in command-line
sequence.
-g List in long format, as in ls -l, but don’t show owner (group is displayed).
-o List in long format, as in ls -l, but don’t show group (owner is displayed).
-p Display a list of relative pathnames for all nondirectory files. The files are
listed one to a line. This option allows you to pass full pathnames of files to
programs.
-S Don’t sort the output. This option is useful for determining the order in which
entries are found in a given directory.
Description:
For each file you name that isn’t a directory, ls displays the file’s name as well as any
information requested on the file.
For each directory you name, ls displays the names of files contained within that
directory, as well as any information requested on the files. The -d option overrides
this behavior and makes ls display information on the directory itself, rather than on
its contents.
If you specify more than one file, ls displays files that aren’t directories first.
Directories and nondirectories are sorted separately.
If you don’t specify a file, ls displays the contents of the current directory.
Specifying more than one of the -C, -l (“el”), and -1 (“one”) options isn’t considered
an error. The last option specified determines the output format.
In many environments, the ls command is “aliased” to either ls -C or ls -CF, the
two most common ls display formats. Unless the POSIX_STRICT environment
variable is set, ls defaults to the multi-column output (-C option).
The -p option is useful for passing a list of all nondirectory filenames, one filename
per line, to other programs. The filenames include the full pathnames.
When displaying a timestamp for a file, ls displays the date and time, unless the file is
older or newer than the current date by six months (a “month” is defined as 30 days).
Otherwise, ls displays the date and year.
If you use the -l (“el”) or -s option — or the -n, -g, or -o options, which imply
them — and you list a directory, the output includes the total number of 512-byte
blocks that the directory occupies. This total doesn’t include the space occupied by
any subdirectories. For example:
$ ls -l /etc/rc.d
total 28
-rwxrwxr-x 1 root root 1515 Apr 30 2001 rc.devices
-rwxrwxr-x 1 root root 354 Apr 08 14:37 rc.local
-rwxrwxr-x 1 root root 321 Dec 23 2004 rc.local˜
-rwxrwxr-x 1 root root 6767 May 31 2001 rc.setup-info
-rwxrwxr-x 1 root root 2993 May 07 2002 rc.setup-once
-rwxrwxr-x 1 root root 1271 Apr 21 2002 rc.sysinit
In the first position, the following characters are used to indicate the filetype:
Character Meaning
- Regular file
b Block special file
c Character special file
d Directory
l Symbolic link
n Named special file
p FIFO (pipe)
s Unix domain socket
The remaining nine characters represent the owner, group, and other permissions; each
class has a three-character field. For each class, the characters and the first two
positions are as follows:
Character Meaning
S If a file, it isn’t executable and is setuid (if in the owner field) or
setgid (if in the group field).
If a directory, it isn’t searchable. All files within that directory inherit
the permissions of the directory, not of the creator of the files.
Environment variables:
COLUMNS If this variable contains a string representing a decimal integer,
it indicates the user’s preferred column position width for
displaying multiple-column output. The ls utility calculates
how many pathname text columns to display (see -C) based on
the width provided. If COLUMNS isn’t set or is invalid, the
number of columns displayed is determined by the type of
output device.
Exit status:
0 All files were listed successfully.
See also:
chmod, find, which
Working with Files in the Neutrino User’s Guide
Syntax:
mount -Tio-pkt [-o option,option,...] lsm-autoip.so
Runs on:
Neutrino
Options:
if =interface Specify the interface on which the AutoIP service is started. Only one
interface is supported at one time. The default is en0.
ip=address Attempt to claim address for the link-local address. If this fails, a
random address is attempted until an unused IP address is found. You
can use this option to force the AutoIP module to use a certain initial
IP address. By default, this is a random IP address based on the MAC
address of the interface. The same initial IP address would be chosen
for a specific MAC address. This option is specified in dotted numeric
notation.
delay=ms Set the delay before packets are transmitted. This affects the PROBE
packets only. The delay is specified in milliseconds. You can set this
option for a range of 8000 to 1 ms. The default is 2000 ms. You may
want to set a shorter delay if your network isn’t connected with
Ethernet switches.
Description:
The AutoIP module (lsm-autoip.so) configures a specified interface with a
link-local IP address by negotiating with neighboring hosts. If no host on the local
network is using the IP address that the module has chosen, the interface is configured
with the chosen address.
The AutoIP module chooses its address from the IANA registered IP address network
of 169.254/16. Some of this network is reserved for special purposes, so the available
addresses are from 169.254.1.0 to 169.254.254.255.
Once an IP address is chosen and configured, the AutoIP module continues to monitor
the network for address conflicts, and either defends or changes the address assigned
to the interface to correct conflicts.
Only one interface can be supported at one time. The module can be loaded only once.
The interface that AutoIP is servicing, must exist before AutoIP module being loaded.
When the AutoIP module configures a TCP/IP interface with an IP address, it does so
as an alias. This way, if the interface already has an IP address, it won’t delete the
original address; the interface is assigned both addresses. This allows the module to
coexist with dhcp.client.
Examples:
These examples assume a manual configuration in combination with AutoIP.
Configuring the interface:
This following command line mounts the AutoIP module to service interface en0. The
initial link-local IP address that it PROBEs for is 169.254.20.20; it has a 200 ms delay
between PROBE packets. If an IP address conflict is detected after the interface has
been configured, it releases the address immediately.
mount -T io-pkt -oif=en0,ip=169.254.20.20,debug,delay=200,abandon lsm-autoip.so
Caveats:
The dhcp.client would delete the link-local IP address on an interface, after it has
configured a routable IP address on the interface. This implies that if you already have
some connection to other hosts using your link-local IP address, those links will be cut
off. If later on dhcp.client obtained is an routable IP address.If this is a concern,
you can use the force option to force the link-local address exist.
You can manually delete your routable IP address or link-local IP address. Just make
sure you pass the address you want to delete into ifconfig. If you specify the force
option, then you won’t be able to remove link-local address.
See also:
dhcp.client, ifconfig, netstat
QNX Neutrino Core Networking User’s Guide
The io-pkt-* manager looks for the correct version of this module when you mount
it (i.e. lsm-pf-v4.so with io-pkt-v4 and io-pkt-v4-hc; lsm-pf-v6.so with
io-pkt-v6-hc.
Syntax:
mount -Ttcpip lsm-pf.so
Runs on:
Neutrino
Options:
None.
Description:
The lsm-pf-v4.so and lsm-pf-v6.so shared objects are the modules that handle
IP filtering and NAT (Network Address Translation) services. You need to load these
libraries to enable filtering and NAT functionality.
IP filtering allows your host to act as a firewall, or you can provide firewall services on
your host. NAT allows multiple hosts on a subnet to share a common IP address.
You use configuration files to set the filtering and NAT rules. For more details, see the
documentation for pf.conf.
See also:
io-pkt-* pf, pf.conf, pfctl
Packet Filtering and Firewalling chapter of the Core Networking User’s Guide
Syntax:
io-pkt ... -p qnet [option[,option]...]
Runs on:
Neutrino
Options:
• The lsm-qnet.so DLL has many options to alter how Qnet functions (e.g.
timeouts, retries, and idle times), but Qnet is optimized to function with its default
settings. Don’t use these options unless you’re trying to overcome an issue related
to your environment. Using these options can have a negative effect if used
incorrectly.
auto_add=X When qnet starts up, the builtin io-pkt Ethernet (en)
resolver broadcasts its own mappings on all interfaces. This
option specifies the time interval, in ticks (see the
periodic_ticks option), after which the builtin io-pkt
Ethernet (en) resolver rebroadcasts its own mappings on all of
its interfaces. This has the effect of automatically populating
the /net directory with all of the connected nodes.
The default is 150 ticks, which represents 30 seconds. The
value 0 is special because it not only stops the broadcasted
transmissions, but it causes unsolicited received broadcasts to
be discarded. This has the effect of populating the /net
directory only with nodes that applications on the local node
specifically open.
If you use the bind=ip option, you also need to use the
resolve=dns option. The resolver is used to map the node
name to the IP address; you can’t use the default resolver with
the bind=ip option.
conn_est_retries=X
The number of times QoS should retry to establish a
connection before giving up. The default is 1.
conn_est_timeout=X
The number of periodic ticks before QoS should retransmit a
connection-establishment request. The default is 1.
conn_up_idle=X The number of periodic ticks until QoS should conclude that a
connection is idle without any traffic and should be polled with
a heartbeat. The default is 50 ticks (10 seconds).
conn_up_retries=X
The number of unanswered connection heartbeats before QoS
concludes that a connection is down. The default is 6.
mapany=map_uid Map any incoming user ID to map_uid and map its group ID to
that of map_uid.
max_num_l4s=num Specify the number of interfaces. The default is two, and the
maximum is four.
mount=directory[:[.]domain]]*
Specify a network directory. The default directory is /net.
The default domain is either the hostname domain, if it has
one, or the directory with the slashes changed to dots and
reversed. For example, /net/outside/canada has a domain
of canada.outside.net. The first mount is the default
directory and domain that the local hostname resolves through.
Configure all hosts on the network to use the same value for the no_ack option.
If you change the value of periodic_ticks, you’ll affect the timing of all other
options that rely on the timer tick.
probe_no_l4_time=X
The number of periodic ticks after which QoS should probe a
connection on an interface for which there is no mapping for
the remote node with a broadcasted packet. The default is the
same as the value of conn_up_idle.
qos_per_pri=num
qos_tx_pri=num The priority to use for the pulse for the QoS periodic
transmission thread and the QoS transmission thread.
We recommend that you not change these values; we supply the qos_per_pri and
qos_tx_pri options for the rare cases where you need to change the priority of the
io-pkt subsystems.
res_retries=X The number of retries the Ethernet resolver will perform during
an attempted node resolution before giving up. The default is 2.
ret_drvr_rx_buf=X
How L4 should handle the received (rxd) packets:
• 0 — hold onto multiple rxd packets during reassembly (the
default). This results in the best performance.
• 1 — make a copy of the data in the packets and immediately
return the packet buffers to the driver. This is useful when
there’s a limited number of packet buffers provided by the
driver.
slow_mode=X The number of ticks after which to forget about the slow
transmit mode (i.e. tightly windowed) for a node. The default
is 1200, giving 240 seconds or four minutes. The value 0 is
special; it disables slow mode entirely.
vtag=tag_number Cause Qnet to insert a four-byte vlan tag into the packet. The
tag_number must be greater than zero. If you use this option,
Qnet accepts only packets that have a tag value that matches
the given tag_number. If the driver being used doesn’t support
1518-byte packets, you must also use the Qnet mtu_en=1496
option.
Description:
The lsm-qnet.so is the lightweight version of the QNX manager that implements
native Neutrino networking, Transparent Distributed Processing (TDP).
The QoS software layer implements the node-to-node session protocol and handles the
selection of transmission media.
L4 is a software layer beneath the QoS that implements an ISO level-4 style transport
to provide guaranteed, non-duplicate delivery of data, using the driver layer below it.
You can’t umount Qnet, but you can create an io-pkt producer module that supports
unmounting.
If you specify two or more resolve= options in a series, the resolvers form a list of
lookups for the directory specified in the subsequent mount= options.
A list of resolvers is terminated by a mount= option. Any resolve= options placed
after a mount= option form a new list — they don’t add to the previous list.
For example, the following line:
resolve=a,resolve=b,mount=x,mount=y,resolve=c,mount=z
specifies that:
Once Qnet has a domain, you can’t set Qnet to not use a domain; you can only change
the domain.
Examples:
You can start Qnet in two ways: either you start it at the same time as io-pkt, or
afterward with the mount utility.
Start a network driver, Qnet, and TCP/IP at once, with Qnet using the default DIX blue
book ethernet packet type with no CRC checking, and 1024 descriptors for maximum
performance:
io-pkt -d speedo transmit=1024,receive=1024 -p qnet -p tcpip
Start io-pkt, and then use the mount command to start the driver and Qnet in
sequence, using the actual file names of the shared libraries:
io-pkt
mount -T io-pkt -o transmit=1024,receive=1024 devn-speedo.so
mount -T io-pkt lsm-qnet.so
These shared libraries (with the .so extension) are actually located in /lib/dll. The
mount utility automatically looks for them there. If you wish, you can give the full
pathname to the mount utility.
The following example shows how you start everything at once using IP packet
encapsulation instead of DIX blue book:
io-pkt -d speedo transmit=1024,receive=1024 -p qnet bind=ip,resolve=dns -p tcpip
Files:
/dev/io-net The directory where, by default, protocol modules and legacy
io-net drivers add entries. For more information, the
documentation for io-pkt.
/etc/system/config/useqnet
If this file exists, your system is using the default startup files, and
io-pkt is running when your system starts up, the system
automatically loads lsm-qnet.so. For more information, see the
Controlling How Neutrino Starts chapter of the Neutrino User’s
Guide.
/proc/qnetstats
An entry that Qnet places in the /proc filesystem. If you open this
name and read from it, the Qnet resource manager code responds
with the current statistics for Qnet.
Caveats:
Qnet doesn’t fully support communication between a big-endian machine and a
little-endian machine. However, it does work between machines of different processor
types (e.g. ARMLE, x86) that are of the same endian-ness. If you require cross-endian
networking with Qnet, please contact your QNX sales representative.
See also:
devn-*, devnp-*, io-pkt
Using Qnet for Transparent Distributed Processing in the QNX Neutrino User’s Guide
Native Networking (Qnet) in System Architecture
Transparent Distributed Processing Using Qnet in the QNX Neutrino Programmer’s
Guide
QNX Neutrino Core Networking User’s Guide
Syntax:
lwresd [-c config-file] [-C config-file] [-d debug-level] [-f]
[-g] [-i pid-file] [-m flag] [-n num_cpus] [-P port]
[-p port] [-s] [-t directory] [-u user] [-v]
[-4] [-6]
Runs on:
Neutrino
Options:
See http://netbsd.gw.com/cgi-bin/man-cgi?lwresd+8+NetBSD-5.0 in the
NetBSD documentation.
Description:
The lwresd utility is the daemon providing name-lookup services to clients that use
the BIND 9 lightweight resolver library. It’s essentially a stripped-down, caching-only
name server that answers queries using the BIND 9 lightweight resolver protocol
rather than the DNS protocol. For more information, see
http://netbsd.gw.com/cgi-bin/man-cgi?lwresd+8+NetBSD-5.0 in the NetBSD
documentation.
See also:
named in the NetBSD documentation
Syntax:
m4 [options] [files]
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
See http://www.gnu.org/software/m4/manual/.
Description:
The m4 utility is a macro processor, in the sense that it copies its input to the output,
expanding macros. For detailed documentation, see
http://www.gnu.org/software/m4/manual/.
This utility is subject to the GNU Public License (GPL). We’ve included it for use on
development systems.
Name:
/usr/share/misc/magic
Description:
The file command identifies the type of a file using, among other tests, a test for
whether the file begins with a certain magic number. The file
/usr/share/misc/magic specifies what magic numbers are to be tested for, what
message to print if a particular magic number is found, and additional information to
extract from the file.
Each line of the file specifies a test to be performed. A test compares the data starting
at a particular offset in the file with a 1-byte, 2-byte, or 4-byte numeric value or a
string. If the test succeeds, a message is printed. The line consists of the following
fields:
offset A number specifying the offset, in bytes, into the file of the data which is
to be tested.
type The type of the data to be tested. The possible values are:
test The value to be compared with the value from the file. If the type is
numeric, this value is specified in C form; if it’s a string, it’s specified as
a C string with the usual escapes permitted (e.g. \n for newline).
Numeric values may be preceded by a character indicating the operation
to be performed:
• =, to specify that the value from the file must equal the specified value
• <, to specify that the value from the file must be less than the
specified value
• >, to specify that the value from the file must be greater than the
specified value
• &, to specify that the value from the file must have set all of the bits
that are set in the specified value
• ˆ, to specify that the value from the file must have clear any of the
bits that are set in the specified value
• x, to specify that any value matches.
If the character is omitted, it’s assumed to be =.
Numeric values are specified in C form; e.g. 13 is decimal, 013 is octal,
and 0x13 is hexadecimal.
For string values, the byte string from the file must match the specified
byte string. The operators =, < and > (but not &) can be applied to
strings. The length used for matching is that of the string argument in the
/usr/share/misc/magic file. This means that a line can match any
string, and then presumably print that string, by doing >\0 (because all
strings are greater than the null string).
Some file formats contain additional information that’s to be printed along with the file
type. A line that begins with the character > indicates additional tests and messages to
be printed. The number of > characters on the line indicates the level of the test; a line
with no > at the beginning is considered to be at level 0. Each line at level n+1 is
under the control of the line at level n most closely preceding it in the magic file.
If the test on a line at level n succeeds, the tests specified in all the subsequent lines at
level n+1 are performed, and the messages printed if the tests succeed. The next line
at level n terminates this.
If the first character following the last > is a (, then the string after the parenthesis is
interpreted as an indirect offset. That means that the number after the parenthesis is
used as an offset in the file. The value at that offset is read, and is used again as an
offset in the file. Indirect offsets are of the form: ((x[.[bsl]][+-][y]). The value
of x is used as an offset in the file. A byte, short or long is read at that offset depending
on the [bsl] type specifier. To that number the value of y is added and the result is
used as an offset in the file. The default type if one isn’t specified is long.
Caveats:
The formats long, belong, lelong, short, beshort, leshort, date, bedate,
and ledate are system-dependent; perhaps they should be specified as a number of
bytes (2B, 4B, etc), since the files being recognized typically come from a system on
which the lengths are invariant.
There’s (currently) no support for specified-endian data to be used in indirect offsets.
See also:
file
Syntax:
make [options] [macro=name] [target]
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
-C directory Change to the given directory before doing anything.
-d Display debugging information.
-l [N] Don’t start multiple jobs unless the load is below N. If N isn’t
specified, this option removes a previous load limit.
-n No-execution mode. Print commands, but don’t execute them.
However, lines preceded by a plus sign (+) prefix or containing the
string $(make) are executed. Lines beginning with an @ are printed.
-r Clear the suffix list and don’t use the default inference rules.
-t Touch the target files, changing only the file date, rather than
perform the rules to reconstruct them.
--no-print-directory
Turn off -w, even if it was turned on implicitly.
--warn-undefined-variables
Warn when an undefined variable is referenced.
target_name The target to bring up-to-date. If no target is specified, make uses the
first target defined in the first makefile encountered.
macro=name Macro definition. This definition remains fixed for the make
invocation. It overrides any regular definitions for the specified
macro within the makefiles and from the environment. This
definition is inherited by subordinate make sessions but acts as an
environment variable for these. That is, depending on the -e setting,
it may be overridden by a makefile definition.
Description:
The make utility is used to maintain current versions of files by resolving time
dependencies. If the file that make is examining (i.e. the target) is older than the file(s)
on which it depends (i.e. the prerequisites), then make executes a list of shell
commands associated with the target to create or update the target.
To control what make does, the utility refers to specifications (rules) consisting of a
target, prerequisites, and a list of shell commands to be executed when a prerequisite is
newer than the target. To simplify maintenance of programs, make has a collection of
default macros and inference rules allowing it to identify the proper procedures
required to update targets based on minimal information. (If the -r option is given, the
builtin rules aren’t used.)
For example, to compile myprog.c and produce the executable program myprog:
make myprog
This works even in the absence of a makefile. The alternative of using the qcc utility
produces an executable named a.out by default. Using make for compiling
single-source executables is a convenient shortcut.
When cross compiling, you can’t rely on the default rules; you need to specify the
target.
The make utility attempts to perform the actions required to ensure that the specified
target(s) are up-to-date. A target is considered out-of-date if it’s older than any of its
prerequisites. The make utility treats all prerequisites as targets themselves and
recursively ensures that they’re up-to-date. The utility examines the modified times of
files to determine whether they’re out-of-date.
After all the prerequisites of a target are ensured to be up-to-date, and if the target is
out-of-date, the shell commands associated with the target entry are executed. If no
shell commands are listed for the target, it’s treated as up-to-date.
For more information on make and writing makefiles, see the GNU website at
http://www.gnu.org/.
Examples:
make myfile.o
Typing this in the absence of a makefile (or with a makefile that doesn’t mention the
myfile.o file) uses the builtin suffixes list and inference rules to determine the name
of the source file and, if necessary, to run the proper command to create or rebuild the
myfile.o file.
Suppose you have the source files myfile1.c, myfile2.c, and myfile3.c. The
first two files include the headers <hdr1.h> and <hdr2.h>, and these files are all
linked together to produce the program myprog. Here’s what a simple makefile
describing this could look like:
# Samplemakefile1
myfile3.o:
make myprog
make
make -n
Using macros, the myprog makefile could be simplified to:
# Samplemakefile2
myprog: $(OBJS)
myfile1.o: $(HDRS)
myfile2.o: $(HDRS)
This makefile is functionally identical to the previous example. It isn’t significantly
better, just slightly more generalized.
We can further simplify the makefile by using the builtin inference rules and macros,
as follows:
# Samplemakefile3
myprog: $(OBJS)
Environment variables:
MAKEFLAGS This environment variable, if it exists, is read by the make utility,
and is treated as a set of option characters to be used as the
default options. Command-line options to make have precedence
over these options.
After make has started and the MAKEFLAGS variable has been
read, all of the options except -d, -f, and -p are added to the
MAKEFLAGS macro. The MAKEFLAGS macro is passed into the
environment as an environment variable for all child processes.
SHELL The value of the SHELL environment variable is always ignored.
All other environment variables are used as macros.
Exit status:
When the -q option has been specified:
0 Successful.
0 Successful.
Contributing author:
GNU
Caveats:
In makefiles, specify Windows pathnames using one of the following methods:
See also:
qcc
Conventions for Recursive Makefiles and Directories appendix of the QNX Neutrino
Programmer’s Guide
Andrew Oram and Steve Talbott, Managing Projects with make, O’Reilly and
Associates, 1991
Syntax:
mcd options* config_file &
Runs on:
Neutrino
Targets:
ARM, PowerPC, SH, x86
Options:
-D Set the name of the mediastore list directory; the default is .devices.
-E Set the name of the mediastore eject file; the default is .eject.
-I Set the name of the mediastore insert file; the default is .insert.
-L Run the MCD in local mode, even when Qnet is running. See “Local
mode” below.
Local mode
The local mode option (-L) may permit simpler configuration when stand-alone
systems are used, as describe here.
Use local mode if a system using MCD is to be run as a stand-alone with respect to
any services that use the MCD, and Qnet is running on the system (for example, for
debugging).
When the MCD runs in local mode, the MCD:
Limitations
• Off-node processes can not open rule entries (for example, DISC_INSERTED), so
they are unable to read out a local-only path.
• To prevent any ambiguity between local and remote device names, off-node
processes can not open control entries (for example, .insert or .eject).
• Path names handed out to read() are local only — even if Qnet is running.
Description:
The mcd utility (media content detector, or MCD) monitors device and mediastore
insertions and removals, and the presence of specified media content.
Overview
The MCD is a stand-alone utility for detecting devices, mediastores and specified
media content. It is positioned between storage and USB device drivers, and any client
application that needs to be informed of a device or mediastore activity, or of the
presence of specified media types.
The MCD design separates the definition of actions conducted by the system from the
implementation of these actions so that the actions can be easily edited or updated
without changes to code.
MCD rules
The MCD provides a binary decision tree framework, applying rules and branching
between rules according to match/fail results. These rules are used for detecting device
and mediastore insertions and removals, and for classifying their content. They are
specified in the MCD configuration file, and implemented with user callouts.
You can write rules for the MCD instructing it to monitor the presence or absence of
any device, mediastore or file, as shown by the three examples below:
Monitor a mediastore
The rule below tells the MCD to monitor the physical insertion or removal of a
CD-ROM mediastore on a device (the hardware) at the location /dev/cd*.
[/dev/cd*]
Callout=CD_MEDIA_IOBLK
The rule below monitors changes (mount or unmount) of a device or mediastore (such
as a USB storage device) on the system. These sorts of changes usually indicate the
physical insertion or removal of the device (the hardware) and its filesystem mounting
or unmounting.
[/fs/usb*]
Callout=PATH_MEDIA_PROCMGR
The rule below polls the contents of /directory looking for files or directories that
have been created in or removed from the directory being monitored. For example,
typing touch /directory/file from a shell satisfies this rule, though no physical
device has been inserted or removed.
[/directory/*]
Callout=PATH_MEDIA_SCAN
The MCD can be used as a framework from which to build an independent content
detection system.
MCD server
The MCD server:
In this documentation:
• a USB stick with, for example, two partitions is one device with two mediastores
Operational flow
This section describes the MCD’s operational flow at startup, and on detection of a
new device, mediastore or file.
Startup
Device or insertion
• Create a new thread to process the content detection rules for that device,
mediastore or file.
The sample MCD configuration file 2phase.cfg is delivered with the MCD; the
sample configuration file mcd.conf provides examples for use with the Aviage
Multimedia suite (MME).
The MCD ignores blank lines and any leading or trailing white spaces. It treats lines
beginning with a “#” or a “;” character as comments and ignores them as well.
• an entity (device, mediastore or file) description — the section name starts with a
“/” character (i.e. /dev/cd0). See “Entity descriptions” below.
• a media content rule — any name without a leading “/”. See “Media content rules”
below.
[DVD_AUDIO]
Callout = FNAME_MATCH
Argument = /AUDIO_TS/AUDIO_TS.IFO
Match Rule = DVD_VIDEO
Fail Rule = DVD_VIDEO
Entity descriptions
For entity (device, mediastore or file) description sections, the section name is the
entity the MCD monitors. This name can be a single name, such as /media/drive,
or a wildcard pattern, such as /dev/umass*. If the section name is a wildcard
pattern, the event notification routine defined by the Callout= for the section must be
capable of handling every entity that matches the wildcard pattern.
Parameters
Callout= The notification routine that the MCD runs when it detects the
entity defined in the section name. Each notification routine is run
in its own thread, allowing it to either block or poll as necessary.
If you provide no Callout= routine, you should handle device,
file or mediastore transitions externally with the notification
provided through the resource manager interface.
Argument= An optional argument to pass to the notification routine defined by
the Callout= parameter.
Priority= The priorities at which to run, if applicable, for the entity defined
in the current section:
• the content detection thread
• the notification thread
Start Rule= The root of the decision tree executed to determine media content
type; that is, the first rule to apply to each entity following
insertion notification.
Stop Rule= The root of the callouts to execute when the entity is removed.
Parameters
Parameters in a media content rule section of the configuration file are used as follows:
Callout= The notification routine that the MCD runs when it detects an
entity matching the content rule in the section name. See
“Notification routine” below.
Match Rule= The branch of the decision tree to execute when media content
matches the content rule.
Fail Rule= The branch of the callouts to execute when no media content
matches the content rule.
A rule runs at the priority given in the entity section that starts the rule chain.
Notification routine
The notification routine that runs when a mediastore matches a rule produces a
match/fail result to indicate whether or not the media on the mediastore satisfies the
routine’s particular requirements. Based on the result produced by the rule, the MCD
takes a branch to another rule, as specified by the Match Rule= or Fail Rule=
parameters in the current section.
If no associated branch rule is provided for a rule’s result, the MCD considers the rule
to be terminal and content detection complete.
If a rule contains no Callout= parameter, the MCD assumes that the rule either
matches or fails, based on the presence of an associated branch rule. When debugging,
you can use this characteristic to disable a test and always make a branch to the next
rule.
First-level entries
• The first level of entries in the MCD configuration file refers, not to mediastores,
but to devices that can be monitored using the provided MCD callouts.
• The Start Rule= parameter in a first level entry points to the MOUNT_FSYS
callout, a built-in routine that can mount filesystems based on simple mediastore
criteria.
• Mounting a filesystem uses the triggers insertion notification of the second level of
entries (for mediastores) via the PATH_MEDIA_PROCMGR built-in routine.
Second-level entries
• When they are triggered, the MCD configuration file’s second-level entries perform
the content detection algorithms on the mediastores at the filesystem mountpoint.
For an example of how to use the MCD as a filesystem automounter, see “Two-phase
filesystem mount example” in the “Examples” section below.
• a .devices directory with an entry for each entity known to the system
The .insert and .eject files are write-only files in /dev/mcd. External programs
can trigger the MCD’s content detection process on the insertion or ejection of an
entity by writing to the appropriate file the pathname of the entity that has been
inserted or ejected; for example /dev/cd1 .
If the hardware for the device with an ejected mediastore doesn’t support removal
notification, then the MCD treats a subsequent insertion notification as an implicit
ejection event.
.devices directory
The .devices directory in /dev/mcd contains an entry for each entity (device,
mediastore and monitored file) known to the system. Each entity is represented by a
S_IFCHR/char-special file in this directory. These files hold information about
the entity in fields as follows:
• st_mtime — the time of the last state change for the entity.
• st_ino — the sequence number of the insertion. See “Sequence number” below.
An entry appears in .devices directory only for entities that have been inserted at
least once. Since entity sections can be wildcards, a full list of potential entity matches
can not be known in advance. The MCD can only know about an entity after it has
been inserted. Thus, if a client application tries to stat() a particular device and fails
with ENOENT, it should treat this failure as though the st_ino field is 0 (i.e., device
ejected).
The “Client API” section below includes an example that illustrates how to use this
interface.
Sequence number
The sequence number stored in st_ino for any entity (device, mediastore or file) can be
either zero or non-zero. A value of zero means that the entity is not present in the
system. A non-zero value means that the entity is present in the system.
At each re-insertion of the entity, the MCD increases the sequence number for that
entity. Thus, for example, for a mediastore the values of st_ino might be in sequence:
1 (first insertion), 0 (removal), 3 (re-insertion), 0 (removal), 5 (re-insertion).
A client application can use the incrementing value of st_ino at each state change to
check that it is up to date with, for example, a mediastore’s activity after a series of
rapid insertions and removals. For more information, see “Stale rules” below.
$ ls -al /dev/mcd
dr-xr-xr-x 1 root root 11 Aug 02 19:46 .
n-w--w--w- 1 root root 0 Aug 02 19:46 .eject
n-w--w--w- 1 root root 0 Aug 02 19:46 .insert
nr--r--r-- 1 root root 0 Aug 02 19:46 CDDA_OR_DTS
nr--r--r-- 1 root root 0 Aug 02 19:46 CD_AUDIO
nr--r--r-- 1 root root 0 Aug 02 19:46 DVD_AUDIO
nr--r--r-- 1 root root 0 Aug 02 19:46 DVD_OR_CD
nr--r--r-- 1 root root 0 Aug 02 19:46 DVD_VIDEO
nr--r--r-- 1 root root 0 Aug 02 19:46 MIXED_AV
nr--r--r-- 1 root root 0 Aug 02 19:46 SVIDEO_CD
nr--r--r-- 1 root root 0 Aug 02 19:46 VIDEO_CD
The top-level /dev/mcd directory contains read-only entries for each rule defined in
the configuration file.
Client applications can read from here the name of the device that satisfied a particular
rule, with the read blocking until a device with content matching that rule is available.
A non-blocking select and notify mechanism is also available to allow the client to
wait on multiple rules, or to perform other work until a rule is triggered. Following the
notification, the client application can read the rule to determine the device.
Callout templates
The MCD server provides a framework from which you can build a content detection
system. Callout routines provide all the specific functionality in such a content
detection system.
The MCD includes some common routines available for use where required in a
static-linked library bound into the server. The MCD also supports extension routines
provided by third-parties in DLLs dynamically linked at runtime. Thus, the system is
extensible: if you require a new, unsupported detection test, you can implement it
outside the server framework and ship it as a separate library.
In the content detection system configuration file, all Callout= items refer to a
callout. These callouts are identified as internal or external by their names:
Extension modules must include the MCD header file <sys/mcd.h> for appropriate
manifests and type definitions.
• stop monitoring the entity whose monitoring thread encountered the error
Arguments
iomgr An array containing the names of the interface entries where insertion and
ejection events are reported. In a default system
iomgr[0] = "/dev/mcd/.insert" and iomgr[1] = "/dev/mcd/.eject", but the
actual strings will reflect any command-line overrides.
CD_MEDIA_IOBLK
This routine interfaces the system to CD and DVD drives managed by the
devb/io-blk filesystem. It exploits the filesystem feature of automatically
invalidating open file descriptors upon media change: it opens the device
block-special file and periodically polls it, treating any EBADF result as a
transition indicator. It distinguishes between insertion and ejection by
examining the advertised size of the device.
The Argument= option sets the polling periods (in milliseconds) at which to
probe the file descriptor when the mediastore missing, and when it is present.
The default for this argument is "1000,2000", which corresponds to a
one-second interval when the mediastore is missing, and a two-second interval
when the mediastore is present.
USB_MEDIA_ENUM
Targets running QNX Neutrino 6.3.n releases only. This routine interfaces the
system to the umass-enum utility (which is replaced by enum-usb in QNX
Neutrino 6.4.0). It translates USB state change events from their native format
into the insertion and ejection events expected by the USB enumeration server
named by the Argument= option.
The Argument= option sets the name of the USB enumeration server to connect
to (typically "/dev/umass-enum").
PATH_MEDIA_PROCMGR
This routine connects the system to any device that dynamically attaches a
resource manager pathname when the resource manager is present, and detaches
the pathname when the resource manager is absent. It uses the procmgr_event()
facility (available from QNX Neutrino 6.3.0 SP2 onwards) to receive
notification of any changes to the global pathname space, then scans for the
addition and/or removal of any device mountpoints matching the pattern defined
by the callout name.
The Argument= option sets the name of the special directory where the OS
pathmgr maintains mountpoints (typically "/proc/mount").
PATH_MEDIA_SCAN
This routine scans for the presence of filenames that match the pattern defined
by the callout name. It is similar to the PATH_MEDIA_PROCMGR routine, but
since the creation and deletion of files doesn’t trigger any filesystem events, this
routine operates by scanning the specified directory at regular intervals.
The PATH_MEDIA_SCAN cause the MCD to behave differently, based on the
presence or absence of a trailing “/” character at the end of the pathname, as
follows:
• “/” present — send one notification when the pathname exists as a directory
(including as the root directory of a mounted filesystem)
• “/” absent — send a notification for every matching filename pattern in the
named directory
The Argument= option sets the poll period, in milliseconds, for scanning the
directory.
Arguments
Returns
• MCD_RULE_ABORT — there is a serious error; set errno and stop the remainder of
the detection process for the device
If the routine invoked by the callout requires access to a filesystem on the device, it can
use the DCMD_FSYS_MOUNTED_BY devctl to locate the appropriate mountpoint.
CD_AUDIO This rule determines if the CD media has any audio content (by
issuing a READ TOC command). It ignores the Argument=
option. The rule matches only if the media contains audio
tracks.
To facilitate the detection of mixed-mode and enhanced CDs that contain both audio
and filesystem components, you can configure the CD_AUDIO rule as a non-terminal
state; that is, with both the Match Rule= branch and the Fail Rule= branch
provided. With the rule configured this way, after matching audio content, you can
continue on with other rules to detect data content.
The READ DISK INFORMATION command and the physical detection of blank disks is
only supported by newer CD-RW hardware, and will fail on older CD-ROM hardware.
In fact, older hardware may not even detect the insertion of a blank or unrecorded disk.
/dev/hd*
The rules shown in the example above instruct the MCD to:
• Mount CD with fs-udf, specifying the preferred list of
formats to try; in order, this list will be UDF, RockRidge,
Joliet, then plain ISO9660.
• Ignore HD devices.
• Mount /dev/cdn as /fs/cd0n.
• Mount USB partitions as DOS to the first available
filesystem mountpoint.
See “MOUNT_FSYS special sequences” below for more
information about the mountpoint sequences. For more
information about UDF, see fs-udf.so.
The normv option is required to work around OS namespace race conditions if the
filesystem format is not known when trying multiple mounts with different DLLs. It is
also useful to prevent a mount if the media is ejected before the rule is scheduled to
run.
UNMOUNT_FSYS This rule unmounts the filesystem from the mediastore specified
in the rule name. It ignores the Argument= option.
This rule is typically used as the Stop Rule= of a
CD_MEDIA_IOBLK mediastore that uses the MOUNT_FSYS
action, when a mount would otherwise persist after the
mediastore ejection. If the mediastore is presented by a resmgr
that will exit or be terminated by an external manager (such as
USB), then that presentation implicitly unmounts any relevant
filesystem without the need for this rule. However, in most
instances where a MOUNT_FSYS is used, you should also
configure a matching UNMOUNT_FSYS in order to ensure that
the filesystem for an ejected mediastore is duly unmounted.
• %# expands to the major device number of the mediastore. For example, with
/fs/cd%#, /dev/cd0 will be mounted at /fs/cd0 and /dev/cd1 will be
mounted at /fs/cd1. %# does not permit multiple partitions; use %0.
Below is a sample mcd.mnt file that uses the %# and %0 special sequences.
#------------------------------------------------------
# Device Mountpt Type Options
#------------------------------------------------------
/dev/cd* /fs/cd%# udf normv
/dev/umass[0-9]* / enum
/dev/umass[0-9]*t1[1234] /fs/usb%0 dos
/dev/umass[0-9]*t1[1234].* /fs/usb%0 dos
/dev/umass[0-9]*t[146] /fs/usb%0 dos
/dev/umass[0-9]*t[146].* /fs/usb%0 dos
/dev/umass*t7[789] /fs/usb%0 qnx4
/dev/umass*t17[789] /fs/usb%0 qnx6 sync=optional
/dev/umass[0-9]* /fs/usb%0 dos
Client API
The MCD uses special rule entries created in the resource manager filesystem to notify
client applications of media content matches.
A client application can call open() to access the rule entry in which it is interested,
and when that rule is matched, it can then use read() to read from the entry the name
of the relevant mediastore. If QNET is active and the -L is not specified, the device
name returned from reading the MCD rule entry is a fully-qualified-path-name
(FQPN); this feature allows the string to be used as-is by any process on any node.
The read() function blocks until a match is made (unless oflag is set to
O_NONBLOCK). For non-blocking notifications, use ionotify(). To wait on multiple
rules, use select().
Maintained information
In order to inform each client once and only once of each match, the MCD server
maintains state information about each mediastore, matched rule, and client
application.
When a new mediastore is inserted, any matched rule triggers notifications to the
interested clients. If the mediastore was inserted before a client registered with the
MCD, the first read the client makes is satisfied immediately. This behavior eliminates
any start-up race conditions, such as, for example, there being media already in a drive
at system startup, and the content detection process completing before the higher-level
client applications are even started.
Example: Polling
The mcd device Start Rule= and Stop Rule= rule chains are mutually exclusive:
the ejection of a device cancels out inserted rules for that device (and vice-versa).
Therefore, if you use select() or ionotify(), you should use them in conjunction with a
non-blocking read(), as there is no guarantee that the notified state and/or rules of the
trigger will remain valid (for example, if the media is ejected between the calls to
ionotify() and read()).
The code snippet below illustrates one way to use ionotify() in conjunction with a
non-blocking read():
<PRE>
fd = open(rulename, O_RDONLY | O_NONBLOCK);
SIGEV_UNBLOCK_INIT(&evt);
for (;;) {
while (ionotify(fd, _NOTIFY_ACTION_POLLARM, _NOTIFY_COND_INPUT,
&evt) != 0) {
while (read(fd, device, sizeof(device)) > 0) {
// ’device’ matched on ’rulename’
}
}
pause();
}
</PRE>
In a real application, the event would likely be a pulse, and there would be an
event-driven loop rather than a pause as in the code snippet above.
Stale Rules
Stale rules may occur if there is client decoupling, and/or a delay between the
notification and the use of inserted mediastore; for example, due to the spawning of a
separate media application.
To avoid stale rules, the MCD can include the mediastore’s insertion sequence number
with the rule notification, and applications can then match this number against the
device entry in the /dev/mcd/.devices directory. If the device has been ejected
since the rule was triggered, these values will no longer match, indicating that the rule
no longer applies to the current device content, and that new rules may have been
re-triggered.
If the client application requires an insertion sequence number, the MCD uses an
XTYPE read to return an additional uint32_t of data with the mediastore name, and
the _IO_XTYPE_MQUEUE message priority code, avoiding the need to make changes
to the global <sys/io_msg.h> header file.
fd = open("/dev/mcd/CD_AUDIO", O_RDONLY);
_readx(fd, device, sizeof(device), _IO_XFLAG_BLOCK | _IO_XTYPE_MQUEUE,
&seq1, sizeof(seq1));
fd = open(device, O_RDONLY);
// If these match, the CD_AUDIO rule is the same and still valid
// and ’fd’ is open on that version of the media
if (seq1 == seq2) ...
Additional Information
This section describes how to use the MCD for specific operations:
To detect system media not handled by the routines included with the MCD:
1 Determine what distinguishes your new media type from all other media types.
In many cases, the difference might simply be the presence of certain files or
directories on the mediastore. For example, a navigation update disk might be
identified by the presence of acios_db.ini or config.nfm files. In this case,
2 Determine the precedence to probe for this media amongst the existing media
tests (first, last, after checking for audio content but before checking any other
data rules, etc).
3 In the configuration file, make a new rule section for this test, with the
appropriate Callout= rule, and splice it into the appropriate point of the
decision tree by editing the Match Rule= or Fail Rule= parameters of both
the preceding rule and the new rule. The name of the new rule can be used to
trigger any client application when the new content is matched.
The MCD can manage any kind of device, provided that a notification mechanism is
available to report on insertions and start the detection process.
For USB devices, you can use the following entry in the MCD configuration file:
[/fs/usb*]
Callout = PATH_MEDIA_PROCMGR
Argument = /proc/mount
Priority = 11,10
Start Rule = ...
Targets running QNX Neutrino 6.3.n releases only. For USB devices, the
umass-enum server in conjunction with the MCD’s built-in USB_MEDIA_ENUM
routine can provide the notification mechanism and start the detection process. Invoke
umass-enum with the -r option to activate its resource manager interface, and use the
following device entry in the MCD configuration file:
[/dev/umass/*]
Callout = USB_MEDIA_ENUM
Argument = /dev/umass-enum
Priority = 11,10
Start Rule = ...
For iPod devices, the device entries dynamically attach pathnames (when these
pathnames are present), and so can be handled with the MCD’s built-in
PATH_MEDIA_PROCMGR() routine. Use the following device entry in the MCD
configuration file for iPods:
[/fs/ipod*]
Callout = PATH_MEDIA_PROCMGR
Argument = /proc/mount
Priority = 11,10
Start Rule = ...
The MCD’s FNAME_MATCH routine attempts to access listed files by using the
underlying filesystem, which applies any rules appropriate for that filesystem in
conjunction with any specified mount options. Thus, case-sensitivity in pattern
matching depends on:
The table below lists the case-sensitivity and case-preserving characteristics of some
common filesystems:
Since the majority of mediastores used for multimedia storage are formatted for
DOS/Windows use, it is likely that the filesystem will be case-insensitive. This
case-insensitivity means that in any FNAME_MATCH rules the Argument= filename
list can be given in either upper or lower case.
The FNAME_PATTERN routine processes directory entries from the filesystem through
the libc fnmatch() function, which is case sensitive.
The directory output from each filesystem depends on whether it is case-preserving. If
the filesystem is not case-preserving, then default rules are used to control the filename
presentation. Refer to the cd case=lower|upper or the dos
sfn=lower|upper|windows filesystem mount options.
Since the most common multimedia formats are case-preserving and will use the exact
filename that a user or media application used to create their files, in any
FNAME_PATTERN rules the Argument= pattern list should be given in both upper and
lower case (as in the MIXED_AV rule in the Examples below.).
If you don’t want multiple media types to match and only want to match the first rule,
you can use the fact that if a matched rule has no Match Rule= branch the MCD
stops its detection process.
In the configuration file, simply arrange the rules, from the Start Rule= through the
Fail Rule= links, in priority order. Do not provide any Match Rule= branches.
The MCD detection framework will test these rules in sequence until one is matched,
then stop. For an example, see the VIDEO_CD and SVIDEO_CD entries in the
Examples below.
• Make a Match Rule= branch (so that it will always match when tested).
• Make this rule the Start Rule= of the device (with your dummy rule branching
to the original start rule).
Your application can now block on that new rule, via the normal resource manager
interface ("/dev/mcd/DISC_INSERTED"), waiting for device insertion. For example,
one of the example configurations in this document could be modified as follows:
[/dev/cd0]
Callout = CD_MEDIA_IOBLK
Argument = 1000,2000
Priority = 11,9
Start Rule = DISC_INSERTED
[DISC_INSERTED]
Match Rule = DVD_OR_CD
• In the device driver, wait for the CD-changer to be loaded and available for use by
the system
• When the CD-changer is available, write the name of the device (as a string, i.e.
/dev/cd0) to the MCD control point. Writing the name of the device to the
control point triggers the rest of the content detection process.
In the configuration file, the relevant device entry would be like this (note that no
Callout= is specified in this situation):
[/dev/cd0]
Priority = 11
Start Rule = ...
int notify;
The MCD’s MOUNT_FSYS rule can be used to determine if partition enumeration has
occurred on a device (USB stick). This capability can be used to try to mount a
filesystem on the raw device, if the device has not been partitioned.
In order to determine if partition has occurred, use the following configuration:
• Configure the USB enumerator to start devb-umass with the blk auto=none
option; that is, to not automatically enumerate partitions.
5b The code falls through and attempts fs-dos mount on raw device, which
should succeed, resulting in the appearance of an /fs/usb*.
X is the disk number (0, 1, 2, etc.). and N is the partition type (4, 11, 12, etc.); for
example: /dev/umass[0-9]* or /dev/umass[0-9]*t1[124]. Thus, a path with
umassX refers to a device, while a path with umassX tN refers to a partition.
Examples:
Consider the following sample configuration file for a CD-based system:
[/dev/cd0]
Callout = CD_MEDIA_IOBLK
Argument = 1000,2000
Priority = 11,9
Start Rule = DVD_OR_CD
[DVD_OR_CD]
Callout = DVD_OR_CD
Match Rule = DVD_AUDIO
Fail Rule = CD_AUDIO
[DVD_AUDIO]
Callout = FNAME_MATCH
Argument = /AUDIO_TS/AUDIO_TS.IFO
Match Rule = DVD_VIDEO
Fail Rule = DVD_VIDEO
[DVD_VIDEO]
Callout = FNAME_MATCH
Argument = /VIDEO_TS/VIDEO_TS.IFO
Fail Rule = VIDEO_CD
[CD_AUDIO]
Callout = CD_AUDIO
Match Rule = VIDEO_CD
Fail Rule = VIDEO_CD
[VIDEO_CD]
Callout = FNAME_MATCH
Argument = /VCD/INFO.VCD,/MPEGAV/AVSEQ01.DAT,/MPEGAV/MUSIC01.DAT
Fail Rule = SVIDEO_CD
[SVIDEO_CD]
Callout = FNAME_MATCH
Argument = /SVCD/INFO.SVD,/MPEGAV/AVSEQ01.MPG,/MPEG2/AVSEQ01.MPG
Fail Rule = MIXED_AV
[MIXED_AV]
Callout = FNAME_PATTERN
Argument = *.MP3,*.mp3,*.WMV,*.wmv,*.WMA,*.wma,*.AAC,*.aac,*.JPG,*.jpg,*.MPG,*.mpg
• When media is inserted, the content detection process begins with the
DVD_OR_CD rule.
• If this rule matches (is a DVD) then the process branches to the DVD_AUDIO rule.
If this rule fails, the process branches to the CD_AUDIO rule.
The DVD_AUDIO rule assumes the existence (using the built-in FNAME_MATCH
test) of a /AUDIO_TS/AUDIO_TS.IFO file on the DVD indicating DVD audio
content.
• Since both audio and video content may be present on a DVD, both Match and Fail
branch from here to the same rule to try next: DVD_VIDEO.
This behavior is similar to the behavior of the CD_AUDIO rule, as a CD can contain
both audio and data content.
Rules for determining CD data content, such VIDEO_CD or SVIDEO_CD, have
only a Fail branch, since a match at these levels is mutually exclusive with any
further content. If these rules match, then the content detection process stops.
• The final MIXED_AV rule has no branches. Regardless of the outcome, processing
stops at this rule.
During the content detection processing phase, any clients that have registered against
any matched rules will be notified. Multiple rules, or no rules at all, might be matched
by an inserted CD: an enhanced audio CD with a bonus music video might match both
CD_AUDIO and MIXED_AV rules, whereas a data CD backup of a development
system would match none.
Below is a configuration file involving USB devices; it requires that an external USB
enumerator invoke devb-umass blk auto=partition disk name=umass in
response to insertions.
[/dev/umass*t*]
Callout = PATH_MEDIA_PROCMGR
Argument = /proc/mount
Priority = 11,10
Start Rule = MOUNT
[MOUNT]
Callout = MOUNT_FSYS
Argument = /dev/shmem/mcd.mnt
[/fs/usb*]
Callout = PATH_MEDIA_PROCMGR
Argument = /proc/mount
Priority = 11,10
Start Rule = MIXED_AV
[MIXED_AV]
Callout = FNAME_PATTERN
Argument = *.MP3,*.mp3,*.WMV,*.wmv,*.WMA,*.wma,*.AAC,*.aac,*.JPG,*.jpg,*.MPG,*.mpg
Note that the device pattern specified in the example above avoids the raw device itself
and only applies to partition entries. The mount configuration /dev/shmem/mcd.mnt
referred to contains:
See also:
MultiMedia Engine (MME) Configuration Guide
Syntax:
mcs [-cdpV] [-a string] [-n name]* file...
Runs on:
QNX Neutrino
Options:
-a string Append string to the comment section.
-n name Specify the name of the comment section. The default is .comment.
Description:
The mcs utility manipulates the comment section of an object file.
See also:
nm, objcopy, objdump
Syntax:
melt [-cfvVz] [filename...]
Runs on:
Neutrino
Options:
See freeze.
Description:
The melt utility is equivalent to freeze -d. See the freeze utility for details.
Contributing author:
Leonid A. Broukhis
See also:
fcat, freeze, gzip, gunzip, zcat
Backing Up and Recovering Data in the Neutrino User’s Guide
Syntax:
mesg [toggle]
Runs on:
Neutrino
Options:
Where toggle is one of:
Description:
The mesg utility enables, disables, or queries broadcast messages on the console.
Name:
/etc/mib.txt
Description:
The mib.txt file defines the format for specifying variable names for SNMP utilities.
Each entry in the file is a variable name in ASN.1 notation for object identifiers, as
defined in RFC 1065. The format is:
[.]A.B.C.D...
• a decimal integer
Or:
• a symbol as found in RFC 1066 MIB — the case of the symbols isn’t significant
If you don’t precede the variable name with a . (dot), SNMP utilities add the prefix
iso.org.dod.internet.mgmt.mib to the name. To fully specify the variable
name, you must place a . (dot) before the first sub-identifier.
For example, the following refer to the same variable:
1.1.0 system.sysDescr.0 1.sysDescr.0 1.3.6.1.2.1.1.1.0
iso.org.dod.internet.mgmt.mib.system.sysDescr.0 .1.3.6.1.2.1.1.sysDescr.0
SNMP utilities search for a description of the variables in the following files, in this
order:
3 /etc/mib.txt
See also:
snmpget, snmpgetnext, snmptest, snmptrapd, snmpwalk
Based on ISO IS 8824 (ASN.1), RFC 1065, RFC 1066, RFC 1067, RFC 1446
Syntax:
mixer [-@] [-c card] [-m device] [-o display_level]
Runs on:
Neutrino
Options:
-@ Show subchannel volumes.
-o display_level Which settings are shown when the mixer starts up;
display_level is one of:
• 1 — display the playback settings.
• 2 — display the record settings.
• 3 — display playback and open-settings.
Description:
The mixer command starts the audio-mixer-control application:
The mixer uses the device /dev/snd/mixerCcardDdevice, where card and device are
the values specified for the -c and -m options.
Examples:
Start mixer for AuReal vortex 2:
mixer &
mixer -@ -c 0 -m 0 &
Files:
libasound.so The shared object for the sound library.
/etc/system/config/audio/card name.io-ado-cfg
Where card name (set by the ado_card_longname() function) is
the long name used by the driver and where mixer stores
configuration data.
Syntax:
mkasmoff infile outfile
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
infile The name of an input ELF or COFF file.
Description:
The mkasmoff utility reads the infile ELF or COFF object file (created with the
macros in <mkasmoff.h>) and creates an assembler include file called outfile
containing the appropriate macro definitions.
Syntax:
mkcldr [options]* input file output file
Runs on:
Neutrino
Targets:
ARM, PowerPC, SH, x86
Options:
-c Name of the CHARMAP file (typically posix/UTF-8.cm from CLDR).
Description:
The mkcldr utility converts standard CLDR language collation (or sort order) tables
into a format usable by the libqdb_cldr.so DLL. Specifically, it reads the contents
of a text input file in the CLDR (Common Locale Data Repository) POSIX format and
writes this content to an output file as binary data suitable for libqdb_cldr.so.
To use other language collation tables, you can download them from
cldr.unicode.org, then use mkcldr to convert them.
If the collation rules in the files shipped with the QNX Neutrino or in the downloaded
files do not correspond to the rules required for your locale or implementation, you
can adjust them, then use mkcldr to create the files with the binary data format
required by libqdb_cldr.so.
Examples:
The following example converts the file for German used in Switzerland:
$ cd cldr-1.4.1/posix
$ mkcldr -c UTF-8.cm de_CH.UTF-8.src /etc/cldr/de_CH
The UTF-8.cm file is simply a database that maps textual character descriptions to
their Unicode value; it is used in parsing the collation information.
See also:
“Customizing language sort orders for libqdb_cldr.so” in Technotes, “Configuring
Internationalization” in the MME Developer’s Guide
Syntax:
mkbuild -ws workspace [options]
Runs on:
Windows, Linux hosts
Options:
dir A full project pathname where one or more projects are built.
project The name of the projects to build for one of the project types
supported by the IDE: Makefile project, QNX project, Managed
project, and Container project.
-targets target1[,target2. . . ]
The make targets (the build, clean, rebuild or custom make
target).
No spaces are allowed in project names, nor in the list of projects or targets.
Description:
The mkbuild utility builds one or more projects in the IDE workspace, producing the
same results as an interactive build in the IDE. Building from the command line using
mkbuild uses the IDE project setup, and it runs the IDE (without the GUI) to perform
a build for specified projects.
mkbuild doesn’t work on QNX Neutrino hosts because the IDE isn’t included on
self-hosted QNX Neutrino systems.
Examples:
Build a default target and variant for the project projectA:
mkbuild /home/user/workspace/projectA
Build the projectA and projectB projects with clean, all targets, and the x86
variant/configuration:
mkbuild -ws /home/user/workspace -projects projectA,projectB -target clean,all -variant x86
Exit status:
>0 All the specified projects were built successfully.
0 An error occurred.
See also:
chmod, mkefs, mketfs, mkifs, mkimage, mksbp, qde
“Building projects” in the Developing C/C++ Programs chapter in the IDE User’s
Guide
Syntax:
mkdir [-m mode] [-p] dir...
Runs on:
QNX Neutrino
Options:
-m mode When creating the directory, set the permission bits of the new directory
to the specified mode value.
The mode argument is a symbolic_mode string, as defined for the chmod
utility. In the symbolic_mode strings, the op characters + and - are
interpreted relative to the default file mode for that file type:
If you specify both the -p and -m options, any intermediate directories you have
created have mode u+wx.
Description:
The mkdir utility creates the directories specified by the dir operands, in the order the
dir operands are specified.
To create a directory, you must have write permission on the parent directory, or be
root.
Not all filesystems support the creation of directories. For example, /dev/shmem
(which really isn’t a filesystem but looks like one) doesn’t. For more information, see
the Working with Filesystems chapter of the QNX Neutrino User’s Guide.
The default file mode for directories is a=rwx (777), with selected permissions
removed in accordance with the file mode creation mask. (see the umask utility).
For intermediate pathname components created by mkdir, the mode is the default
modified by u+wx so that the subdirectories can always be created regardless of the
file-mode creation mask. If you want to assign different ultimate permissions for the
intermediate directories, you can do so with the chmod utility.
When using -p with -m, each intermediate directory that doesn’t exist is created with
u+wx modes, regardless of the file mode creation mask. The specified mode applies
only to the last directory specified. For example:
gives dir and dir1 the default permissions for intermediate directories (i.e. u+wx).
The directory dir2 is given a+rwx permission.
Examples:
Create a directory named /home/debbie:
mkdir /home/debbie
Exit status:
0 All the specified directories were created successfully, or the -p option was
specified and all the specified directories now exist.
Caveats:
If the mkdir utility is terminated by a signal, some of the specified directories may
have already been created.
See also:
chmod, rmdir, umask
Syntax:
mkdosfs [-C|c size] [-e number]
[-F type] [-f number] [-h number]
[-I vol_id] [-L vol_label] [-m media]
[-O oem_label] [-R|r] [-S size] [-s size]
device | mountpoint | file
Runs on:
Neutrino
Options:
-C size Minimum default cluster size. Don’t specify both -C and -c.
-c size Cluster size for the filesystem; the default is determined by disk
geometry. Don’t specify both -c and -C.
-I vol_id Set the volume ID/serial number; the default is based on the
current time.
-m media Media descriptor byte; the default is 0xF0 or, if there are hidden
sectors, 0xF8.
-S size Sector size for the filesystem; the default is determined by disk
geometry.
-s size Set the size (number of sectors) in the filesystem; the default is
determined by disk geometry.
device The device name to host the DOS filesystem (e.g. /dev/hd0t11).
Description:
The mkdosfs utility formats a DOS filesystem on the specified target (typically a disk
device or partition).
If you don’t specify essential user options such as FAT type and cluster size, mkdosfs
formats the DOS filesystem using the most suitable options for the size and disk
geometry of the host. You can override this default auto-configuration and force a
particular format to be used by setting the options you need.
a Read-only.
b Not usually necessary.
For more information, see the Filesystems chapter of the System Architecture guide.
Examples:
# mkdosfs /dev/hd0t6
Exit status:
0 The filesystem was constructed without error.
Contributing author:
Robert Nordier
License:
This utility is based on software from Robert Nordier; for licensing information, see
the Third Party License Terms List at
http://licensing.qnx.com/third-party-terms/.
Caveats:
The mkdosfs utility destroys or overwrites any existing filesystem on the target.
See also:
chkdosfs, devb-eide, dinit, fs-dos.so, mkqnx6fs mount, umount
Syntax:
mkefs [-c cache_dir] -t ffs2 | ffs3 [-l inputline] [-nv]
[buildfile [outputfile]]
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
-c cache_dir Cache compressed files in cache_dir.
-l inputline (“el”) Process inputline before interpretation of the buildfile begins.
Input lines given to mkefs should be quoted to prevent
interpretation by the shell (as mkefs input lines often contain
spaces). Multiple -l options are processed in the order specified.
No default.
-n Don’t use timestamps in the files. Using the -n option permits
identical images in binary format. Specifying additional -n options
strips all time information from files.
-t ffs2 | -t ffs3
Set the type of output file system. Use -t ffs2 to make a version 2
flash filesystem image. Use -t ffs3 to make a version 3 flash
filesystem image. The default is ffs3.
-v Operate verbosely. Specifying additional -v options increases
verbosity. Default is quiet operation.
Description:
The mkefs utility reads a text buildfile describing an embedded filesystem and
produces a binary image file containing the embedded filesystem. You can copy this
file to flash at a later stage, or use mkimage to combine it with an OS image before
downloading.
Don’t confuse this command with mkifs, which builds an OS image filesystem, or
mketfs, which builds an embedded transaction filesystem (ETFS).
The input and output files are specified on the command line:
buildfile The filename of the buildfile that describes the contents of the embedded
filesystem; use “-” to specify standard input (the default).
outputfile The filename of the image file containing the embedded filesystem; use
“-” to specify standard output (the default). Note that you can specify
the outputfile only if you specified a buildfile.
Buildfiles
The buildfile uses the same grammar as the mkifs command, but supports different
attributes.
The buildfile is basically just a list of files that you want to be included in the
embedded filesystem image file when it’s built by mkefs. As well as the files to be
included, you can specify various attributes that are used to set parameters of the
filesystem and the files in it. For example, you can specify the maximum size of the
filesystem, or the user and group IDs of the individual files.
You can’t use a backslash (\) to break long lines into smaller pieces.
In a buildfile, a pound sign (#) indicates a comment; anything between it and the end
of the line is ignored. There must be a space between a buildfile command and the
pound sign.
Each line is in the form:
[attributes] file_specification
where the attributes (with the enclosing square brackets) and the file specification are
both optional.
Attributes provide information about the file following the attribute. They’re enclosed
in square brackets; when combining attributes (e.g. to specify both the user ID and the
group ID), enclose both attribute tokens in the same pair of square brackets. For
example:
# correct way
[uid=5 gid=5] filename
# incorrect way
[uid=5] [gid=5] filename
boolean attributes Those prefixed with a plus (“+”) or minus (“-”) sign.
value attributes Those ending with an equals sign (“=”) followed by a value.
Don’t put any spaces around the equals sign.
A question mark (?) before an attribute makes the setting conditional. The attribute is
set only if it hasn’t already been set. For example, ?+bigendian sets the
+bigendian attribute only if +bigendian or -bigendian hasn’t already been set.
The file_specification takes one of the following forms:
target_path=host_path
The specified file or contents of the specified directory are fetched from the
host filesystem and placed into the image.
target_path={contents}
An inline definition. The contents of the file are listed within the buildfile
itself, enclosed in braces ({ }) — the file doesn’t exist on the host system
anywhere. The contents of the inline file can’t be on the same line as the
opening or closing brace.
The mkefs utility doesn’t parse the contents of an inline file for anything but the
closing brace. For example, mkefs doesn’t interpret a pound sign (#) in an inline file
as the beginning of a comment. The syntax of the inline file depends on what it’s used
for on the target system.
Closing braces (}) and backslashes (\) in an inline file must be escaped with a
backslash.
You can enclose a filename in double quotes ("") if it includes spaces or unusual
characters.
Attributes
The mkefs command supports the following attributes:
• +|-bigendian
• block_size=bsize
• cd=filename
• dperms=dperm_spec
• filter=filter_spec
• +|-followlink
• gid=id_spec
• max_size=msize
• min_size=tsize
• mount=filename
• mountperms=perm_spec
• +|-optional
• perms=perm_spec
• prefix=prefix_spec
• search=path:path. . .
• spare_blocks=sblocks
• type=file_type
• uid=id_spec
An OR-bar indicates that either the first element or the second element must be
present, but not both (e.g. +|- bigendian means either +bigendian or
-bigendian, but not +-bigendian).
block_size attribute
block_size=bsize
Set the block size for the embedded filesystem. The block size depends on what
memory devices you have in your target hardware and how they’re arranged. For
example, two interleaved 64K × 8-bit devices configured for a 16-bit interface have a
block size of 128K bytes. The default block size is 64K bytes.
cd attribute
cd=filename
Set the current working directory to the specified pathname before attempting to open
the host file. Default is the directory from which mkefs was invoked.
dperms attribute
dperms=dperms_spec
Set the access permissions of the directory. If specified as a number, the permissions
are set to that number (just like the chmod command). If specified as an asterisk (“*”),
the host directory’s permissions are used; for an inline directory, the permissions are
obtained from the umask of the user running mkefs. Otherwise, a symbolic mode
string (which is a subset of chmod’s) is used to delete, add, or set permissions.
The symbolic mode string consists of:
1 a combination of u, g, o, and a
2 one of -, =, or +
3 a combination of r, w, x, s, g, and t.
You can include more than one symbolic mode string, separating them with a comma
(,).
The default dperms_spec is “*”.
filter attribute
filter=filter_spec
Run the host file through the filter program specified, presenting the host file data as
standard input to the program and using the standard output from the program as the
data to be placed into the embedded filesystem. Default is no filter.
The most common filter you’re likely to use with the embedded filesystem is
deflate. This compresses the file before copying it to the embedded filesystem. For
example:
[filter="deflate"]
You can specify a filter_spec of none. This is useful if you need to override a global
filter specification.
gid attribute
gid=id_spec
Set the group ID number for the file. The value of this attribute may be either a
number or an asterisk (*). If it’s an asterisk, the group ID is taken from the host file;
for an inline file, the group ID is the group of the user running mkefs. The default
value for this attribute is *.
max_size attribute
max_size=size
Set the maximum size of the embedded filesystem. You can set this attribute if you
don’t want the filesystem to exceed a maximum size. If this occurs while mkefs is
building the filesystem, you’ll see a warning message. The default is 4G bytes.
min_size attribute
min_size=size
Set the minimum size of the embedded filesystem. If the size of the filesystem is less
than this size after all the specified files have been added, then the filesystem is padded
to the required size. The default is unspecified, meaning that no padding occurs.
mount attribute
mount=filename
Specify the mountpoint for the embedded filesystem. You can override the mountpoint
with the -n option to the flashctl command.
The default is "", which makes the flash filesystem drivers (devf-*) use the
appropriate default, usually /fs1p1.
mountperms attribute
mountperms=perms_spec
Set the access permissions for mountpoints. If specified as a number, the permissions
are set to that number (just like the chmod command). Otherwise, a symbolic mode
string (which is a subset of chmod’s) is used to delete, add, or set permissions.
The symbolic mode string consists of:
1 a combination of u, g, o, and a
2 one of -, =, or +
3 a combination of r, w, x, s, g, and t.
You can include more than one symbolic mode string, separating them with a comma
(,).
The default perms_spec is “0777”.
If true, and the host file can’t be found, output a warning and continue building the
embedded filesystem. If false, and the host file can’t be found, output an error message
and exit mkefs. The default is false.
perms attribute
perms=perms_spec
Set the access permissions of the file. If specified as a number, the permissions are set
to that number (just like the chmod command). If specified as an asterisk (“*”), the
host file’s permissions are used; for an inline file, permissions of 0666 are used.
Otherwise, a symbolic mode string (which is a subset of chmod’s) is used to delete,
add, or set permissions.
The symbolic mode string consists of:
1 a combination of u, g, o, and a
2 one of -, =, or +
3 a combination of r, w, x, s, g, and t.
You can include more than one symbolic mode string, separating them with a comma
(,).
The default perms_spec is “*”.
When running on a Windows host, mkefs can’t get the execute (x), setuid (“set user
ID”), or setgid (“set group ID”) permissions from the file. Use the perms attribute to
specify these permissions explicitly. You might also have to use the uid and gid
attributes to set the ownership correctly. To determine whether or not a utility needs to
have the setuid or setgid permission set, see its entry in the Utilities Reference.
prefix attribute
prefix=prefix_spec
Set the prefix on the target file names. The default is the empty string.
search attribute
search=path:path:...
This attribute specifies that mkefs should search for the file in the named locations on
the host system. The search directory portion of the host file name isn’t included in the
name that’s stored in the image file system.
Colon separators and forward slashes in the paths are the standard Unix conventions,
but for Windows searches, you must use the standard Windows conventions, such as
semicolon separators and backslashes in the paths.
spare_blocks attribute
spare_blocks=sblocks
Set the number of spare blocks to be used by the embedded filesystem. If you want the
embedded filesystem to be able to reclaim the space taken up by deleted files, set the
number of spare blocks to 1 or more. The default is 1.
type attribute
type=file_type
Sets the type of the files being created in the embedded filesystem. Allowable types
are:
• dir — a directory.
Specifying [type=dir] tells mkefs to make the named file a directory; you don’t
need to specify the type when you’re copying the contents of a directory. For example,
this command:
[type=dir]/usr/bin=/usr/nto/x86/bin
/usr/bin=/usr/nto/x86/bin
uid attribute
uid=id_spec
Set the user ID number for the file. The value of this attribute may be either a number
or an asterisk (*). If it’s an asterisk, the user ID is taken from the host file; for an inline
file, the user ID is the user running mkefs. The default value for this attribute is “*”.
Examples:
Here’s a sample buildfile, my_efs.bld:
[block_size=128k spare_blocks=1]
/home/jwall/nto_flash
In this example, we’ve specified a block size of 128K and one spare block. The files
and subdirectories from the /home/jwall/nto_flash directory on the host system
are to be recursively copied into the root directory of the embedded filesystem.
To create an embedded filesystem image file using the above buildfile, invoke mkefs
as follows:
This creates the my_image.efs file containing the embedded filesystem, which can
then be copied to the target system.
Exit status:
0 Successful completion.
1 An error occurred.
See also:
deflate, devf-*, dumpefs, flashctl, inflator, mkifs
Making an OS Image chapter of Building Embedded Systems
QNX Neutrino System Architecture
Syntax:
mketfs [-l inputline] [-nv] [buildfile [outputfile]]
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
-l inputline (“el”) Process inputline before interpretation of the buildfile begins.
Input lines given to mketfs should be quoted to prevent
interpretation by the shell (as mketfs input lines often contain
spaces). Multiple -l options are processed in the order specified. No
default.
Description:
The mketfs utility reads a text buildfile describing an embedded transaction
filesystem (ETFS) and produces a binary image file containing the ETFS as a sequence
of transactions. You can copy this file to flash at a later stage, using etfsctl.
Don’t confuse this command with mkifs, which builds an OS image filesystem, or
mkefs, which builds an embedded filesystem.
The input and output files are specified on the command line:
buildfile The filename of the buildfile that describes the contents of the embedded
filesystem; use “-” to specify standard input (the default).
outputfile The filename of the image file containing the ETFS; use “-” to specify
standard output (the default). Note that you can specify the outputfile
only if you specified a buildfile.
Buildfiles
The buildfile uses the same grammar as the mkifs command, but supports different
attributes.
The buildfile is basically just a list of files that you want to be included in the ETFS
image file when it’s built by mketfs. As well as the files to be included, you can
specify various attributes that are used to set parameters of the filesystem and the files
in it. For example, you can specify the maximum size of the filesystem, or the user and
group IDs of the individual files.
You can’t use a backslash (\) to break long lines into smaller pieces.
In a buildfile, a pound sign (#) indicates a comment; anything between it and the end
of the line is ignored. There must be a space between a buildfile command and the
pound sign.
Each line is in the form:
[attributes] file_specification
where the attributes (with the enclosing square brackets) and the file specification are
both optional.
Attributes provide information about the file following the attribute. They’re enclosed
in square brackets; when combining attributes (e.g. to specify both the user ID and the
group ID), enclose both attribute tokens in the same pair of square brackets. For
example:
# correct way
[uid=5 gid=5] filename
# incorrect way
[uid=5] [gid=5] filename
boolean attributes Those prefixed with a plus (“+”) or minus (“-”) sign.
value attributes Those ending with an equals sign (“=”) followed by a value.
Don’t put any spaces around the equals sign.
A question mark (?) before an attribute makes the setting conditional. The attribute is
set only if it hasn’t already been set. For example, ?+bigendian sets the
+bigendian attribute only if +bigendian or -bigendian hasn’t already been set.
The file_specification takes one of the following forms:
target_path=host_path
The specified file or contents of the specified directory are fetched from the
host filesystem and placed into the image.
target_path={contents}
An inline definition. The contents of the file are listed within the buildfile
itself, enclosed in braces ({ }) — the file doesn’t exist on the host system
anywhere. The contents of the inline file can’t be on the same line as the
opening or closing brace.
The mketfs utility doesn’t parse the contents of an inline file for anything but the
closing brace. For example, mketfs doesn’t interpret a pound sign (#) in an inline file
as the beginning of a comment. The syntax of the inline file depends on what it’s used
for on the target system.
Closing braces (}) and backslashes (\) in an inline file must be escaped with a
backslash.
You can enclose a filename in double quotes ("") if it includes spaces or unusual
characters.
Attributes
The mketfs command supports the following attributes:
• +|-bigendian
• block_size=bsize
• cd=filename
• cluster_size=csize
• dperms=dperm_spec
• filter=filter_spec
• +|-followlink
• gid=id_spec
• mountperms=perm_spec
• num_blocks=num
• +|-optional
• perms=perm_spec
• prefix=prefix_spec
• search=path:path. . .
• type=file_type
• uid=id_spec
An OR-bar indicates that either the first element or the second element must be
present, but not both (e.g. +|- bigendian means either +bigendian or
-bigendian, but not +-bigendian).
block_size attribute
block_size=bsize
Set the block size for the ETFS. The block size depends on what memory device you
have in your target hardware. The default block size is 16 KB.
cd attribute
cd=filename
Set the current working directory to the specified pathname before attempting to open
the host file. Default is the directory from which mketfs was invoked.
cluster_size attribute
cluster_size=csize
Set the cluster size for the ETFS. The cluster size depends on what memory device
you have in your target hardware. The default cluster size is 1 KB.
dperms attribute
dperms=dperms_spec
Set the access permissions of the directory. If specified as a number, the permissions
are set to that number (just like the chmod command). If specified as an asterisk (*),
the host directory’s permissions are used; for an inline directory, the permissions are
obtained from the umask of the user running mketfs. Otherwise, a symbolic mode
string (which is a subset of chmod’s) is used to delete, add, or set permissions.
The symbolic mode string consists of:
1 a combination of u, g, o, and a
2 one of -, =, or +
3 a combination of r, w, x, s, g, and t.
You can include more than one symbolic mode string, separating them with a comma
(,).
The default dperms_spec is *.
filter attribute
filter=filter_spec
Run the host file through the filter program specified, presenting the host file data as
standard input to the program and using the standard output from the program as the
data to be placed into the embedded filesystem. Default is no filter.
You can specify a filter_spec of none. This is useful if you need to override a global
filter specification.
If you specify +followlink or omit it, mketfs follows any links and makes
target_path a copy of host_path.
If you specify -followlink, mketfs creates a link called target_path that points to
whatever host_path points at. It’s up to you to make sure that the file pointed to is
placed in the image.
gid attribute
gid=id_spec
Set the group ID number for the file. The value of this attribute may be either a
number or an asterisk (*). If it’s an asterisk, the group ID is taken from the host file;
for an inline file, the group ID is the group of the user running mketfs. The default
value for this attribute is *.
mountperms attribute
mountperms=perms_spec
Set the access permissions for mountpoints. If specified as a number, the permissions
are set to that number (just like the chmod command). Otherwise, a symbolic mode
string (which is a subset of chmod’s) is used to delete, add, or set permissions.
The symbolic mode string consists of:
1 a combination of u, g, o, and a
2 one of -, =, or +
3 a combination of r, w, x, s, g, and t.
You can include more than one symbolic mode string, separating them with a comma
(,).
The default perms_spec is “0775”.
num_blocks attribute
num_blocks=num
Set the number of blocks in the ETFS. If the number of blocks is specified, then the
image file will be padded out to that size.
If true, and the host file can’t be found, output a warning and continue building the
embedded filesystem. If false, and the host file can’t be found, output an error message
and exit mketfs. The default is false.
perms attribute
perms=perms_spec
Set the access permissions of the file. If specified as a number, the permissions are set
to that number (just like the chmod command). If specified as an asterisk (“*”), the
host file’s permissions are used; for an inline file, permissions of 0666 are used.
Otherwise, a symbolic mode string (which is a subset of chmod’s) is used to delete,
add, or set permissions.
The symbolic mode string consists of:
1 a combination of u, g, o, and a
2 one of -, =, or +
3 a combination of r, w, x, s, g, and t.
You can include more than one symbolic mode string, separating them with a comma
(,).
The default perms_spec is *.
When running on a Windows host, mketfs can’t get the execute (x), setuid (“set user
ID”), or setgid (“set group ID”) permissions from the file. Use the perms attribute to
specify these permissions explicitly. You might also have to use the uid and gid
attributes to set the ownership correctly. To determine whether or not a utility needs to
have the setuid or setgid permission set, see its entry in the Utilities Reference.
prefix attribute
prefix=prefix_spec
Set the prefix on the target file names. The default is the empty string.
search attribute
search=path:path:...
This attribute specifies that mketfs should search for the file in the named locations
on the host system. The search directory portion of the host file name isn’t included in
the name that’s stored in the ETFS.
Colon separators and forward slashes in the paths are the standard Unix conventions,
but for Windows searches, you must use the standard Windows conventions, such as
semicolon separators and backslashes in the paths.
type attribute
type=file_type
Sets the type of the files being created in the ETFS. Allowable types are:
• dir — a directory.
Specifying [type=dir] tells mketfs to make the named file a directory; you don’t
need to specify the type when you’re copying the contents of a directory. For example,
this command:
[type=dir]/usr/bin=/usr/nto/x86/bin
/usr/bin=/usr/nto/x86/bin
uid attribute
uid=id_spec
Set the user ID number for the file. The value of this attribute may be either a number
or an asterisk (*). If it’s an asterisk, the user ID is taken from the host file; for an inline
file, the user ID is the user running mketfs. The default value for this attribute is *.
Examples:
Here’s a sample buildfile, my_etfs.bld:
# A sample buildfile for mketfs
This creates the my_image.etfs file containing the ETFS filesystem, which can then
be copied to the target system as follows:
Exit status:
0 Successful completion.
1 An error occurred.
See also:
etfsctl, fs-etfs-ram
“Embedded transaction filesystem (ETFS)” in the Filesystems chapter of the System
Architecture guide
“Filesystem limits” in the Understanding System Limits chapter of the QNX Neutrino
User’s Guide
Syntax:
mkfifo [-p] [-m mode] file...
Runs on:
Neutrino
Options:
-m mode When creating the FIFO special file, set the file permission bits of the
new file to the specified mode value.
The mode option argument is a symbolic_mode string, as defined for the
chmod utility. In the symbolic_mode strings, the op characters + and -
are interpreted relative to the default file mode for that file type, as
follows:
Description:
The mkfifo utility creates the FIFO special files specified by the file operands in the
order they’re specified.
To create a FIFO in a directory, you must have write permission for that directory or
be logged in as root.
The default file mode for FIFO files is a=rw (666) with selected permissions removed
in accordance with the file mode creation mask (see umask). For intermediate
pathname components created by mkfifo, the mode is the default modified by u+wx
so that any subdirectories and the FIFO file can always be created regardless of the file
mode creation mask. If you wish to assign different ultimate permissions for the
intermediate directories, you can change these permissions afterward with the chmod
utility.
Exit status:
0 Success.
Caveats:
If the mkfifo utility is terminated by a signal, some of the specified FIFO special files
or intermediate directories might have already been created, and may not be
automatically removed.
See also:
chmod, ln, mkdir, touch
Syntax:
mkfontdir [options]
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
-b Backup the old fontdir file before overwriting.
-f pattern Construct details for this font pattern only (the default is *).
-i file The name of the font index file (the default is fontdir in the font
file directory). If the name doesn’t start with any of the characters /,
./, or ../, the index file is assumed to be located in the font
directory specified by the -d option.
-m file Deprecated.
-S directory The directory containing font engines. The default is the directory
currently used by phfont.
-v Increase verbosity.
Description:
The mkfontdir utility builds an index file for the fonts in a directory. This index
contains information such as the name and type of each font, its size and style, a
textual description of the font family, and the range of characters defined within the
font. To be available to an application, at least one font must be defined in this
configuration file.
If you’re using mkfontdir under Linux, you should make sure that your
LD_LIBRARY_PATH environment variable includes
/opt/qnx630/host/linux/x86/usr/lib. As well, because Linux has its own
version of mkfontdir, you need to start the utility with the full path,
/opt/qnx630/host/linux/x86/usr/bin/mkfontdir, to start the QNX version.
Examples:
Create an index file called my_fontdir in the current working directory:
Files:
${PHOTON_PATH}/font_repository/fontdir
The index files for the fonts.
Environment variables:
PHOTON_PATH The name of the root directory containing Photon files.
Exit status:
0 Success.
Syntax:
mkifs [-a suffix] [-l inputline] [-n[n]] [-r rootdir]
[-s section] [-v] [buildfile [imagefile]]
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
-a suffix Append a suffix to symbol files generated via [+keeplinked].
-n[n] Force the modification times of all inline files to be 0. If you specify
-nn, mkifs sets the modification times of all files to 0.
When mkifs adds files to an IFS image, it uses the timestamp
information from the file on the host machine. If mkifs is creating an
inline file (which doesn’t exist on the host machine), it has to
generate its own timestamp information. By default, it’s the time that
the image is generated.
This results in different checksum values for two identical builds
(because the file’s creation or modification times are different). If you
use -n, the checksum value is the same on all identical builds.
The -nn option addresses a quirk in NTFS relating to daylight
savings time. This option forces the modification time for all files in
the IFS image to be set to 0. This ensures that subsequent builds of
the same IFS image have the same checksum.
-r rootdir Search the default paths in the rootdir directory before searching
them in the default location. Normally, mkifs searches the default
paths in the sequence shown in MKIFS_PATH below. If you specify
the -r option, mkifs first searches the same paths prefixed with the
rootdir variable instead of ${QNX_TARGET}, like this:
1 rootdir/${PROCESSOR}/sbin
2 all other default paths, similarly prefixed with rootdir
3 ${QNX_TARGET}/${PROCESSOR}/sbin
4 all other normal default paths prefixed with ${QNX_TARGET}
The structure of the directory paths under rootdir must be identical to
that of the default paths under ${QNX_TARGET}, but rootdir itself
may be any path you choose. For example, if you wanted to include
this file:
/dev/ppcbe/sbin/pci-ppc405
you would specify the option like this:
-r /dev
-s section Don’t strip the named section from ELF executables when creating
an IFS image. You can use this option more than once to specify
additional sections.
By default, mkifs doesn’t strip the QNX_Phab (Photon resources),
QNX_usage (usage message), and QNX_info (build properties)
sections.
Description:
The mkifs utility is used to create an OS image filesystem from a buildfile
specification.
Don’t confuse this command with mkefs, which builds an embedded filesystem, or
mketfs, which builds an embedded transaction filesystem (ETFS).
buildfile The input buildfile that mkifs is to construct an image from; use - to
specify standard input (the default).
imagefile The file to contain the image that mkifs builds; use - to specify
standard output (the default). Note that you can specify the imagefile
only if you’ve specified the buildfile.
Buildfiles
The buildfile uses the same grammar as the mkefs command, but supports different
attributes.
The buildfile specifies a list of files of various types; these files are placed by mkifs
into the output image. As well as the files to be included, you can specify various
attributes that are used to set parameters of the files or the image as a whole.
You can’t use a backslash (\) to break long lines into smaller pieces.
In a buildfile, a pound sign (#) indicates a comment; anything between it and the end
of the line is ignored. There must be a space between a buildfile command and the
pound sign.
Each line is in the form:
[attributes] file_specification
where the attributes (with the enclosing square brackets) and the file specification are
both optional.
You can use an attribute:
• on the same line as a filename — the attribute modifies only that file
Enclose the attributes in square brackets; when combining attributes (e.g. to specify
both the user ID and the group ID), enclose both attribute tokens in the same pair of
square brackets. For example:
# correct way
[uid=5 gid=5] filename
# incorrect way
[uid=5] [gid=5] filename
boolean attributes Those prefixed with a plus (“+”) or minus (“-”) sign.
value attributes Those ending with an equals sign (“=”) followed by a value.
Don’t put any spaces around the equals sign.
A question mark (?) before an attribute makes the setting conditional. The attribute is
set only if it hasn’t already been set. For example, ?+bigendian sets the
+bigendian attribute only if +bigendian or -bigendian hasn’t already been set.
The file_specification takes one of the following forms:
target_path=host_path
The specified file or contents of the specified directory are fetched from the
host filesystem and placed into the image.
target_path={contents}
An inline definition. The contents of the file are listed within the buildfile
itself, enclosed in braces ({ }) — the file doesn’t exist on the host system
anywhere. The contents of the inline file can’t be on the same line as the
opening or closing brace.
The mkifs utility doesn’t parse the contents of an inline file for anything but the
closing brace. For example, mkifs doesn’t interpret a pound sign (#) in an inline file
as the beginning of a comment. The syntax of the inline file depends on what it’s used
for on the target system.
Closing braces (}) and backslashes (\) in an inline file must be escaped with a
backslash.
Either class of file may be preceded by zero or more attributes. These attributes are
used to specify the characteristics of the file (e.g. the user ID that is to own the file on
the target system, the type of file, etc.).
By default, mkifs strips debugging information from executable files that you include
in the image. Doing this helps to reduce the size of the image. To keep this
information, specify the +raw attribute.
By default, mkifs doesn’t strip the QNX_Phab (Photon resources), QNX_usage (usage
message), and QNX_info (build properties) sections. You can use the -s option to
specify additional sections not to be stripped.
You can enclose a filename in double quotes ("") if it includes spaces or unusual
characters.
Attributes
The mkifs command supports the following attributes:
• +|-autolink
• +|-big_pages
• +|-bigendian
• cd=path
• chain=addr
• code=uip_spec
• +|-compress
• data=uip_spec
• dperms=perm_spec
• filter=filter_spec
• +|-followlink
• gid=id_spec
• image=addr_space_spec
• +|-keeplinked
• module=module_name
• +|-optional
• +|-page_align
• pagesizes=size[,size]...
• perms=perm_spec
• phys_align=size
• physical=boot_spec
• prefix=prefix_spec
• ram=addr_space_spec
• +|-raw
• +|-script
• search=filename:filename:. . .
• type=file_type
• uid=id_spec
• virtual=[cpu_name,]bootfile_name [filter_args]
An OR-bar indicates that either the first or second element must be present, but not
both (e.g. +|- bigendian means either +bigendian or -bigendian, but not
+-bigendian).
If the autolink attribute is on (which it is by default), when mkifs detects that it’s
processing a shared object, it looks inside the image for the SONAME (specified by the
linker -h option). This is typically the shared object name, including the version
number (e.g. libc.so.1). The mkifs command puts the file into the image
filesystem under the name with the version number and makes the name without the
version number into a symbolic link to the file. For example, specifying:
libc.so
in the buildfile makes libc.so.1 the name of the file and libc.so a symlink to it.
Specifying:
libc.so.1
in the buildfile gives the same results. You end up with the name with and without the
version number in the image filesystem no matter which one you specify in the
buildfile.
If the name that would be used as the symbolic link is already specified somewhere
else in the buildfile, the symbolic link isn’t created. For example:
libc.so.1
libc.so.2
[type=link] libc.so=libc.so.2
[+big_pages pagesizes=4k,64k]
libc.so
[-big_pages]a_binary_that_doesnt_want_bigpages
[phys_align=1m]explicit_override_for_this_file
Set the byte order for the image filesystem to either big (via +bigendian) or little
(via -bigendian) endian. This option doesn’t normally need to be specified when
building a bootable image, since the bootfile provides the required byte order. If you
aren’t building a bootable filesystem, or the bootfile doesn’t say which byte order to
use, mkifs uses the host system’s byte order in building the image filesystem.
cd attribute
cd=path
Set the current working directory to the specified pathname before attempting to open
the host file. Default is the directory from which mkifs was invoked.
chain attribute
chain=addr
Set the address at which the operating system will find the next image filesystem.
Default is none.
code attribute
code=uip_spec
Set whether the code segment of an executable is used directly from the image
filesystem (uip or u) or copied (copy or c) when invoked. The default is to use the
code segment in place (uip). For more information, see “Notes on XIP versus copy,”
below.
• 1 — ZLIB
• 2 — LZO
data attribute
data=uip_spec
Set whether the data segment of an executable is used directly from the image
filesystem (uip or u) or copied (copy or c) when invoked. The default is to use the
data segment in place (uip). For more information, see “Notes on XIP versus copy,”
below.
dperms attribute
dperms=perm_spec
Set the access permissions of the directory. See the perms attribute for more
information.
filter attribute
filter=filter_spec
Run the host file through the filter program specified, presenting the host file data as
standard input to the program, and use the standard output from the program as the
data to be placed into the image filesystem. Default is no filter.
To illustrate the use of a filter, consider storing a compressed file in the image
filesystem, where the file exists in its uncompressed form on the host filesystem:
This runs compress from a shell, passing it the contents of data as standard input.
The compress command runs and generates the compressed version of its standard
input on its standard output. The standard output is then placed into the image
filesystem as the data.Z file.
You can specify a filter_spec of none. This is useful if you need to override a global
filter specification.
If you specify +followlink or omit it, mkifs follows any links and makes
target_path a copy of host_path.
If you specify -followlink, mkifs creates a link called target_path that points to
whatever host_path points at. It’s up to you to make sure that the file pointed to is
placed in the image.
gid attribute
gid=id_spec
Set the group ID number for the file. The value of this attribute may be either a
number or an asterisk (*). If it’s an asterisk, the group ID is taken from the host file;
for an inline file, the group ID is the group of the user running mkifs. The default
value for this attribute is *.
image attribute
image=addr_space_spec
Set the base and size limits for the image filesystem. The format for this attribute
consists of an optional starting address, followed by zero or more parameters for
sizing the address space. You can use a case-insensitive suffix of k, m, or g on the
addresses and sizes.
The starting address is the base address of the image, and matters only when building
a bootable image. Its default depends on the bootfile selected. For example, on an x86
using the bios.boot file, the image address begins at 4 MB.
=totalsize An equals sign followed by a number represents the total size that the
output image is padded out to. The default is no padding.
You have to specify both image and ram file attributes if you want to create the image
in ROM/FLASH; otherwise the process manager assumes that the image is in RAM.
For more information, see “Notes on XIP versus copy,” below.
If true, and mkifs has to run a linker to position the executable within the image
filesystem, the output file from the link is the basename of the host path with .sym
appended. For example, if the host name is ../foo/bar, the output name is
bar.sym. If false, a generated temporary name is used for the output file and it’s
deleted after mkifs has run. The default is false.
linker attribute
linker=[linker_id_spec]linker_spec
1 An opening parenthesis, (.
3 A list of comma-separated numbers, giving the list of acceptable ELF file types
(ET_* constants, from <sys/elf.h>). Terminate this list with a semicolon.
5 A closing parenthesis, ).
If the ID specification is present, the linker specification is used only if the machine
number of the ELF input file matches one of the given numbers, and the ELF file type
of input file matches one of the given numbers and at least one of the program
segment types in the input file matches one of the given numbers:
• If the machine number list is empty, any machine number type in the input file is
acceptable.
• If the program segment number list is empty, any program segment number types
in the input file are acceptable.
• If the ELF file type number list is empty, ET_REL is assumed.
module attribute
module=module_name
Use this attribute to add optional modules to procnto.
For example, in order to use the adaptive partitioning scheduler, you must rebuild your
OS images with the option [module=aps] added to the PATH= statement of your
buildfile:
[module=aps] PATH=/proc/boot ./procnto -vv
You can now create partitions and launch applications within a particular partition for
the adaptive partitioning scheduler.
For information on creating a partition, see “Creating partitions” in the Setting Up and
Using the Adaptive Partitioning Scheduler chapter of the Adaptive Partitioning User’s
Guide.
For information on launching applications within a particular partition, see “Launch
processes in partitions” in the Setting Up and Using the Adaptive Partitioning
Scheduler chapter of the Adaptive Partitioning User’s Guide.
pagesizes attribute
pagesizes=size[,size]...
This attribute defines the page sizes that the underlying hardware supports, for use
with the big_pages attribute. The sizes can be in any order, and can include a
case-insensitive suffix of k, m, or g.
You can specify these attributes in the buildfile or in the bootfile.
perms attribute
perms=perm_spec
Set the access permissions of the file. The perm_spec can be one of the following:
• a number (just as with the chmod command)
• an asterisk (*) to use the host file’s permissions (or 0666 for inline files)
• a symbolic mode string to delete, add, or set permissions. This string is a subset of
chmod’s and consists of:
1 a combination of u, g, o, and a
2 one of -, =, or +
3 a combination of r, w, x, s, g, and t.
You can include more than one symbolic mode string, separating them with a
comma (,).
The default is *.
When running on a Windows host, mkifs can’t get the execute (x), setuid (“set user
ID”), or setgid (“set group ID”) permissions from the file. Use the perms attribute to
specify these permissions explicitly. You might also have to use the uid and gid
attributes to set the ownership correctly. To determine whether or not a utility needs to
have the setuid or setgid permission set, see its entry in the Utilities Reference.
ELF executables and shared objects are automatically marked as executable (unless
you specify [+raw]).
phys_align attribute
phys_align=size[,group]
The phys_align attribute lets you align IFS objects on specific physical address
boundaries to take advantage of large pages. The size is an integer, optionally
followed by k, m, or g in lower- or uppercase. This attribute overrides the
+|-big_pages attribute.
For example, to align a file on a 64 KB boundary, potentially allowing the use of 64
KB pages to map 64 KB chunks of the file, specify:
[phys_align=64k] some_executable
You can use the optional group option to group shared objects together based on an
alignment size. For example:
[phys_align=16M,group]
first.so
second.so
third.so
[phys_align=0] # ends alignment
In this example, first.so is aligned to 16 MB, and each successive shared object
either completely fits within that same 16 MB page, or is bumped to the next 16 MB
boundary.
physical attribute
physical=[cpu_name,]boot_filename [filter_args]
This attribute indicates that a bootable filesystem is being built. You can specify it
only once in a buildfile. The image will be run in physical memory mode.
prefix attribute
prefix=prefix_spec
Set the prefix for the target file names. Default is proc/boot when building a
bootable image, and the empty string when not.
ram attribute
ram=addr_space_spec
Set base and size limits for the read-write memory required by executables in the
image filesystem. This attribute consists of an optional starting address, followed by
zero or more parameters for sizing the address space. You can use a case-insensitive
suffix of k, m, or g on the addresses and sizes.
You have to specify both image and ram file attributes if you want to create the image
in ROM/FLASH; otherwise the process manager assumes that the image is in RAM.
For more information, see “Notes on XIP versus copy,” below.
You need to specify this attribute if the actual image is going to be stored on a
read-only device such as ROM or flash memory. Use the image attribute to specify
the location.
The starting address specifies the base address of the RAM, and matters only when
building a bootable image. The default depends on the bootfile you select.
=totalsize An equals sign followed by a number represents the total size that the
RAM usage is padded out to. The default is no padding.
For information about how everything interacts, see “Notes on XIP versus copy,”
below.
If the raw attribute is false (the default), mkifs strips debugging information from
executable files.
If you specify +raw for a file, the file is treated as a data file, even if it would normally
be treated as an executable and relocated.
Don’t specify the +raw attribute for shared objects; it prevents them from being
shared.
If you use the default attribute (-raw) and you specify that the data segment is to be
used in place, the file’s sticky bit will not be set. This identifies the executable to the
QNX process manager, which will prevent the program from running more than once,
avoiding the possibility of running a program with corrupted static data.
Here’s a fragment from a buildfile that demonstrates the use and scope of the raw
attribute:
...
If you use Windows tools to build your image, files specified as +raw won’t have
executable permission when the image is booted. This is because the win32 filesystem
can’t set a file’s executable bit. To make such files executable, specify perms=+x
when using +raw in the buildfile.
If true, the host file is opened and processed as a script file after the process manager
has initialized itself. Each line is parsed as a command line to be run. If multiple files
are marked with +script, they’re merged sequentially into a single file in the image
filesystem; the file’s name is the first script filename in the buildfile. The filenames for
the subsequent script files are ignored, but they must be unique. See “Script Files,”
below for more details on the command-line syntax.
search attribute
search=filename:filename:...
This attribute specifies that mkifs is to search for the file in the named locations on
the host system. The search directory portion of the host file name isn’t included in the
name that’s stored in the image filesystem. The default is the contents of the
MKIFS_PATH environment variable.
Colon separators and forward slashes in the paths are the standard Unix conventions,
but for Windows searches, you must use the standard Windows conventions, such as
semicolon separators and backslashes in the paths.
type attribute
type=file_type
Set the type of the files being created in the image filesystem. Allowable types are:
• dir — a directory
Specifying [type=dir] tells mkifs to create a directory on the target system; you
don’t need to specify the type when you’re copying the contents of a directory. For
example, to copy /usr/nto/x86/bin to /usr/bin, you a just need to specify:
/usr/bin=/usr/nto/x86/bin
uid attribute
uid=id_spec
Set the user ID number for the file. The value of this attribute may be either a number
or an asterisk (*). If it’s an asterisk, the user ID is taken from the host file; for an inline
file, the user ID is the user running mkifs. The default value for this attribute is *.
virtual attribute
virtual=[cpu_name,]bootfile_name [filter_args]
This attribute specifies that a virtual address system is being built.
If there’s a comma (,) or slash (/) in the value, the string in front of it is taken to be
the CPU type of the target system. If you don’t specify a CPU type, mkifs uses the
host system’s CPU type. The PROCESSOR environment variable is set to that string
(which affects the MKIFS_PATH search path for host files).
The characters after the comma or slash (or the equal sign for the attribute if there’s no
comma or slash) up to the first blank character are taken to be the name of the bootfile.
The suffix .boot is appended to the given name and MKIFS_PATH is searched for
the file. The default bootfiles are in ${QNX_TARGET}/${PROCESSOR}/boot/sys.
The bootfiles vary from one processor to another, but these are the main ones:
binary.boot Create a simple binary image (without the jump instruction that
raw.boot adds). If you build a binary image, and you want to
load it with U-Boot (or some other bootloader), you have to
execute mkifs -vvvv buildfile imagefile, so that you
can see what the actual entry address is, and then pass that entry
address to the bootloader when you start the image. If you
modify the startup code, the entry address may change, so you
have to obtain it every time. With a raw image, you can just
have the bootloader jump to the same address that you
downloaded the image to.
bios16m.boot Don’t check memory above 16 MB. Use this bootfile with older
BIOSs that have trouble with such memory.
nobios.boot Create an image that’s suitable for machines that don’t have a
BIOS.
prepboot.boot Create an image that boots from disk off a PREP machine.
For more details on the contents of the file, see “Bootfile,” below.
Any characters in the attribute value following a blank are used as arguments to any
image filter command specified by the bootfile, like this:
If the value of the virtual attribute includes a space, put quotation marks around the
string. Otherwise, mkifs will try to interpret the value as an additional buildfile
attribute placed in the same set of square brackets.
The contents of the host file that this attribute applies to are parsed to discover the
bootstrap executables used to bring up the system. Each line identifies one bootstrap
executable:
• The first executable must be the QNX Neutrino startup executable (startup-*)
that’s appropriate for the target system. For more information, see startup-*.
Script files
As mentioned above, by specifying the [+script] attribute, you’re telling mkifs
that the specified file is a script file, a sequence of commands to be executed when the
process manager has completed its startup.
In order to run a command, its executable must be available when the script is
executed. You can add the executable to the image, or get it from a filesystem that’s
started before the executable is required. The latter approach results in a smaller
image.
The bootfile typically sets the _CS_PATH configuration string, and might set
_CS_LIBPATH. You can set environment variables, such as PATH and
LD_LIBRARY_PATH, in a script file.
Script files, for the most part, look just like regular shell scripts, except that:
• there are special modifiers that you can place before the actual commands to run
• mkifs preparses the script file contents before placing them into the image.
The script file consists of one or more lines, with each line having the following
syntax:
Startup scripts support foreground and background processes. Just as in the shell,
specify an ampersand (&) on the command line to make the program run in the
background. If you run a program in the foreground, and it doesn’t exit, then the rest
of the script is never executed, and the system might not become fully operational.
The modifiers are described below. Those marked as “boolean” accept a plus (+) or
minus (-) character to enable or disable the effect; the others accept a parameter.
argv0 modifier
Sets the argv[0] element of the command argument entry. By default, this is the same
as the command name. This option is typically used to simulate invoking a command
via a different name; the classical example is the compress command, which can be
invoked as uncompress:
[argv0=uncompress] compress filename.Z
cpu modifier
Specifies the CPU on which to launch the following process (or, if the attribute is used
alone on a line without a command, sets the default CPU for all following processes).
This modifier is useful for setting up bound multiprocessing (BMP). Specify the CPU
as a zero-based processor number:
[cpu=0] my_program
At boot time, if there isn’t a processor with the given index, a warning message is
displayed, and the command is launched without any runmask restriction.
Due to a limitation in the boot image records, this syntax allows only the specification
of a single CPU and not a more generic runmask. Use the on utility to spawn a process
within a fully specified runmask.
display_msg message
Causes the message immediately following the display_msg command to be
output. This is useful during startup diagnostics; often used as a checkpoint.
procmgr_symlink
Equivalent to ln -P, except that you don’t need to have ln present.
reopen [filename]
Causes standard input, standard output, and standard error to be redirected to the
specified filename. Also causes the interpretation of the script file to suspend
temporarily until a stat() on the specified pathname succeeds. The default
filename is /dev/console.
waitfor pathname [wait_time]
Causes interpretation of the script file to suspend temporarily until a stat() on the
specified pathname succeeds. Often used for synchronization, to allow a
resource manager to perform its startup functionality, and then for the process
manager to proceed with the further interpretation of the script file.
The optional wait_time specifies the maximum number of seconds to wait for
the file to appear. It can include one decimal place to specify tenths of a second.
The default is 5.0 seconds.
The +external modifier instructs mkifs to search for the specified command on the
host filesystem, rather than assume the internal meaning for the command. The default
is -external.
pri modifier
Lets you specify the command’s priority and optionally the scheduling policy. The
pri modifier accepts a numeric priority, optionally followed by one of the letters:
See the System Architecture guide for a description of the various priority levels and
scheduling algorithms.
For example, to start up the console driver, devc-con at priority 20, with FIFO
scheduling, specify:
The default priority and policy are specified by procnto, and could change in future
versions of QNX Neutrino. If the priority and scheduling policy of the processes are
important to you, be sure to use the pri= modifier.
If +session is specified, make the process a session leader (as per POSIX), and make
the process’s stdin the controlling terminal (i.e. direct Ctrl-C at this process group). If
-session is specified, don’t make the process a session leader. The default is
-session.
This parameter is typically used for the shell:
[+session] esh
Bootfile
When building a bootable filesystem, you must specify a bootfile via the physical or
virtual attribute. Note that the bootfile must be the first file specification within the
buildfile. If the first character of the bootfile is a left square bracket ([), a list of
configuration attributes is given in the same syntax as the buildfile. The list of
attributes is terminated by a right square bracket (]). The allowed attributes, and their
formats, are:
attr=image_attribute
Specify an attribute to add to the image. These attributes are
processed after the -l (“el”) command-line options and the
buildfile, but you normally use the ? prefix on the
image_attribute, so that it doesn’t override anything explicitly
set by the -l option or the buildfile.
default_image=addr_space_spec
Set the defaults for the image file attribute (see above).
default_ram=addr_space_spec
Set the defaults for the ram file attribute (see above).
filter=image_filter_spec
After the image has been created, run image_filter_spec. The
following formatting codes are expanded:
paddr_bias=number
On some CPUs (such as MIPS), the hardware reserves a range
of virtual addresses that map one-to-one with physical address.
This attribute lets mkifs know how to translate a virtual address
to its physical location in memory via the formula:
pagesize=size Set the size of a page in the image filesystem. The mkifs utility
aligns various structures to a multiple of this. The default is 4
KB.
pagesizes=size[,size]...
Define the page sizes for use with the big_pages attribute. You
can specify these attributes in the buildfile or in the bootfile. For
more information, see the pagesizes buildfile attribute.
Following the closing square bracket character (]) of the bootfile attributes, mkifs
searches for the string boot. If it’s found, mkifs considers all data immediately
following, through to the end of the file, to be boot prefix code. This data is placed at
the start of the image file. If the len attribute was specified and is larger than the size
of the boot prefix code, the image file is padded out to the size given.
Image filter
You can specify an image filter within the specification for the bootfile, and optionally
specify macro expansions to it. These macro expansions are documented above, in the
filter description.
The following image filters are currently available:
mkifsf_openbios
Patch the header at the beginning of the image for IBM’s
OpenBIOS.
mkifsf_srec Convert the image into S-Record format. This filter accepts the
following options:
• -b — generate only 4-byte address records.
• -c — omit the carriage-return character at the ends of lines.
• -l — omit the linefeed character at the ends of lines.
Generally, image filters are expected to take the file specified by the %i variable and
modify it in place. If this isn’t possible (e.g. the file changes size as a result of the
filter program), specifying %I causes mkifs to store the original file in a temporary
filename (named by %I), and expect the modified file in the filename given by %i. This
happens only when the %I macro expansion is specified.
Linker specification
The linker specification lets you control how the linker command line is built when
mkifs needs to turn a relocatable object into an executable running at a particular
address. It operates much like a printf() format string, with characters being copied
from the format to the command line until a percent character (%) is found. The
following formatting codes after a percent character are supported:
%t The address to place the text segment at, in hexadecimal. This is %h plus the
amount of space for the executable header structures.
%d The address to place the data segment at, in hexadecimal. This value may be
zero, in which case the data is placed immediately following the text segment.
%o The name of the output executable file, as a string.
Variable: Value:
e 0 == little endian 1 == big endian
d Data segment address
f 0 == startup file 1 == bootstrap file 2 == normal file
h Executable header address
m Machine number from the ELF header
v 0 == file linked physically 1 == file linked virtually
V 0 == physical system 1 == virtual system
Startup trailer
Image header
Image directory
File 1
File 2
...
File n
Image trailer
• The boot prefix is generated based on the bootfile that you specified with the
virtual= or physical= attribute.
• The boot prefix, startup header, startup, and startup trailer are present only in a
bootable image.
Boot prefix
The first section (called the boot prefix) is controlled by the bootfile that you specified
in the virtual= or physical= attribute. For many systems this section doesn’t
occupy any space in the image. When it’s present, it’s typically used to address one of
the following issues:
• The IPL code that transfers control to the image doesn’t set up the processor state
in a way that’s compatible with startup. In this case, this section contains code that
does that work. If you’ve written your own IPL, it ensures the processor is in a
suitable state before jumping to startup, and this section is empty.
A boot on a standard x86 PC is a good example of the need for placing code here.
When a PC boots, it transfers control while in 16-bit real mode. The startup
program assumes the processor is running in 32-bit protected mode. So, an image
with a PC BIOS boot contains code here that switches the processor into 32-bit
protected mode. It also does a series of BIOS calls to gather information from the
BIOS, since the protected mode startup program is unable to make any BIOS calls
itself.
Startup header
This section contains information about the image, which is used by our IPL and
startup programs.
Part of this section is written to by mkifs. Another part is set to zero, and is written to
by the IPL code to pass data (determined at runtime) to startup. The data is in the form
of a set of structures (for more information, see Customizing IPL Programs in
Building Embedded Systems).
If an image isn’t bootable, this section is omitted.
Startup
This section contains the code and data for the startup program. This code must be
executed in RAM. If the image is in ROM/FLASH, our standard IPL code uses
information in the startup header to always copy the startup into RAM and transfer
control to it there.
If an image isn’t bootable, this section is omitted.
Startup trailer
A checksum for use by startup. If an image isn’t bootable, this section is omitted.
Image header
Image directory
Files
The files within the image filesystem. Executables that are executed in place are
aligned on page boundaries. An attempt is made to fill any holes created by this
alignment with small data files that have no alignment needs.
Image trailer
Shared objects currently assume code=uip and data=copy. To get the effect of
code=copy, manually copy the shared object to /dev/shmem and set
LD_LIBRARY_PATH as appropriate. To save ROM/Flash space, compress the
shared object in the image filesystem and decompress it into /dev/shmem.
When an executable is run, these attributes determine whether the code or data for that
executable is to be used in place or copied to RAM. An image filesystem may exist in
either RAM or linearly addressable ROM/FLASH. Images in RAM are usually loaded
from a device that isn’t linearly addressable. This includes disk boots, network boots,
and boots from bank-switched ROM/FLASH devices. It also includes any image that’s
been compressed.
For example, a compressed image may reside in linearly addressable flash, but it can’t
be used until it’s decompressed into RAM. The following combinations exist for any
image in RAM:
The default assumes that you want to run both code and data in place. This would be
fine for an executable that has a large amount of static data and that you need to run
only once (e.g. a resource manager or driver that starts when the system boots).
Running data in place modifies the only copy of the data as the program runs, so you
can’t start the program again.
In this case, the file’s sticky bit won’t be set. This identifies the executable to the QNX
Neutrino process manager, which will prevent the program from running more than
once, thus avoiding the possibility of running a program with corrupted static data.
That’s why you have to specify data=copy if you want to run the executable multiple
times.
The two cases listed as “wasteful” fall out of the combinations but they provide no
additional capabilities and waste memory by copying the code unnecessarily. Since
the code is read-only and can’t be modified, it can always be used in place.
If you’re creating an image in ROM/FLASH, the following combinations exist:
You have to specify both image and ram file attributes if you want to create the image
in ROM/FLASH; otherwise the process manager assumes that the image is in RAM.
The data=copy attribute is assumed for an image in ROM/Flash.
The cases where code is copied may seem wasteful (as in the RAM image example)
but it may make sense for systems where the ROM/FLASH is slow — perhaps it has
an 8-bit interface or requires extra wait states for access to it. In that case, you may
wish to copy it to RAM, so that it executes faster.
Examples:
Here’s a very simple buildfile that specifies the operating system, a console driver, and
a shell:
[virtual=x86,bios] .bootstrap = {
startup-bios
PATH=/proc/boot procnto
}
[+script] .script = {
devc-con -n9 &
reopen /dev/con1
[+session] esh &
}
libc.so
[data=copy]
devc-con
esh
[type=link] /usr/lib/ldqnx.so.2=/proc/boot/libc.so
The runtime linker is expected to be found in a file called ldqnx.so.2, but the
runtime linker is currently contained within the libc.so file, so we make a
process-manager symbolic link to it.
For MIPS targets, you need to name this link ldqnx.so.3 instead of ldqnx.so.2.
You can now build an image from the above, like this (assuming that the buildfile is
called simple.bld, and that we want the resultant image to be called simple.ifs):
mkifs simple.bld simple.ifs
[data=copy]
devc-con
esh
ls
devb-eide
[type=link] /usr/lib/ldqnx.so.2=/proc/boot/libc.so.3
The following example includes an inline /etc/hosts file that’s used to resolve
addresses used at boot time by programs such as fs-nfs3; it also shows how you can
pass environment variables to different commands:
In a real buildfile, you can’t use a backslash (\) to break a long line into shorter pieces,
but we’ve done that here, just to make the buildfile easier to read.
[image=0x1f0000]
[virtual=ppcbe,raw] .bootstrap = {
startup-mtx604-smp -v -Nmtx604-5 -D0x800003f8ˆ0.9600
PATH=/proc/boot:/bin:/usr/bin:/sbin:/usr/sbin \
LD_LIBRARY_PATH=/proc/boot:/lib:/usr/lib:/lib/dll \
procnto-600-smp -v
}
[+script] startup-script = {
# To save memory, make everyone use the libc in the boot
# image! For speed (fewer symbolic lookups), we point to
pci-raven &
waitfor /dev/pci
slogger &
waitfor /dev/slog
devc-ser8250 -e -c1846200 -b 9600 0x800003f8,104 0x800002f8,103 &
waitfor /dev/ser1
pipe &
waitfor /dev/pipe
devc-pty &
waitfor /dev/ptyp0
mqueue &
inetd &
tinit
}
libc.so.2
libc.so
devn-tulip.so
libsocket.so
[data=uip]
pci-raven
io-pkt-v4
[data=copy]
if_up
ifconfig
fs-nfs3
Environment variables:
PROCESSOR Specifies the target CPU. If not set, the default is the same as the
CPU of the host system (e.g. x86).
Exit status:
0 Successful completion.
1 An error occurred.
See also:
dumpifs, gcc
Making an OS Image chapter and the Sample Buildfiles appendix of Building
Embedded Systems
Making Multiple Images technote
Syntax:
mkimage [ -b blocksize ] -o outputfile file...
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
-b blocksize The blocksize used when padding files. The default is 64K.
Description:
The mkimage utility builds a socket image from individual files. The command line is
parsed, and the bootable image file(s) are placed first in the resultant output file,
followed by embedded filesystem files, then any other files on the command line.
All files are padded up to the block size specified on the command line ( padding is
done with 0xFF, the default erased state of flash). If no blocksize is specified, the
default is 64K.
Syntax:
mkkbd [-f file] [-h dir] [-i dir] [-v[v]...] source_file
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Targets:
x86
Options:
-f file The name of the output file. The default is the name of the source_file
but with the extension .kbd instead of .kdef.
source_file Make keyboard tables for the keyboard names that match the specified
pattern. Source files have the extension .kdef.
Description:
The mkkbd utility compiles a text file containing keyboard definitions and is capable
of creating a binary keyboard table file from each definition file. The resulting binary
file is used in devi-hid.
You need to use mkkbd only if you create or modify a keyboard definition source file.
The compiled output file is created in the current directory or according to the -f
option. For a sample keyboard definition file, see
/usr/photon/keyboard/sample.kdef.
Examples:
Create a German keyboard table (german.kbd) from the keyboard definition file
called german.kdef:
mkkbd german.kdef
Files:
mkkbd The mkkbd command is normally to be found in
/usr/photon/bin.
Exit status:
0 Success.
See also:
devi-hid, inputtrap
“International keyboards” in the Using the Command Line chapter of the Neutrino
User’s Guide
Syntax:
mkqnx6fs [-Bq] [-b blocksize] [-e endian] [-g groups]
[-i inodes] [-n blocks] [-O options] [-o options]
[-r percent] [-T type] [-u uuid] host
Runs on:
Neutrino
Options:
-B Rewrite only the boot loader; don’t touch anything in the filesystem
(in particular don’t reformat it). You would use this to upgrade to
new boot loader code.
-b blocksize Set the logical blocksize of the filesystem. Valid values are 512,
1024, 2048, or 4096; the default is 1024. Varying the blocksize can
control various types of fragmentation as well as determine the
maximum file size supported.
-e endian Set the endian layout of the on-disk filesystem. Valid values are big
or little; by default the filesystem uses the native endian-ness of
the CPU.
-i inodes Set the maximum number of inodes in the filesystem. Each unique
file or directory requires an inode.
-n blocks Set the number of logical blocks in the filesystem. This is the total
size of the filesystem, from which space is first allocated to the
system bitmap and inodes files (so the number of user-accessible
blocks will be slightly less than the specified value).
By default, mkqnx6fs makes the filesystem fully occupy the
specified host (e.g. it determines the number of blocks from the size
of the disk partition).
CAUTION: This default is incompatible with the 6.4.0 version of the Power-Safe
! filesystem. If you wish to format a filesystem that can be mounted read-write by 6.4.0,
you must specify -o-lfncksum; otherwise it will allow only read-only mounting.
-q Operate quietly; don’t prompt for confirmation and don’t display the
resulting configuration of the new filesystem. Without this option,
mkqnx6fs will confirm that you meant to format if the host is a
block-special device or is currently mounted.
-r percent Set the percentage of the filesystem to reserve to prevent it from
becoming completely full. In general, filesystem performace
degrades when the disk is nearly full; this option just makes ENOSPC
happen prematurely to stop this. The default is 3%.
-T type Set the expected usage type of the filesystem; valid values are
desktop, runtime, and media. This type is used to pick the
appropriate blocksize, number of allocation groups, and number of
inodes. It’s a hint that’s intended to replace explicit -b, -g, -i, and
-r values.
-u uuid Specify a 128-bit UUID for the filesystem, in the UUID “8-4-4-4-12”
format. If you don’t specify a UUID, mkqnx6fs generates a random,
time-based (version 4 UUID) value.
host The host of the new filesystem. You can specify this as a
block-special device or partition (e.g. /dev/hd0t76), as a regular
file, or as the root directory of a mounted fs-qnx6 filesystem (which
will be resolved to the real host device).
Description:
The mkqnx6fs utility creates a fresh fs-qnx6 filesystem on the specified host
(typically a hard disk partition, although you can create an image inside a regular file).
The integer fields of the filesystem are maintained as either all little-endian or all
big-endian, as dictated by the -e option. Thus no CPU architecture pays a
byte-swapping penalty for local disks. The filesystem detects the endian-ness and
swaps if necessary, so you can move a disk across platforms (with a slight penalty in
performance).
a Read-only.
b Not usually necessary.
For more information, see the Filesystems chapter of the System Architecture guide.
Examples:
# mkqnx6fs /dev/hd0t76
All files on /dev/hd0t76 will be lost!
Confirm filesystem re-format (y) or (n): y
Format fs-qnx6: 8040524 blocks, 62816 inodes, 8 groups
Exit status:
0 The filesystem was formatted successfully.
See also:
chkqnx6fs, devb-*, dinit, fs-qnx6.so, mkdosfs
“Power-Safe filesystem” in the Filesystems chapter of the System Architecture guide
“Power-Safe filesystem” in the Filesystems chapter of the Neutrino User’s Guide
Syntax:
mkrec [option | imagefilename] ...
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
-a align[K|M|G] Force the next file to be aligned on an align-byte boundary (the
default is 1 byte).
-l reclen (“el”) Length of data bytes per line (the default is 32).
-s romsize[K|M|G] Size of ROM (the default is 4G). The case of the suffixes doesn’t
matter.
Description:
The mkrec utility converts a binary image into either Motorola S records or Intel hex
records, which are suitable input for most Flash/EPROM programmers. Most ICEs
also expect these formats. The format defaults to Motorola S records but may be
changed using the -f format option. Note that the Intel format is limited to 1M offsets.
By default, mkrec assumes the image contains code that is the initial program loader
(IPL), which is connected to the power-on reset vector of the processor. The mkrec
utility locates the image such that it’s placed in the address space where it will end at
the reset vector. A record is then output for the reset vector, which will do a 16-bit
relative jmp to the start of the image.
The reset vector on an Intel (e.g. 486) processor is located at linear address
0xFFFFFFF0 (16 bytes below 4 Gigabytes). The offsets used for the records by
default address this area. It’s as though you had a 4-Gigabyte ROM and needed to load
code into the top of it. This is what most ICEs expect. If you’re sending your output to
a small Flash/EPROM programmer, it may wish the offsets to be relocated to the top
of the the Flash/EPROM alone. You can do this by using the -s size option.
If the -r option is set, it indicates that the image shouldn’t be considered a power-on
IPL. The record offsets for the image start at zero; a jmp isn’t be programmed at the
top of the device. You can use the -o option to change the record offset. Note that you
can use the -o option only if you use -r.
For compatibility with most devices that accept these records, each record is limited to
a maximum of 32 bytes. You can use the -l option to increase this limit to a maximum
of 255 bytes. Larger records have less overhead and result in slightly faster downloads.
Examples:
The following converts the binary image explr2 into Motorola S records. The offset
used in the records starts the image such that it ends at the reset vector 0xFFFFFFF0.
A 16-bit relative jmp is programmed at 0xFFFFFFF0 to jmp to the start of the image.
mkrec explr2
The following converts the binary image ipl into Intel hex records. The offset used in
the records starts the image such that it ends at the reset vector in the 256K ROM
(0x3FFF0). A 16-bit relative jmp is programmed at 0x3FFF0 to jmp to the start of the
image.
The following converts the binary image notipl into Motorola S records. The offset
used in the records starts at 0; a reset vector jmp isn’t output.
mkrec -r notipl
See also:
mkefs, mkifs
Syntax:
mksbp project_path
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
project_path The full path to the System Builder project that you want to build.
Description:
The mksbp utility builds the specified QNX System Builder project, which you must
have created in the IDE. The purpose of this utility is to build a System Builder project
from the command line or a script, for example as a part of a nightly build.
If you use the first variant of the command (with one argument), you must have
physically created the project in some IDE workspace; if the argument is
some_path\myproject, mksbp interprets some_path as the workspace location, and
myproject as a subdirectory in this workspace where the project is located.
You can optionally create any project that’s just logically linked to a workspace
(through metadata redirection — see the IDE’s project-creation wizard). The
two-argument syntax is applicable in this case: the first argument targets the
workspace location, and the second one holds the project name (just the name, not a
full path; the IDE will find its real location).
This utility uses the QNX_HOST environment variable to find the target runtime
binaries. Ensure that it’s set up (see qconfig or QWinCfg) before running this
program.
Generated output is placed in the project’s Images directory, mimicking the behavior
within the QNX Momentics IDE exactly.
See also:
qconfig, QWinCfg
IDE User’s Guide
Name:
/etc/moduli
Description:
The /etc/moduli file contains the system-wide Diffie-Hellman prime moduli for
sshd. For more information, see /etc/moduli in the NetBSD documentation.
See also:
scp, sftp, sftp-server, ssh, ssh-add, ssh-agent, ssh-keygen,
ssh-keyscan, ssh-keysign, ˜/.ssh/ssh_config, /etc/ssh/ssh_config,
sshd, /etc/ssh/sshd_config in the NetBSD documentation
Syntax:
more [-ceisu] [-n number] [-p pattern]
[-/ pattern] [-t tag] [-x tabstop] [file...]
Runs on:
Neutrino
Options:
-/ pattern Same as -p pattern.
-c For each full screen of text that’s displayed, clear the screen from the
first line and display the next full screen of text.
-e Stop after displaying the last line in the file. If the next command that
displays text causes more to reach end-of-file again, more exits. If the
file is shorter than a single screen, more exits at end-of-file regardless.
-n number Specify the number of lines that constitute a full screen of text. The
number argument is a positive decimal integer. The -n option
overrides any values obtained from the environment.
-p pattern Search for a line that matches pattern. The current position is set to the
first matched line. If no match is found, the first line in the file is the
current position.
-t tag Display the file containing the tag named by the tag argument. Note
that for this to work, the file tags must reside in the current directory.
-x tabstop Set tabs at the positions specified by tabstop. The default is four
spaces, unless the POSIX_STRICT environment variable is defined,
in which case it’s eight spaces.
Description:
The more utility lets you view text files one screenfull at a time. The utility
determines the number of lines that make a full screen by looking in the terminal
database. However, you can use the LINES environment variable to override the value
found in the database, and the -n option to override the LINES variable.
If the standard output isn’t a terminal device, the number of lines that make up a full
screen of text is considered to be infinite. In a pipeline, all input files are copied to the
standard output in their entirety. On terminals, more displays text one screen at a time.
The more command can be very useful when another utility prints more information
to the standard output than can be displayed on a single screen. By piping the output to
more, you can scroll through the displayed output at leisure. For example:
ls | more
pipes the output from the ls command to more, allowing you to scroll through the
output.
The more command is a link to less, which behaves according to the command name
it was invoked as.
Environment variables:
EDITOR The editor to use.
LINES A decimal integer value to be used as the number of lines in a
screenfull.
Exit status:
0 Successful completion.
>0 An error occurred.
Contributing author:
Mark Nudelman
See also:
cat, clear, ctags, head, less, tail
Syntax:
mount [-abwruv] [-t type [-o options] [special] mountpoint]
mount [-abwruv] [-T type [-o options] special [mountpoint]]
mount [-abwruv] -e [-t|T type] [-o options] special
[mountpoint]
mount
Runs on:
Neutrino
Options:
-a Mount all the devices listed in the /etc/fstab file (or autodetected
later on). If you also specify a type, mount only those entries. This
option is ignored if you specify special or mountpoint.
-b Prevent the lookup of the fstab file.
-e Enumerate the children of the special device.
-o options Options specific to the server doing the mounting. These options
include:
• before — Mount the filesystem so that it’s resolved before any
other filesystems mounted at the same pathname (in other words,
it’s placed in front of any existing mount). When you access a file,
the system looks on this filesystem first.
• after — Mount the filesystem so that it’s resolved after any other
filesystems mounted at the same pathname (in other words, it’s
placed behind any existing mount). When you access a file, the
system looks on this filesystem last, and only if the file wasn’t
found on any other filesystems.
For more information, see “Ordering mountpoints” in the Process
Manager chapter of the System Architecture guide.
-r Mount the device as read-only.
-w Mount the device as read/write. This is the default (if the physical
media permit).
Description:
Without options, mount displays the current mountpoints. With options set, this utility
mounts the block special device or remote filesystem, special, as the specified
mountpoint. To mount a real special device, use the -t option; to specify a
special-device string (which isn’t necessarily a real device), use -T.
Some servers may not support all the mount options, especially with respect to
remounting and enumerating.
Examples:
Mount a QNX 4 filesystem on a hard drive as /mnt/fs:
Mount a device driver for io-pkt*. In this example, devn-ne2000.so is the name
of the shared object that io-pkt* needs to load for the driver, not the name of a real
device:
If you want to pass options to the driver, use the -o option before the name of the
shared object:
mount -e /dev/hd0
This will re-read the disk partition table for /dev/hd0, and create, update or delete
/dev/hd0tXX block-special files for each partition. This is used in the following two
scenarios:
• when the disk driver is used without any automatic enumeration (blk
auto=none), or
• when the partition table has been modified (for example, with fdisk).
Where your name is abc, your password is efg, your CIFS server is node123 with an
IP address of 1.1.1.1, the share you want to mount is /C, and the mountpoint you
want to use is /ctest.
Mount an NFS 2 client filesystem (fs-nfs2 must be running first):
mount
Mount the shared object that supports Enhanced Host Controller Interface (EHCI)
USB controllers:
mount -ur /
mount -uw /
See also:
devb-*, fdisk, fs-cd.so, fs-cifs, fs-dos.so, fs-etfs-ram, fs-ext2.so,
fs-mac.so, fs-nfs2, fs-nfs3, fs-nt.so, fs-qnx4.so, fs-qnx6.so,
fs-udf.so, /etc/fstab, io-audio, io-blk.so, io-pkt*, io-usb, umount
mount(), mount_parse_generic_args() in the QNX Neutrino Library Reference
Filesystems chapter of the System Architecture guide
Working with Filesystems chapter, and “Filesystems and block I/O (devb-*) drivers”
in the Fine-Tuning Your System chapter of the QNX Neutrino User’s Guide
Syntax:
mq [options] &
Runs on:
Neutrino
Options:
-m num_msgs Set the default for the maximum number of messages, for use if the
mq_attr argument to mq_open() is NULL. The default is 64
messages.
-N path Set the pathname of the directory for message queues. The default
is /dev/mq.
-s size Set the default message size, for use if the mq_attr argument to
mq_open() is NULL. The default is 256 bytes.
Description:
The mq manager implements POSIX 1003.1b message queues. When you create a
queue, it appears in the pathname space under /dev/mq.
The /dev/mq directory doesn’t appear until you actually create a queue.
You can change this directory to union over the directory exported by the mqueue
server by using the mq -N/dev/mqueue option, but we don’t recommend this,
because it may cause some user-namespace confusion.
This implementation uses the kernel’s asynchronous messaging facility to buffer the
messages within the kernel itself, and eliminates the context-switching overheads of
using an external server (i.e. mqueue) in each message-queue operation, thus greatly
improving the performance of POSIX message queues.
In order to use the mq implementation, you must link your application(s) against the
libmq library. In a manual build, specify the -l mq option; in automatic/recursive
builds, use this setting in your common.mk file:
LIBS += mq
For more information, see the Managing POSIX Message Queues technote.
See also:
mqueue, procnto*
mq_close(), mq_getattr(), mq_notify(), mq_open(), mq_receive(), mq_send(),
mq_setattr(), mq_unlink() in the Neutrino Library Reference
Controlling How Neutrino Starts in the Neutrino User’s Guide
Managing POSIX Message Queues technote
Syntax:
mqueue &
Runs on:
Neutrino
Options:
There are no options for the mqueue manager.
Description:
The mqueue manager implements POSIX 1003.1b message queues. When you create
a queue, it appears in the pathname space under /dev/mqueue.
The /dev/mqueue directory doesn’t appear until you actually create a queue.
The traditional POSIX message queue manager is a resource manager that uses
messages to communicate with its clients. You can access it locally or remotely,
allowing for network-wide message queues. On a self-hosted Neutrino system, the
default sysinit script starts mqueue; for more information, see the Controlling How
Neutrino Starts chapter of the Neutrino User’s Guide.
Starting with release 6.3.0, procnto manages named semaphores, which mqueue
used to do (mqueue still manages named semaphores if it detects that procnto isn’t
doing so).
For more information, see the Managing POSIX Message Queues technote.
See also:
mq, procnto*
mq_close(), mq_getattr(), mq_notify(), mq_open(), mq_receive(), mq_send(),
mq_setattr(), mq_unlink() in the Neutrino Library Reference
Controlling How Neutrino Starts in the Neutrino User’s Guide
Managing POSIX Message Queues technote
Syntax:
mrouted [-c config_file] [-d [debug_level]] [-p]
Runs on:
Neutrino
Options:
-c config_file] Specify a configuration file (default is /etc/mrouted.conf).
Description:
The mrouted utility is an implementation of the Distance-Vector Multicast Routing
Protocol (DVMRP) (RFC 1075 specifies an earlier version of this protocol). The
utility maintains topological knowledge via a distance-vector routing protocol (like
RIP, described in RFC 1058), where it implements a multicast datagram forwarding
algorithm called Reverse Path Multicasting.
The mrouted utility forwards a multicast datagram along a shortest (reverse) path tree
rooted at the subnet on which the datagram originates. The multicast delivery tree may
be thought of as a broadcast delivery tree that has been pruned back so that it doesn’t
extend beyond those subnetworks that have members of the destination group. Hence,
datagrams aren’t forwarded along those branches which have no listeners of the
multicast group. The IP time-to-live of a multicast datagram can be used to limit the
range of multicast datagrams.
In order to support multicasting among subnets that are separated by (unicast) routers
that don’t support IP multicasting, mrouted includes support for “tunnels”, which are
virtual point-to-point links between pairs of mrouteds located anywhere in an
internet. IP multicast packets are encapsulated for transmission through tunnels, so
that they look like normal unicast datagrams to intervening routers and subnets. The
encapsulation is added on entry to a tunnel, and stripped off on exit from a tunnel. By
default, the packets are encapsulated using the IP-in-IP protocol (IP protocol number
4). Older versions of mrouted tunnel using IP source routing, which puts a heavy
load on some types of routers.
The tunneling mechanism allows mrouted to establish a virtual internet, for the
purpose of multicasting only, which is independent of the physical internet, and which
may span multiple Autonomous Systems. This capability is intended for experimental
support of internet multicasting only, pending widespread support for multicast
routing by the regular (unicast) routers. The mrouted utility suffers from the
well-known scaling problems of any distance-vector routing protocol, and doesn’t
(yet) support hierarchical multicast routing.
The mrouted utility handles multicast routing only; there may or may not be unicast
routing software running on the same machine as mrouted. With the use of tunnels, it
isn’t necessary for mrouted to have access to more than one physical subnet in order
to perform multicast forwarding.
Invocation
If -d isn’t specified, or if the debug level is specified as 0, mrouted detaches from the
invoking terminal. Otherwise, it remains attached to the invoking terminal and
responsive to signals from that terminal. If -d is specified with no argument, the
debug level defaults to 2. Regardless of the debug level, mrouted always writes
warning and error messages to the system log daemon. Nonzero debug levels have the
following effects:
Level 1 All messages that are sent to the system log are also printed to stderr. In
order to capture the log messages, you need to have syslogd running.
Level 2 All level 1 messages plus notifications of significant events are printed to
stderr.
Level 3 All level 2 messages plus notifications of all packet arrivals and
departures are printed to stderr.
Configuring mrouted
The mrouted utility automatically configures itself to forward on all
multicast-capable interfaces, that is, interfaces that have the IFF_MULTICAST flag set
(excluding the loopback “interface”), and it finds other mrouteds directly reachable
via those interfaces. To override the default configuration, or to add tunnel links to
other mrouteds, configuration commands may be placed in /etc/mrouted.conf
(or an alternative file, specified by the -c option). There are five types of configuration
commands:
The boundary and altnet options may be specified as many times as necessary.
The mrouted utility won’t initiate execution if it has fewer than two enabled virtual
interfaces (vif s), where a vif is either a physical multicast-capable interface or a
tunnel. It’ll log a warning if all of its vif s are tunnels; such an mrouted
configuration would be better replaced by more direct tunnels (i.e. eliminate the
middle man).
Signals
The mrouted utility responds to the following signals:
SIGHUP Restarts mrouted. The configuration file is reread every time this
signal is evoked.
SIGQUIT Dumps the internal routing tables to stderr (only if mrouted was
invoked with a nonzero debug level).
Examples:
This is an example configuration for a mythical multicast router at a big school.
# mrouted.conf example
#
Routing tables
The routing tables look like this:
In the above example, there are four Vif s connecting to two subnets and two tunnels.
The vif 3 tunnel isn’t in use (no peer address). The vif 0 and vif 1 subnets have some
groups present; tunnels never have any groups. This instance of mrouted is the one
responsible for sending periodic group membership queries on the vif 0 and vif 1
subnets, as indicated by the “querier” flags. The list of boundaries indicate the scoped
addresses on that interface. A count of the number of incoming and outgoing packets
is also shown at each interface.
Associated with each subnet from which a multicast datagram can originate is the
address of the previous hop router (unless the subnet is directly-connected), the metric
of the path back to the origin, the amount of time since we last received an update for
this subnet, the incoming vif for multicasts from that origin, and a list of outgoing vif s.
A * means that the outgoing vif is connected to a leaf of the broadcast tree rooted at
the origin, and a multicast datagram from that origin is forwarded on that outgoing vif
only if there are members of the destination group on that leaf.
The mrouted utility also maintains a copy of the kernel forwarding cache table.
Entries are created and deleted by mrouted.
The cache tables look like this:
Multicast Routing Cache Table (147 entries)
Origin Mcast-group CTmr Age Ptmr IVif Forwvifs
13.2.116/22 224.2.127.255 3m 2m - 0 1
>13.2.116.19
>13.2.116.196
138.96.48/21 224.2.127.255 5m 2m - 0 1
>138.96.48.108
128.9.160/20 224.2.127.255 3m 2m - 0 1
>128.9.160.45
198.106.194/24 224.2.135.190 9m 28s 9m 0P
>198.106.194.22
Each entry is characterized by the origin subnet number and mask and the destination
multicast group.
> A “>” as the first character on an additional line is printed for each
source on the subnet. There can be many sources in one subnet.
Age The time since this cache entry was originally created. Since cache
entries get refreshed if traffic is flowing, routing entries can grow very
old.
CTmr Indicates the lifetime of the entry. The entry is deleted from the cache
table when the timer decrements to zero.
Ivif Indicates the incoming vif for multicast packets from that origin. Each
router also keeps a record of the number of prunes received from
neighboring routers for a particular source and group. If there are no
members of a multicast group on any downward link of the multicast
tree for a subnet, a prune message is sent to the upstream router. They’re
indicated by a P after the vif number.
Ptmr The amount of time until the upstream prune times out, or simply a dash
if no prune was sent.
Files:
/etc/mrouted.conf
Default configuration file for mrouted.
/var/run/mrouted.pid
At startup, mrouted writes its pid to this file.
/var/tmp/mrouted.dump
The SIGUSR1 signal causes mrouted to dump the internal routing tables to this
file.
/var/tmp/mrouted.cache
The SIGUSR2 signal causes mrouted to dump the internal cache tables to this
file.
Contributing author:
Steve Deering, Ajit Thyagarajan, Bill Fenner.
License:
The mrouted program is COPYRIGHT 1989 by The Board of Trustees of Leland
Stanford Junior University; for licensing information, see the Third Party License
Terms List at http://licensing.qnx.com/third-party-terms/.
See also:
syslogd
Based on RFC 1075, which specifies an earlier version of DVMRP.
DVMRP is described, along with other multicast routing algorithms, in the paper
Multicast Routing in Internet-works and Extended LANs by S. Deering, in the
Proceedings of the ACM SIGCOMM ’88 Conference.
Syntax:
mstrip filename
Runs on:
Neutrino
Options:
filename Name of file to be stripped.
Description:
The mstrip utility is used to strip an RFC to obtain a Management Information Base
(MIB) module. It uses form-feed characters to determine the header and the footer
lines in a document.
Examples:
mstrip RFC1213 > rfc1213.mib
See also:
smic, snmpbulkwalk, snmpd, snmpget, snmpnetstat, snmpset, snmpstatus,
snmptest, snmptranslate, snmptrap, snmptrapd, snmpwalk
/etc/mib.txt file
Syntax:
mv [-f|-i] [-v|-V] source_file target_file
Runs on:
QNX Neutrino, Microsoft Windows
Options:
-f Force an overwrite; don’t prompt for confirmation if the destination
path exists. Overwrite even read-only files.
target_dir The pathname of an existing directory that the source file is to move to.
Description:
The mv command has two syntax forms:
mv dir/dir/myfile /existingdir
moves dir/dir/myfile to existingdir/myfile.
This second syntax form is assumed when either the destination names an
existing directory, or when more than one source file is specified.
The mv utility asks you for confirmation if the following conditions are met:
Upon receiving confirmation, mv overwrites the target file. It can do this only if you
own the file or you’re a superuser.
If you want mv to request confirmation before overwriting any file, specify the -i
(interactive) option. If you want mv to overwrite whenever possible without asking for
confirmation, specify the -f (force) option.
As long as the input files specified by each source_file are on the same device as the
target, the source_file operand can be of any file type. If the source and target reside
on different devices, the source_file is copied to the target and then removed. If the
source_file is a directory, this means that any FIFO or character special files under the
original directory aren’t copied. Since the copy isn’t 100% successful, the original
source_file isn’t removed.
Examples:
In the current directory, rename the file orange to banana.
mv orange banana
Exit status:
0 All input files were moved successfully.
Caveats:
If the copying of a directory is prematurely terminated by a signal or error, mv may
leave a partial copy of the directory at the destination. In this case, the directory tree at
source_file isn’t modified.
When the source_file and target_file are on different filesystems (i.e. not on the same
mounted partition), the mv utility spawns the cp utility to copy the file(s), and if the cp
succeeds, spawns the rm utility to remove the originals.
See also:
cp, pax, rm
Syntax:
named [-4] [-6] [-c config-file] [-d debug-level] [-f] [-g]
[-m flag] [-n num_cpus] [-p port] [-s] [-t directory]
[-u user] [-v] [-x cache-file]
Runs on:
Neutrino
Options:
See http://netbsd.gw.com/cgi-bin/man-cgi?named++NetBSD-5.0 in the
NetBSD documentation.
Description:
The named daemon is a Domain Name System (DNS) server, part of the BIND 9
distribution from ISC. For more information on the DNS, see RFCs 1033, 1034, and
1035.
When invoked without arguments, named reads the default configuration file
/etc/named.conf, read any initial data, and listen for queries.
Files:
/etc/named.conf
Default name server configuration file.
/etc/namedb/named.pid
The process ID.
See also:
/etc/named.conf in the NetBSD documentation.
hostname, kill, syslogd
gethostbyname(), signal() in the QNX Neutrino Library Reference
Based on RFC 882, RFC 883, RFC 973, RFC 974, RFC 1033
Syntax:
named-checkconf [-h] [-v] [-j] [-t directory] {filename}
[-z]
Runs on:
Neutrino
Options:
See http://netbsd.gw.com/cgi-bin/man-cgi?named-checkconf++NetBSD-5.0 in the
NetBSD documentation.
Description:
The named-checkconf utility checks the syntax, but not the semantics, of a named
configuration file. For more information, see
http://netbsd.gw.com/cgi-bin/man-cgi?named-checkconf++NetBSD-5.0 in the NetBSD
documentation.
See also:
named, /etc/named.conf in the NetBSD documentation
Syntax:
named-checkzone [-d] [-h] [-j] [-q] [-v] [-c class]
[-f format] [-F format] [-i mode]
[-k mode] [-m mode] [-M mode] [-n mode]
[-o filename] [-s style] [-S mode]
[-t directory] [-w directory] [-D] [-W mode]
{zonename} {filename}
Runs on:
Neutrino
Options:
See http://netbsd.gw.com/cgi-bin/man-cgi?named-checkzone++NetBSD-5.0 in the
NetBSD documentation.
Description:
The named-checkzone utility checks the syntax and integrity of a zone file. It
performs the same checks as named does when loading a zone.
The named-compilezone utility is similar to named-checkzone, but it always
dumps the zone contents to a specified file in a specified format. Additionally, it
applies stricter check levels by default, since the dump output will be used as an actual
zone file loaded by named.
For more information, see
http://netbsd.gw.com/cgi-bin/man-cgi?named-checkzone++NetBSD-5.0 in the NetBSD
documentation.
See also:
named, named-checkconf in the NetBSD documentation
Name:
/etc/named.conf
Description:
The /etc/named.conf file is the configuration file for named. For more
information, see http://netbsd.gw.com/cgi-bin/man-cgi?named.conf++NetBSD-5.0 in
the NetBSD documentation.
See also:
named, /etc/named.conf in the NetBSD documentation.
syslogd
syslogd() in the QNX Neutrino Library Reference
TCP/IP Network Administration
DNS and BIND by Paul Albitz and Cricket Liu, O’Reilly & Associates (ISBN
1-56592-010-4)
Syntax:
ndp -A wait [-ntl]
ndp -a [-ntl]
ndp -c [-nt]
ndp -d [-nt] hostname
ndp -f [-nt] filename
ndp -H
ndp -I [delete|interface]
ndp -i interface [flags...]
ndp -P
ndp -p
ndp -R
ndp -r
ndp -s [-nt] nodename ether_addr [temp] [proxy]
Runs on:
Neutrino
Options:
-A wait Repeat -a (dump NDP entries) every wait seconds.
-I [delete|interface]
Show or specify the default interface that’s to be used as the default
route when there’s no default router.
Option: Action:
-I Show the current default interface.
-I delete Delete the current interface from the kernel.
-I interface Use this interface as the default.
-i interface [flags...]
View the neighbor discovery (ND) information for this interface. If
flags is specified, set or clear the flag(s) associated with this
Description:
This utility manipulates the address mapping table used by the Neighbor Discovery
Protocol (NDP).
Exit status:
0 Successful completion.
See also:
arp
Syntax:
netmanager [-f file] [-p num] [-r [interface]]
[-s] [-w [interface]]
Runs on:
Neutrino
Options:
-f file The name of the configuration file (the default is /etc/net.cfg).
-p num The number of times to poll while waiting for the interface to
become available; netmanager polls every 2 seconds for a default
of 5 times.
-r [interface] Read from the configuration file the information on this interface
(default is all) and apply it.
Description:
The netmanager process is used to apply the TCP/IP configuration as described in
the configuration file. It’s usually run by phlip, or as part of the boot sequence (e.g.
during device enumeration on systems that use diskboot — see the Controlling How
Neutrino Starts chapter of the Neutrino User’s Guide). You won’t generally run
netmanager directly; you should use the Photon phlip application to generate the
configuration file.
The netmanager is setuid root, so that it can query the interfaces and display any
information. However, it doesn’t apply changes unless the real user is root.
• Interface Parameters:
- manual or dynamic (DHCP)
- ipaddress
- netmask
- aliases
• General Parameters:
- routing table
- domain
- nameservers
- search suffixes
Examples:
Write the information for all interfaces in a file:
Files:
/etc/net.cfg The configuration file written by phlip and read by
netmanager.
See also:
/etc/autoconnect, dhcp.client, diskboot, ifconfig, io-pkt*, phlip,
/etc/resolv.conf, route, slogger
Controlling How Neutrino Starts chapter of the Neutrino User’s Guide
Syntax:
Display a list of active sockets for each protocol:
Continuously display (as per the wait interval) the information regarding packet traffic
on the configured network interfaces:
Display statistics about the named protocol located at the virtual address:
Runs on:
Neutrino
Options:
-A Show the addresses of any protocol control blocks associated with
sockets.
-a Show the state of all sockets. Without -a, sockets used by server
processes aren’t shown.
-f address_family
Limit the statistics or address control block reports to those of the
specified address family.
-P pcbaddr Dump the contents of the protocol control block (PCB) located at
kernel virtual address pcbaddr. This address may be obtained using
-A. The default protocol is TCP, but may be overridden with -p.
-v Show extra (verbose) detail for the routing tables (-r), or avoid
truncating long addresses.
-w wait Specify the time interval for displaying network interface statistics.
Description:
The netstat utility displays the contents of various network-related data structures.
This utility needs to have the setuid (“set user ID”) bit set in its permissions. If you use
mkefs, mketfs, or mkifs on a Windows host to include this utility in an image, use
the perms attribute to specify its permissions explicitly, and the uid and gid
attributes to set the ownership correctly.
Default display
The default display for active sockets shows the local and remote addresses, the send
and receive queue sizes (in bytes), the protocol, and the internal state of the protocol.
If a socket’s address specifies a network but no specific host address, address formats
are of the form host.port or network.port
When known, the host and network addresses are displayed symbolically according to
the databases /etc/hosts and /etc/networks, respectively. If a symbolic name
for an address is unknown, or if -n is specified, the address is printed numerically,
according to the address family. For more information regarding the Internet “dot
format,” see the inet_*() functions. Unspecified or wildcard addresses and ports
appear as *.
Interface display
The interface display (-i or -w) provides a table of cumulative statistics regarding
errors, collisions, and packets transferred. The network addresses of the interface and
the maximum transmission unit (MTU) are also displayed.
gateway Direct routes are created for each interface attached to the local host.
For such entries, this field shows the address of the outgoing
interface.
mtu Shows the maximum transmission unit (MTU) associated with that
route. This value is used as the basis for the TCP maximum segment
size. The L flag appended to the MTU value indicates that the value
is locked, and that path MTU discovery is turned off for that route. A
- indicates that the MTU for this route hasn’t been set, and a default
TCP maximum segment size will be used.
use Provides a count of the number of packets sent using the route.
Specifying an interface
When -w is specified, netstat displays a running count of statistics related to
network interfaces. This display consists of a column for the primary interface (the
first interface found during auto-configuration) and a column summarizing
information for all interfaces. Using -I, you can replace the primary interface with
another interface. The first line of each screen of information contains a summary
since the system was last rebooted. Subsequent lines of output show values
accumulated over the preceding interval.
Caveats:
The -A, -a, -d, and -s options require the presence of the /etc/protocols file.
See also:
/etc/hosts, /etc/networks, /etc/protocols, /etc/services
Name:
/etc/networks
Description:
The networks file contains information regarding the known networks that make up
the DARPA Internet. For each network, a single line should be present with the
following information:
Items are separated by any number of spaces or tabs, or both. A pound sign (#) in a
line indicates the beginning of a comment — any characters after a #, up to the end of
the line, aren’t interpreted by routines that search the file.
The network number may be specified in the conventional “.” (dot) notation using the
inet_network() routine from the internet address manipulation functions, inet_*().
Network names may contain any printable character other than a field delimiter,
newline, or comment character.
See also:
getnetent()
Syntax:
newgrp [-l|-s] [group]
Runs on:
Neutrino
Options:
-l (“el”) Change the environment to what would be expected if the user
actually logged in again.
Description:
The newgrp utility starts a new shell with a new real and effective group ID. The user
remains logged in and the current directory doesn’t change, but file access permissions
are based on the new real and effective group IDs.
This utility needs to have the setuid (“set user ID”) bit set in its permissions. If you use
mkefs, mketfs, or mkifs on a Windows host to include this utility in an image, use
the perms attribute to specify its permissions explicitly, and the uid and gid
attributes to set the ownership correctly.
If no operands are specified, newgrp changes the group ID back to the group
identified in the invoking user’s entry in /etc/passwd.
If you don’t use the -l option, the environment variables remain unchanged.
Note that group passwords aren’t supported in QNX Neutrino. Only the user root
may change the group ID to a group that it doesn’t belong to.
Files:
/etc/group Contains information on the group IDs in the system. See
passwd’s “Files” section for a brief description of the format of
this file.
See the passwd utility “Files” section for a brief description of the format of these
files.
See also:
passwd, su
Managing User Accounts in the Neutrino User’s Guide
Syntax:
nfsd [-DFPt] [-c file] [-f n] [-H n] [-h n] [-o option] [-p n]
[-s n] [-x n] &
Runs on:
Neutrino
Options:
-c file Use file as the exports file. The default is /etc/exports.
-f n Set the size of the open file cache (the default is 16).
The open file cache is used to cache open files and directories (with a
5-second idle timeout). If you know nfsd services only one client that
only reads/writes to a single file, reducing this cache may save memory.
If you know nfsd services many clients that read/write many files,
increasing this cache could improve performance for read/write
operations.
Keep this cache a reasonable size, as file descriptors (open files) are a limited resource
— by default, QNX Neutrino sets a maximum of 1000 open files per process. Besides
this cache, nfsd needs file descriptors for sockets (servicing TCP consumes more than
just UDP) and internal readdir() operations.
-H n Specify the size of the file handle cache hash (the default is 997).
-h n Specify the size of the file handle cache (the default is 200).
The file handle cache is a straight memory/performance trade-off,
however it doesn’t significantly affect read/write performance. It helps
speed up ls-type operations (very useful for compiling/makefiles). To
get a rough idea of how large this cache should (optimally) be, use the
output of:
-P Parse the exports file, to check for errors, and then exit.
-p n Run nfsd on port n, and don’t register with portmap. By default, the
port is 2049, and nfsd registers with portmap.
Description:
The nfsd daemon services both NFS mount requests and NFS requests, as specified
by the exports file. When it starts, nfsd reads the /etc/exports.hostname file (if
this file doesn’t exist, nfsd reads /etc/exports instead) to determine which
mountpoints to service. Changes made to this file don’t take effect until you either
restart nfsd or you send nfsd a SIGHUP signal:
There’s no direct check for root on the mount; nfsd checks only that requests come
in on a privileged port, which implies root access.
The nfsd daemon supports a maximum of 15 nested directory levels.
The nfsd command doesn’t tolerate any parsing errors while reading the exports file.
If an error is detected, nfsd terminates. To keep downtime to a minimum if you
modify the exports file, we recommend that you either:
• Start another nfsd. If no parsing errors are detected, the second nfsd reports a
bind failure, and exits — this indicates the exports file was parsed correctly.
or:
Security Issues
NFS is a very unsecure protocol. Although nfsd checks each request’s origin against
restrictions specified in the exports file, this helps only in an “honest” network. It’s not
difficult to spoof NFS requests.
Configuring Caches
Fine-tuning nfsd caches may result in less memory usage and improved performance,
but these qualities are usually exclusive. Before modifying the default behavior of
nfsd, it’s important to know what its clients will demand from it. Also note that these
caches are shared across all mountpoints.
See also:
/etc/exports, fs-nfs2, fs-nfs3, io-pkt*, mount, syslogd, umount
“NFS filesystem” in the Working With Filesystems chapter of the User’s Guide
Name:
/etc/nfsstart
Description:
The nfsstart file is a shell script that you can use to start TCP/IP daemons specific
to an NFS server.
There isn’t a default version of this file; you can create your own if you need it.
Here’s a typical sample file that you should optimize on a per-system basis:
#!/bin/sh
/usr/sbin/nfsd
# NOTE: to service non-Unix clients, uncomment the next line
# (may also need to add the -norsvd option in the
# exports file)
# /usr/sbin/pcnfsd
See also:
/etc/exports, nfsd
Syntax:
nice [-nprioritylevels] command [arguments]...
Deprecated:
Runs on:
Neutrino
Options:
-prioritylevels Deprecated. This is the historical method of specifying the
amount to adjust the current priority by. Specifying -1 lowers
the priority by one, while specifying --1 boosts the priority by
one.
Description:
The nice utility invokes the specified command with a modified priority, usually
making the command behave “more nicely” towards competing processes.
If no prioritylevels option is specified, the program is invoked at a priority that’s one
level lower than the parent’s current priority (i.e. it is invoked with a “nice increment”
of 1).
If a prioritylevels option is specified, it’s subtracted from the parent’s current priority
and the program is invoked at the resultant priority. If the resulting priority isn’t a
valid priority, nice writes a diagnostic message to the standard error and exits with a
status of 1.
You can change the range of privileged priorities with the -P option for procnto.
Examples:
Run make at one priority lower than the parent’s priority (be nice):
Run make at two priorities lower than the parent’s priority (be nicer):
Run make at two priorities higher than the parent’s priority (be mean):
Exit status:
If the operation is successful, the exit status of the invoked command is returned. If an
error occurs, the exit status is as follows:
Caveats:
In contrast to other operating systems, the QNX Neutrino interpretation of the nice
value substantially affects the priority of the process. Rather than representing a
fraction of a priority, the granularity of the nice value in QNX Neutrino is of a
“whole” priority level. For example, where the following has a marginal effect on the
execution of myprog on some operating systems:
on QNX Neutrino it lowers the priority of myprog by five full priority levels, and
could have a significant effect on myprog’s execution time.
See also:
on, renice, slay
Syntax:
nicinfo [-c|g|s] [-rv] [interface|device...]
Runs on:
Neutrino
Options:
-c Display information about the configuration only.
-v Be verbose.
interface The network interface (e.g. fxp0) to display information about. If you
don’t specify an interface, nicinfo displays information about all
interfaces.
You should specify at most one of the -c, -g, and -s options.
Description:
This utility displays information about the given network interface connection, or all
interfaces if you don’t specify one. The information includes the number of packets
transmitted and received, collisions, and other errors.
• The output from nicinfo depends on what the driver supports; not all fields are
included for all drivers. However, the output always includes information about the
bytes and packets that were transmitted and received.
Examples:
# nicinfo en0
# nicinfo -r en0
# nicinfo /dev/io-net/en0
# nicinfo wm0
Exit status:
0 Successful completion.
1 An error occurred.
See also:
devn-*, devnp-*,
Connecting Hardware in the Neutrino User’s Guide
Syntax:
nm_variant [options] [objfile...]
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
The nm_variant depends on the target platform, as follows:
Description:
The nm utility lists the symbols from the specified object files. If no object files are
listed as arguments, nm assumes a.out. For detailed documentation, see the GNU
website at http://www.gnu.org/.
Contributing author:
GNU
See also:
ar, mcs
Syntax:
nohup command [argument...]
Runs on:
Neutrino
Options:
argument The argument(s) for the command to be invoked.
Description:
The nohup utility invokes the specified command with arguments supplied as the
argument operands. When the command is invoked, the SIGHUP signal is set to be
ignored; thus, the command is made immune to hangups.
If the standard output is a terminal, all output written by the specified command to its
standard output is appended to the nohup.out file in the current directory. If this
nohup.out file can’t be created, or if it can’t be opened for appending, the output is
appended to the end of the nohup.out file in the directory specified by the HOME
environment variable. If neither nohup.out file can be created or opened, the
specified command isn’t invoked.
If the standard error output is a terminal, all output written by the specified command
to its standard error output is redirected to the same file descriptor as the standard
output.
It’s often desirable to apply nohup to pipelines or lists of commands. You can do this
by placing pipelines and command lists in a single file; this file can then be executed
as a command, and the “nohup” applies to everything in the file.
Alternatively, the following can be used to apply nohup to a complex command:
nohup sh -c ’complex-command-line’
Similarly, you can use the following commands to apply nohup to a shell function:
export -f func
nohup sh -c ’command line invoking func’
If you want the SIGQUIT signal to also be ignored, you can run nohup in the
background:
Files:
./nohup.out If possible, this file will be created and the output of the command
will be written to it.
$HOME/nohup.out
If it was not possible to open ./nohup.out, nohup will attempt
to create (if necessary) and append the output of the command to
this file. If neither file can be opened, nohup will not run the
command.
Environment variables:
HOME If the output file nohup.out cannot be created in the current directory,
nohup uses the directory named by this variable to create the file.
PATH Contains the search path used to locate the command to be invoked.
Exit status:
The exit status of nohup cannot be relied upon.
License:
This utility is based on copyright software of The Regents of the University of
California; for licensing information, see the Third Party License Terms List at
http://licensing.qnx.com/third-party-terms/.
Syntax:
nslookup [-options] [host-to-find | -[server]]
Runs on:
Neutrino
Options:
options Any option from the set command.
Description:
The nslookup utility lets you query Internet domain name servers. The utility has
two modes: interactive and noninteractive. In interactive mode, you can query name
servers for information about various hosts and domains or print a list of hosts in a
domain. In noninteractive mode, nslookup just prints the name and requested
information for a host or domain.
The utility enters interactive mode when:
• the first argument is a hyphen (-) and the second argument is the hostname or
Internet address of a name server.
The utility enters noninteractive mode when the first argument is the name or Internet
address of the host to be looked up. The optional second argument specifies the host
name or address of a name server.
You can specify the options listed under the set command below in the
.nslookuprc file in your home directory; list each one on its own line.
You can specify interactive commands on the command line if they precede the
arguments and you prefix them with a hyphen. For example, to change the default
query type to host information and the initial timeout to 10 seconds, type:
Interactive commands
To interrupt a command at any time, press Ctrl-C. To exit, press Ctrl-D (EOF) or type
exit. To treat a builtin command as a host name, place an escape character (\) before
the command.
The length of the command line must be less than 256 characters.
Any unrecognized command is interpreted as a host name.
host [server] Look up information for host using the current default server or
using server, if specified.
If host is an Internet address and the query type is A or PTR
(see the set querytype command), the name of the host is
returned. If host is a name and doesn’t have a trailing period,
the default domain name is appended to the name. (This
behavior depends on the state of the set options domain,
srchlist, defname, and search).
To look up a host not in the current domain, append a period to
the name.
server domain
lserver domain Change the default server to domain. The lserver form uses
the initial server to look up information about domain while
server uses the current default server. If an authoritative
answer can’t be found, the names of servers that might have the
answer are returned.
root Change the default server to the server for the root of the
domain namespace. Because the host ns.nic.ddn.mil is
currently used, this command is a synonym for
lserver ns.nic.ddn.mil. You can change the name of the
root server with the set root command.
finger [name] [> filename]
finger [name] [>> filename]
Connect with the finger server on the current host. The current
host is defined when a previous lookup for a host completed
successfully and returned address information (see the
set querytype=A command). The name argument is
optional. Note that you can use > and >> in the usual manner.
view filename Sort and list the output of previous ls commands with more.
help
? Print a brief summary of commands.
All of the keywords on the following pages belong to the set command.
set keyword[=value]
Change state information that affects the lookups. Valid keywords are:
Diagnostics:
If the lookup request wasn’t successful, one of the following error messages may be
printed:
Timed out The server didn’t respond to a request after a certain amount of
time (changed with set timeout=value) and a certain number
of retries (changed with set retry=value).
No response from server
No name server is running on the server machine.
No records The server doesn’t have resource records of the current query
type for the host, although the hostname is valid. The query type
is specified with the set querytype command.
Nonexistent domain
The hostname or domain name doesn’t exist.
Server failure The name server found an internal inconsistency in its database
and couldn’t return a valid answer.
Format error The name server found that the request packet wasn’t in the
proper format. This may indicate an error in nslookup.
Files:
/etc/nsswitch.conf
Name-service switch configuration file.
$HOME/.nslookuprc
User’s initial options.
/etc/nslookup.help
Summary of commands.
Environment variables:
HOSTALIASES Contains host aliases.
Contributing author:
Andrew Cherenson
See also:
/etc/nsswitch.conf
dn_comp(), dn_expand(), res_init(), res_mkquery(), res_query(), res_querydomain(),
res_search(), res_send() in the Library Reference.
Based on:
Name:
/etc/nsswitch.conf
Description:
The nsswitch.conf file specifies how the nsdispatch() (name-service switch
dispatcher) routines in the socket library should operate.
The configuration file controls how a process looks up various databases containing
information regarding hosts and networks. Each database comes from a source (such
as local files, and DNS ), and the order to look up the sources is specified in
nsswitch.conf.
Each entry in nsswitch.conf consists of a database name, and a space-separated list
of sources. Each source can have an optional trailing criterion that determines whether
the next listed source is used, or the search terminates at the current source. Each
criterion consists of one or more status codes, and actions to take if that status code
occurs.
Sources
The following sources are implemented:
dns Internet Domain Name System. The hosts and networks databases use
IN class entries.
Databases
The following databases are used by the following C library functions:
Database Used by
hosts getaddrinfo(), gethostbyaddr(), gethostbyname(), and getnameinfo()
networks getnetbyaddr(), getnetbyname()
Status codes
The following status codes are available:
Actions
For each of the status codes, one of two actions is possible:
Each entry starts on a new line in the file. A number sign (#) delimits a comment to
the end of the line. Blank lines are ignored. A backslash (\) at the end of a line
escapes the newline, and causes the next line to be a continuation of the current line.
All entries are case-insensitive.
The default criteria is to return on success, and continue on anything else (i.e.
[success=return notfound=continue unavail=continue
tryagain=continue]).
Historically, many of the databases had enumeration functions, often of the form
getXXXent(). These made sense when the databases were in local files, but don’t make
sense or have lesser relevance when there are possibly multiple sources, each of an
unknown size. The interfaces are still provided for compatibility, but the source may
not be able to provide complete entries, or duplicate entries may be retrieved if
multiple sources that contain similar information are specified.
If, for any reason, nsswitch.conf doesn’t exist, or it has missing or corrupt entries,
nsdispatch() will default to an entry of files for the network database, and files
dns for the hosts database.
Luke Mewburn wrote this freely distributable name-service switch implementation,
using ideas from the ULTRIX svc.conf and Solaris nsswitch.conf manual pages.
Examples:
To look up hosts in /etc/hosts and then from the DNS, use:
hosts: files dns
See also:
/etc/resolv.conf, named
getaddrinfo(), gethostbyaddr(), gethostbyname(), getnameinfo(), getnetbyaddr(),
getnetbyname() in the Neutrino Library Reference
nsdispatch() in the NetBSD documentation at http://www.netbsd.org/docs/
Syntax:
nsupdate [-d] [[-y [hmac:]keyname:secret] | [-k keyfile]]
[-t timeout] [-u udptimeout] [-r udpretries]
[-R randomdev] [-v] [filename]
Runs on:
Neutrino
Options:
See http://netbsd.gw.com/cgi-bin/man-cgi?nsupdate++NetBSD-5.0 in the NetBSD
documentation.
Description:
The nsupdate utility is used to submit Dynamic DNS Update requests as defined in
RFC2136 to a name server. This allows resource records to be added or removed from
a zone without manually editing the zone file. A single update request can contain
requests to add or remove more than one resource record. For more information, see
http://netbsd.gw.com/cgi-bin/man-cgi?nsupdate++NetBSD-5.0 in the NetBSD
documentation.
See also:
dnssec-keygen, named in the NetBSD documentation
Syntax:
ntpd [-46aAbdgLmnNpqx] [-c conffile] [-D level]
[-f driftfile] [-i jaildir]
[-k keyfile] [-l logfile] [-p pidfile]
[-P priority] [-r broadcastdelay]
[-s statsdir] [-t key]
[-u user[:group] ] [-v variable] [-V variable]
Runs on:
Neutrino
Options:
-4 Force DNS resolution of hosts to the IP4 namespace.
-c conffile Specify the name and path of the configuration file; the default is
/etc/ntp/ntp.conf. For information about this file, see its
entry in the FreeBSD documentation.
-d Use debugging mode. You can specify this option more than
once, with each occurrence producing a greater amount of detail
-f driftfile Specify the name and path of the frequency file; the default is as
specified by driftfile driftfile configuration command, if
present in the ntp.conf file.
-g Set the panic threshold to any value without any restriction. If the
offset exceeds the default value (1000 s) of this panic threshold,
ntpd exits with a message to the system log. You can use this
option with the -q and -x options. See the tinker command for
other options.
-i jaildir Change the server’s root directory to be jaildir. This option also
implies that the server attempts to drop root privileges at startup
(otherwise, changing the root directory gives little additional
-k keyfile Specify the name and path of the symmetric key file; the default
is /etc/ntp/ntp.keys. This is the same operation as the keys
keyfile configuration command. For information about this file,
see its entry in the FreeBSD documentation.
-l logfile Specify the name and path of the log file. The default is the
system log file. This is the same operation as the logfile logfile
configuration command.
-n Don’t fork.
-p pidfile Specify the name and path of the file used to record the ntpd
process ID. This is the same operation as the pidfile pidfile
configuration command.
-q Exit the ntpd utility just after the first time the clock is set. You
can use the -g and -x options with this option.
-s statsdir Specify the directory path for files created by the statistics
facility. This is the same operation as the statsdir statsdir
configuration command.
-t key Add a key number to the trusted key-list. This option can occur
more than once.
-v variable
-V variable Add the given system variable.
-x Set the step threshold to 600 s. The default value is 128 ms. If
the offset is less than (or above) the step threshold, the time is
adjusted (or stepped up). You can use this option with the -g and
-q options. Please also see the tinker command.
Description:
Use the ntpd utility to set and maintain the system time of day in synchronism with
the Internet standard time servers. This utility is an operating system daemon that
conforms to the NTP (Network Time Protocol) version 4 specification. It also retains
compatibility with version 3, as defined by RFC 1305, and version 1 and 2, as defined
by RFC 1059 and RFC 1119. Using the 64-bit floating point arithmetic, the ntpd
utility attempts to preserve the ultimate precision, which is about 232 picoseconds.
While the ultimate precision isn’t achievable with today’s workstations and networks,
it’s required for future gigahertz CPU clocks and gigabit LANs.
The ntpd utility normally reads the ntp.conf file for its configuration. For
information about this file, see its entry in the FreeBSD documentation.
This doesn’t set the hardware clock; you can use the rtc utility to set the time on the
chip.
Under ordinary conditions, ntpd adjusts the clock in small steps so that the time scale
is continuous. Under conditions of extreme network congestion, the ntpd algorithms
discard sample offsets exceeding 128 ms, because:
• the synchronization distance, which is equal to one-half the roundtrip delay plus
error budget terms, can become very large.
When there is no TOY chip, and the client time is more than 1000 seconds from the
server time, you should intervene and set the clock by hand — causing the ntpd
utility to exit with a panic message to the system log.
Frequency discipline
The behavior of the ntpd utility at startup depends on the existence of ntp.drift
frequency file. This file contains the latest estimate of the clock frequency error. If this
file doesn’t exist, the ntpd utility enters a special mode designed to quickly adapt to
system clock oscillator time and frequency error. After approximately 15 minutes,
when the time and frequency are set to nominal values, the ntpd utility starts tracking
the time and frequency relative to the server. After one hour, the current frequency
offset is written to ntp.drift frequency file. Since the ntpd frequency is initialized
from this file, the ntpd utility enters into normal mode immediately during startup.
Subsequently, the current frequency offset is written to the ntp.drift frequency file
at hourly intervals.
Operating modes
The ntpd utility operates continuously while monitoring for small changes in
frequency, trimming the clock for ultimate precision. It operates in one of several
modes:
• symmetric active/passive
• client/server
• broadcast/multicast
• manycast.
The ntpd utility also operates in one-time mode where the time is set from an external
server, and the frequency is set from a previously recorded frequency file. When a
client operates in broadcast/multicast or manycast mode, it first discovers the remote
server, and then configures itself automatically — after computing the server-client
propagation delay correction factors. You can now deploy a fleet of workstations
without specifying configuration details that are specific to your local environment.
When the ntpd utility runs in continuous mode, each of the external servers is polled
at intervals determined by an intricate state machine. The state machine determines
the poll interval using a heuristic algorithm, after measuring the incidental roundtrip
delay jitter and oscillator frequency wander. In most operating environments, the state
machine starts with intervals of 64 seconds that increase to 1024 seconds, in steps. A
small amount of random variation is also introduced, in order to avoid bunching at the
servers.
In some cases, it may not be practical for ntpd to run continuously. A common
workaround has been to run the ntpdate utility from a cron job at designated times.
This utility, however, doesn’t have the signal processing, error checking, and
mitigation algorithms of the ntpd utility. The -q option is intended for this purpose.
In QNX Neutrino, an useful feature is available to discipline the clock frequency.
First, the ntpd utility is run in continuous mode with selected servers in order to
measure and record the intrinsic clock frequency offset. This may take hours (for the
frequency and offset) to settle down. Then, the ntpd utility is stopped and run in
one-time mode as required. At each startup, ntpd reads the frequency from the file
and initializes the kernel frequency.
however, to consider the consequences of changing the adjustment range for poll
intervals.
The default minimum for poll interval is 64 seconds, and the default maximum is
1,024 seconds.
You can change the default minimum with the tinker minpoll command to a value
not less than 16 seconds. This value is used for all configured associations, unless
overridden by the minpoll option on the configuration command. Most of the device
drivers don’t operate properly if the poll interval is less than 64 seconds.
In some cases involving dialup or toll services, you may also increase the minimum
interval to a few tens of minutes and the maximum interval to a day or so. Under
normal operating conditions, once the clock discipline loop has stabilized, the interval
is increased in steps from the minimum to the maximum value. This assumes,
however, that the intrinsic clock frequency error is small enough for the discipline loop
to correct it. The capture range of the loop is 500 PPM at an interval of 64 seconds,
decreasing by a factor of two for each doubling of interval. At a minimum of 1,024
seconds, for example, the capture range is only 31 PPM. If the intrinsic error is greater
than this, the ntp.drift drift file is specially tailored to reduce the residual error
below this limit. Once this is done, the drift file is automatically updated once every
hour and is available to initialize the frequency on subsequent daemon restarts.
See also:
ntpdate, ntpdc, ntpq, ntptrace, rtc
ntp.conf, ntp.keys in the FreeBSD documentation
Based on RFC 1059, RFC 1119, RFC 1305
Syntax:
ntpdate [-46bBdqsuv] [-a key] [-e authdelay]
[-k keyfile] [-M i=your_hostname]
[-o version] [-p samples]
[-t timeout] server [...]
Runs on:
Neutrino
Options:
-4 Force DNS resolution of hosts to the IP4 namespace.
-a key Enable the authentication function, where key is the key identifier.
Both keys and the key identifiers must match the client and server
key files. The default is to disable the authentication function.
-d Enable the debugging mode, after going through all the steps. Don’t
adjust the local clock. Print the useful information.
-e authdelay Specify the processing delay authdelay (in seconds and fractions
thereof) to perform an authentication function. This option
improves timekeeping for slow CPUs. You may neglect it for most
purposes.
-k keyfile Specify the path for the authentication key file as the string keyfile.
The default is /etc/ntp/ntp.keys. For information about this
file, see its entry in the FreeBSD documentation.
-M i=your_hostname
Enable your host to listen broadcast and multicast messages.
-p samples Specify the number of samples acquire from each server. The range
is 1 to 8; the default is 4.
-t timeout Specify the maximum time for a server response — in seconds and
fractions thereof. The value is rounded to a multiple of 0.2 seconds.
The default is 1 second, a value suitable for polling across a LAN.
Description:
Use the ntpdate utility to set the local time and date by polling NTP (Network Time
Protocol) servers. The accuracy and reliability of this utility depends on the number of
servers, the number of polls each time it is run, and the interval between runs.
At boot time, you may use a host startup script to run the ntpdate utility in order to
set the clock. If necessary, you can also run this utility manually. Using the host script
to set time initially is sometimes useful, e.g. set the time before you start the NTP
daemon, ntpd. You can also run ntpdate from a cron script. The accuracy of the
ntpdate utility is limited.
You use an -M option to support broadcast and multicast messages. Use -M
i=hostname to join the multicast group. You are now able to listen for broadcast and
multicast messages from an broadcast/multicast enabled server.
Use the ntpdate utility to adjust time in two ways:
• Use settimeofday() to step the time when the clock’s in error by more than 0.5
seconds.
• Use ClockAdjust() to adjust the time when the clock’s in error by less than 0.5
seconds.
The latter technique is less disruptive and more accurate when the error is small, and
works quite well when ntpdate is run by cron every hour or two.
When the ntpd utility is running on the same host, the ntpdate utility doesn’t set the
date.
You may force the DNS resolution to the IPv4 (or IPv6) namespace, if you use a -4
(or -6) option that precedes a host name.
Caveats:
Since the time adjustment is actually 50% larger than the measured offset, it tends to
keep a badly drifting clock more accurate. This is not good, however, for some kernel
variables such as tick or tickadj.
See also:
ntpd, ntpdc, ntpq, ntptrace
ClockAdjust(), settimeofday() in the Neutrino Library Reference
ntp.keys in the FreeBSD documentation
Syntax:
ntpdc [-46ilnps] [-c command] [host] [...]
Runs on:
Neutrino
Options:
-4 Force DNS resolution of hosts to the IP4 namespace.
-c command Execute the given command on the specified hosts. You can use
multiple -c options. For more information about the commands,
see below.
-p Print a list of the peers known to the server along with the
summary of their state. This is equivalent to the -c peers option.
-s Print a list of the peers known to the server along with the summary
of their state. It has slightly different format than the -p option.
This is equivalent to -c dmpeers command.
Description:
Use the ntpdc utility to query the ntpd daemon about its current state, and to request
changes in that state. You can run this utility is run either in interactive mode or in
command mode. It provides extensive state and statistics information. At run time, all
configuration options that are specified at startup using the ntpd utility’s configuration
file can also be specified using the ntpdc utility.
When you run the ntpdc utility by including one or more requests in the command
line, each request is sent to the NTP (Network Time Protocol) servers running on each
of the hosts. If no request option is given, the ntpdc utility attempts to read
commands from the standard input and execute them on the NTP server running on the
first host, as given on the command line. If no host is mentioned, it always defaults to
localhost. The ntpdc utility prompts for commands if the standard input is a
terminal device.
The ntpdc utility uses NTP mode 7 packets to communicate with the NTP server, and
hence can be used to query any compatible server on the network that permits it.
However it is somewhat unreliable, especially over large distances in a network
topology. The ntpdc utility makes no attempt to retransmit requests, and times out if
the remote host’s response isn’t received within a suitable timeout time.
You may force the DNS resolution to the IPv4 (or IPv6) namespace, if you use a -4
(or -6) option before a host name.
Interactive commands
The interactive format commands consist of a keyword followed by zero or more
arguments. You can type only enough characters to uniquely identify the command.
The output of a command is normally sent to the standard output, but you can send
output of individual commands may be sent to a file by appending a <, followed by a
file name, to the command line. A number of interactive format commands are
executed entirely within the ntpdc utility:
? [command_keyword]
help [command_keyword]
Print a list of all the command keywords for the ntpdc utility. If
you specify a command keyword, the function and the usage
information about the command are printed.
delay milliseconds
Specify a time interval. This is to be added to timestamps for
requests that require authentication.
host hostname Set the host to which future queries will be sent. The hostname
may be either a host name or a numeric address.
hostnames [yes | no]
Print the host names in the information display when yes is
specified. Print the numeric address when no is specified. The
default is yes, unless modified using the command-line -n option.
keyid keyid Set the key number to use to authenticate configuration requests.
This must correspond to a key number that the server has been
configured to.
timeout milliseconds
Specify a timeout period for responses to server queries. The
default is about 8000 milliseconds. Since the ntpdc utility retries
each query once after a timeout, the total waiting time for a
timeout will be twice the timeout value set.
listpeers Obtain and print a brief list of the peers for which the server is
maintaining the state. These should include all configured peer
associations as well as those peers whose stratum is such that they
are considered by the server to be possible future synchronization
candidates.
peers Obtain a list of peers for which the server is maintaining the state,
along with a summary of that state. Summary information includes
the address of the remote peer, the local interface address
(0.0.0.0 if a local address has yet to be determined), the stratum
of the remote peer (a stratum of 16 indicates the remote peer is
unsynchronized), the polling interval, in seconds, the register in
octal, and the current estimated delay, offset and dispersion of the
peer, all in seconds.
The character in the left margin indicates the mode this peer entry
is operating in.
dmpeers Obtain peer summary list, identical to the output of the peers
command, except for the character in the leftmost column.
Characters appear only beside peers that were included in the final
stage of the clock selection algorithm. A . indicates that this peer
was cast off in the falseticker detection, while a + indicates that the
peer made it through. A * denotes the peer the server is currently
synchronizing with.
kerninfo Obtain and print kernel phase-lock loop operating parameters. This
information is available only if the kernel has been specially
modified for a precision timekeeping function.
sysinfo Print a variety of system state variables, i.e., state related to the
local server. All except the last four lines are described in the NTP
Version 3 specification, RFC 1305.
The system flags show various system flags, some of which can be
set and cleared by the enable and disable configuration
commands, respectively. These are the auth, bclient, monitor,
pll, pps and stats flags. See the ntpd documentation for the
meaning of these flags.
There are two additional flags which are read only, the
kernel_pll and kernel_pps. These flags indicate the
synchronization status when the precision time kernel
modifications are in use. The kernel_pll indicates that the local
clock is being disciplined by the kernel, while the kernel_pps
indicates the kernel discipline is provided by the PPS signal.
The stability is the residual frequency error remaining after the
system frequency correction is applied and is intended for
maintenance and debugging. In QNX Neutrino, this value will
initially decrease from as high as 500 ppm to a nominal value in the
range .01 to 0.1 ppm. If it remains high for some time after starting
the daemon, something may be wrong with the local clock, or the
value of the kernel variable tick may be incorrect. The
broadcastdelay shows the default broadcast delay, as set by the
broadcastdelay configuration command. The authdelay
shows the default authentication delay, as set by the authdelay
configuration command.
reslist Obtain and print the server’s restriction list. This list is (usually)
printed in sorted order and may help to understand how the
restrictions are applied.
monlist [version]
Obtain and print traffic counts collected and maintained by the
monitor facility. You don’t normally have to specify the version
number.
clkbug clock_peer_address [...]
Obtain debugging information for a reference clock driver. This
information is provided only by some clock drivers and is mostly
undecodable without a copy of the driver source in hand.
readkeys Purge the current set of authentication keys and obtain a new set by
rereading the keys file (which must have been specified in the ntpd
configuration file). This allows encryption keys to be changed without
restarting the server.
Caveats:
The ntpdc utility is a crude hack. It is designed so that new (and temporary) features
were easy to hack in, at great expense to the program’s ease of use. Despite this, the
program is occasionally useful.
See also:
ntpd, ntpdate, ntpq, ntptrace
Syntax:
ntpq [-46dinp] [-c command] [host] [...]
Runs on:
Neutrino
Options:
-4 Force DNS resolution of hosts to the IP4 namespace.
-c command Execute the given command on the specified hosts. You can use
multiple -c options.
Description:
The ntpq utility monitors the ntpd daemon operations and determines its
performance. It uses the standard NTP mode 6 control message formats defined in
Appendix B of the NTPv3 specification RFC 1305. The same formats are also used
for NTPv4 specification, which has more variables, and are discussed here.
You can run this utility either in interactive mode or in command mode. Command
mode is controlled using command-line arguments. You can use both raw and
pretty-printed options when assembling requests to read or write. You can also obtain
and print a list of peers in a common format by sending multiple queries to the server.
When you run the ntpq utility by including one or more requests in the command
line, each request is sent to the NTP servers running on each of the hosts. If no request
option is given, ntpq attempts to read commands from the standard input and execute
them on the NTP server running on the first host, as given on the command line. If no
host is mentioned, it always defaults to localhost. The ntpq utility prompts for
commands if the standard input is a terminal device.
The ntpq utility uses NTP mode 6 packets to communicate with the NTP server, and
hence can be used to query any compatible server on the network that permits it.
However it is somewhat unreliable, especially over large distances in a network
topology. The ntpq utility makes only one attempt to retransmit requests, and times
out if the remote host’s response isn’t received within a suitable timeout time.
In contexts where a host name is expected, a -4 qualifier preceding the host name
forces DNS resolution to the IPv4 namespace, while a -6 qualifier forces DNS
resolution to the IPv6 namespace.
Specifying a command line option other than -i or -n causes the specified queries to
be sent to the indicated host(s) immediately. Otherwise, ntpq attempts to read
interactive format commands from the standard input.
Internal commands
The interactive format commands consist of a keyword followed by zero or more
arguments. You can type only enough characters to uniquely identify the command.
The output of a command is normally sent to the standard output, but you can send the
output to a file by appending a <, followed by a file name, to the command line. A
number of interactive format commands are executed entirely within the ntpq utility:
? [command_keyword]
helpl [command_keyword]
Print a list of all the command keywords for ntpq utility. If you
specify a command keyword, the function followed by a
command keyword, the function and the usage information about
the command are printed.
delay milliseconds
Specify a time interval. This is to be added to timestamps for
requests that require authentication.
host hostname Set the host to which to send future queries. The hostname may
be either a host name or a numeric address.
hostnames [yes | no]
Print the host names in the information display when yes is
specified. Print the numeric address when no is specified. The
default is yes, unless modified using the command-line -n
option.
ntpversion 1 | 2 | 3 | 4
Set the NTP version number that the ntpq utility claims in
packets. The default value is 3. Mode 6 control messages (and
modes, for that matter) didn’t exist in NTP version 1.
exceptions are the peers command, which sends a preprogrammed series of messages
to obtain the required data, and the mreadlist and mreadvar commands, which
iterate over a range of associations.
associations Obtain and print a list of association identifiers and status for
in-spec peers of the NTP servers you query. The list is printed
in columns. The first column is an index, numbering the
associations from 1 for internal use, the second column is the
actual association identifier returned by the server, and the third
column is the status word for the peer. The following columns
contain data decoded from the status word.
The data returned by the associations command is cached
internally in the ntpq utility. The index is useful when you
deal with some servers that have association identifiers which
are hard for humans to type. For any subsequent command that
requires an association identifier as an argument, you can use
the form and the index as an alternative.
clockvar [assocID] [variable_name [ = value [...]] [...]
cv [assocID] [variable_name [ = value [...] ][...]
Request to send a list of the server’s clock variables. Servers
that have radio clock or other external synchronization
mechanism respond positively to this. If the association
identifier is omitted or zero, the request for the variables of the
system clock gets a positive response from all servers with a
clock. If the server treats clocks as pseudo-peers, and has more
than one clock connected, referencing the appropriate peer
association identifier show the variables of a particular clock.
Omitting the variable list causes the server to return a default
variable display.
lassociations Obtain and print a list of association identifiers and status of the
peers for which the server is maintaining state. This
command differs from the associations command only for
servers that retain state for out-of-spec client associations. Such
associations are normally omitted from the display when the
associations command is used, but are included in the
output of lassociations.
Tally codes
The character in the left margin of the peers billboard, called the tally code, shows
the fate of each association in the clock selection process. Following is a list of these
characters, for which the peer is:
System variables
The status, leap, stratum, precision, rootdelay, rootdispersion, refid, reftime, poll,
offset, and frequency variables are described in RFC 1305 specification. Additional
NTPv4 system variables include:
state State of the clock discipline state machine. The values are described
in the architecture briefing on the NTP project page linked from
www.ntp.org.
flags Current flags word bits and message digest algorithm identifier
(NID) in hexadecimal format. The high-order 16 bits of the four-byte
word contain the NID from the OpenSSL library, while the
low-order bits are interpreted as follows:
cert A list of certificates held by the host. Each entry includes the subject,
issuer, flags and NTP filestamp in order. The bits are interpreted as
follows, where the certificate:
0x04 Is private.
0x08 Contains errors and shouldn’t be trusted.
refresh NTP timestamp when the host public cryptographic values are
refreshed and signed.
Peer variables
The status, srcadr, srcport, dstadr, dstport, leap, stratum, precision, rootdelay,
rootdispersion, readh, hmode, pmode, hpoll, ppoll, offset, delay, dspersion, and reftime
variables are described in the RFC 1305 specification, as are the timestamps org, rec
and xmt. Additional NTPv4 peer variables include:
flash Flash code for the most recent packet received. The encoding and
meaning of these codes is given below.
unreach Value of the counter which records the number of poll intervals since the
last valid packet was received.
When the NTPv4 daemon is compiled with the OpenSSL software library, additional
peer variables are displayed, as follows:
flags Current flag bits. This word is the server host status word with
additional bits used by the Autokey state machine.
initkey Initial key used by the key list generator in the Autokey protocol.
initsequence Initial index used by the key list generator in the Autokey protocol.
timestamp NTP timestamp when the last Autokey key list was generated and
signed.
Flash codes
Use the flash code to debug. It is displayed in the peer variables list and shows the
results of the original sanity checks defined in the NTP specification RFC 1305 and
additional ones added in NTPv4. There are 12 tests, designated as TEST1 through
TEST12, that perform in a certain order designed to gain maximum diagnostic
information while protecting against accidental or malicious errors. The flash variable
is initialized to zero as each packet is received. If, after each set of tests, one or more
bits are set, the packet is discarded. Use these tests for the following tasks:
TEST9 Check the health of the association itself. If any bits are set, the packet is
discarded. Otherwise, the saved variables are passed to the clock filter and
mitigation algorithms.
0x002 TEST2 Bogus packet. The packet is not a reply to a message previously
sent. This can happen when the NTP daemon is restarted before
somebody else notices.
0x004 TEST3 Unsynchronized. One or more timestamp fields are invalid. This
normally happens when the first packet from a peer is received.
0x080 TEST8 Root delay or dispersion is greater than one second, which is
highly unlikely unless the peer is unsynchronized.
0x100 TEST9 Peer delay or dispersion is greater than one second, which is
highly unlikely.
0x400 TEST11 Autokey protocol has not verified the server or peer.
0x800 TEST12 A protocol or configuration error has occurred in the public key
algorithms or a possible intrusion event has been detected.
Caveats:
The peers command is nonatomic and may occasionally result in spurious error
messages about invalid associations. Also, you wait a long time for timeouts, because
the timeout time is a fixed constant, and it assumes the worst-case scenario. In
addition, the program doesn’t estimate timeout as it sends queries to a particular host.
See also:
ntpd, ntpdate, ntpdc, ntptrace
Syntax:
ntptrace [-dnv] [-r retries] [-t timeout] [server]
Runs on:
Neutrino
Options:
-d Turn on debugging output.
-r retries Set the number of retransmission attempts for each host. The default
value is 5.
-t timeout Set the value of retransmission timeout in seconds. The default value
is 2.
Description:
The ntptrace utility determines the source of time for the NTP (Network Time
Protocol) servers. It follows the chain of NTP servers back to their master time source.
If you don’t specify a server, it starts with the localhost.
$ ntptrace
On each line, the fields are printed from left to right: the host name, the host stratum,
the time offset between that host and the local host, the host synchronization distance,
and the reference clock ID. Note that all times are expressed in seconds, and the time
offset mentioned is not always zero. The stratum is the server hop count to the primary
source, while the synchronization distance is the estimated error relative to the primary
source. These terms are precisely defined in RFC 1305.
Caveats:
The ntptrace utility can’t improve accuracy by doing multiple samples.
See also:
ntpd, ntpdate, ntpdc, ntpq
Based on RFC 1305
Syntax:
objcopy_variant [options] infile [outfile]
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
The objcopy_variant depends on the target platform, as follows:
Description:
The GNU objcopy utility copies the contents of one object file, infile, to another,
outfile. The objcopy utility uses the GNU BFD Library to read and write the object
files. It can write the destination object file in a format different from that of the source
object file. The exact behavior of objcopy is controlled by command-line options.
For detailed documentation, see the GNU website at http://www.gnu.org/.
Contributing author:
GNU
See also:
mcs, objdump
Syntax:
objdump_variant [options] objfile...
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
The objdump_variant depends on the target platform, as follows:
Description:
The objdump utility displays information about one or more object files. The options
control what particular information to display. The objfile. . . arguments identify the
object files to be examined. When you specify archives, objdump shows information
on each of the member object files.
For detailed documentation, see the GNU website at http://www.gnu.org/.
Contributing author:
GNU
See also:
ldd, mcs, objcopy
Syntax:
od [-v] [-A format] [-t fmtstr] [-N count]
[-j skip] [file]...
Runs on:
QNX Neutrino, Microsoft Windows
Options:
-A format Display the file offset field in one of the following formats:
• d — decimal, 9 digits
• n — none (omit this field)
• o — octal, 10 digits
• x — hexadecimal, 7 digits.
The default is o.
-j skip Ignore the first skip bytes of data. You can add a trailing character to
specify units of blocks (b), kilobytes (k), or megabytes (m).
-N count Display only count bytes of input. You can add a trailing character to
specify units of blocks (b), kilobytes (k), or megabytes (m).
-t format Display data field using this format specification; see “Output formats,”
below.
The default format is oS.
file The pathname of an input file. If you don’t specify any files, od reads
from standard input.
Description:
Use the od utility to display a file in various forms, including decimal, hex, octal, and
ASCII. The name “od” (octal dump) is derived from the default output format.
The od utility processes input in 16-byte units that are formatted into a line. In the
default output format:
For example:
$ echo "abcdefghijklmnopqrstuvwxyz01234" | od
0000000000 14430661141 15031663145 15432665151 16033667155
0000000020 16434671161 17035673165 06114075171 01215031462
0000000040
To exclude part of the input, use the -N and -j options. You can specify the arguments
to these options in hex (using a 0x prefix) or octal (using a 0 prefix). The default units
for these options are bytes, but you can specify different units as follows:
Output formats
To specify the output format, use the -t option. The format argument — which you
can specify in decimal, hex, or octal — tells od which format to use for presenting the
output:
d[1|2|4|C|S|I|L]
Decimal, in objects the size of an int by default.
o[1|2|4|C|S|I|L]
Octal, in objects the size of an int by default.
u[1|2|4|C|S|I|L]
Unsigned decimal, in objects the size of an int by default.
x[1|2|4|C|S|I|L]
Hexadecimal, in objects the size of an int by default.
The input, processed in 16-byte units formatted into a line, is displayed according to
the size you choose:
Examples:
Display the second to eleventh sectors of the hard disk, /dev/hd0:
od -j 1b -N 10b /dev/hd0
Exit status:
0 All input files were processed successfully.
See also:
hd
Syntax:
omshell
Runs on:
Neutrino
Options:
See the subcommands below.
Description:
The omshell utility is a command shell that provides an interactive way to connect,
query, and possibly change, the ISC DHCP Server’s state via OMAPI, the Object
Management API. By using OMAPI and omshell, you don’t have to stop, make
changes, and then restart the DHCP server; you can make the changes while the server
is running. The omshell utility provides a way of accessing OMAPI.
OMAPI is simply a communications mechanism that lets you manipulate objects. To
actually use omshell, you must understand what objects are available and how to use
them.
Documentation for OMAPI objects can be found in the description for servers that
provide them (e.g. in the documentation for dhcpd).
Opening a connection
The omshell utility is started from the command line with several commands that can
be issued:
server address The IP address of the DHCP server to connect to. The default
server is 127.0.0.1 (localhost).
port number The Port that OMAPI listens on. By default, this is 7911.
key name secret This specifies the TSIG key to use to authenticate the OMAPI
transactions. The argument name is the name of a key defined in
dhcpd.conf.
open Now, the local lease object you created and set the IP address for is
associated with the corresponding lease object on the DHCP server. All of
the lease attributes from the DHCP server are also the attributes on the local
object, and are shown in omshell.
new lease
This creates a new local lease object.
open
Now, if a lease with that IP address exists, you’ll see all the information the DHCP
server has about that particular lease. Any data that isn’t readily printable text will
show up in colon-separated hexadecimal values. In this example, the server’s output
for the entire transaction might look like this:
obj: lease
ip-address = c0:a8:04:32
state = 00:00:00:02
dhcp-client-identifier = 01:00:10:a4:b2:36:2c
client-hostname = "something-else"
subnet = 00:00:00:06
pool = 00:00:00:07
hardware-address = 00:10:a4:b2:36:2c
hardware-type = 00:00:00:01
ends = dc:d9:0d:3b
starts = 5c:9f:04:3b
tstp = 00:00:00:00
tsfp = 00:00:00:00
cltt = 00:00:00:00
<
> update
obj: lease
ip-address = c0:a8:04:32
state = 00:00:00:02
dhcp-client-identifier = 01:00:10:a4:b2:36:2c
client-hostname = "something-else"
subnet = 00:00:00:06
pool = 00:00:00:07
hardware-address = 00:10:a4:b2:36:2c
hardware-type = 00:00:00:01
ends = dc:d9:0d:3b
starts = 5c:9f:04:3b
tstp = 00:00:00:00
tsfp = 00:00:00:00
cltt = 00:00:00:00
create
name = "some-host"
hardware-address = 00:80:c7:84:b1:94
> set hardware-type = 1
obj: host
name = "some-host"
hardware-address = 00:80:c7:84:b1:94
hardware-type = 1
> set ip-address = 192.168.4.40
obj: host
name = "some-host"
hardware-address = 00:80:c7:84:b1:94
hardware-type = 1
ip-address = c0:a8:04:28
> create
obj: host
name = "some-host"
hardware-address = 00:80:c7:84:b1:94
hardware-type = 00:00:00:01
ip-address = c0:a8:04:28
>
Your dhcpd.leases file would then have an entry like this in it:
host some-host {
dynamic;
hardware ethernet 00:80:c7:84:b1:94;
fixed-address 192.168.4.40;
}
The dynamic; line is to denote that this host entry didn’t come from dhcpd.conf,
but was created dynamically via OMAPI.
Resetting attributes
If you want to remove an attribute from an object, you can do this with the unset
command. Once you have unset an attribute, you must use the update command to
update the remote object. So, if the host somehost from the previous example
wouldn’t have a static IP address any more, the commands in omshell would look
like this:
obj: host
name = "some-host"
hardware-address = 00:80:c7:84:b1:94
hardware-type = 00:00:00:01
ip-address = c0:a8:04:28
> unset ip-address
obj: host
name = "some-host"
hardware-address = 00:80:c7:84:b1:94
hardware-type = 00:00:00:01
ip-address = <null>
>
name = "some-host"
hardware-address = 00:80:c7:84:b1:94
hardware-type = 00:00:00:01
ip-address = c0:a8:04:28
> remove
obj: <null>
>
In order to use the OMAPI interface, you must have the following line in your
dhcpd.conf to specify a port:
omapi-port 7911;
See also:
dhcpd, dhcp.client
Syntax:
on [-C cpunum] [-d] [-h] [-n|f nodename] [-P]
[-p priority[policy]] [-R runmask] [-s]
[-t tty] [-u user | -l user_name] [-W nsec]
[-w device] [-Xsched_command] [command [args]]
Runs on:
Neutrino
Options:
-C cpunum (QNX Neutrino Core OS 6.3.2 or later) Set the CPU affinity to
cpunum, where the first CPU is 0. You can use this option
multiple times. For more information, see “Setting the
runmask,” below.
-f nodename Spawn from the remote node using the remote node’s / as
prefix root (i.e. search for the executable on the remote node).
In contrast, the -n option searches for the executable on the
local node.
-l user_name (“el”) Login as the given user. This option is similar to the -u
option, but also sets the LOGNAME, HOME, and SHELL
environment variables, sets the umask to 022, and changes to
the directory specified for the user in the password database.
-n nodename Execute command (as found on the local node) on the remote
nodename. In contrast, the -f option searches for the
executable on the remote node.
-R runmask (QNX Neutrino Core OS 6.3.2 or later) Set the CPU affinity to
runmask. You can use this option multiple times to specify
masks that are more than 32 bits long. For more information,
see “Setting the runmask,” below.
-u uid[:gid[,gid,. . . ]]
-u user_name
Run as the user specified by the numeric uid, in the specified
group(s), or as the given user_name.
-W nsec The number of seconds to wait for the device specified in the
following -w option. The default is forever.
You can repeat the -w and -W options on the command line. They’re processed in the
order given, before any other options.
Description:
The on utility extends the process creation abilities of the shell (sh). You can start a
process on a remote node, on a different controlling terminal, in a HELD state for
debugging or later synchronized starting.
If the -d option isn’t specified, a network connection is created as a local agent for the
remote child process. When the child terminates, the parent must do a wait() on the
created connection to reap the zombie process entry for the child. If the -d option is
specified, the command is detached from its parent. The parent isn’t able to do a wait()
for the child, nor is it able to control it via signals.
By default, the command is run in the current session. The -t option starts a new
session, which means the command won’t receive a SIGHUP if the current session
leader terminates.
CAUTION: The on -t command becomes the new session leader on the tty
! specified, i.e. it receives SIGHUP generated by hangups on that tty. Any processes
originally running on that tty don’t get SIGHUP, and this condition persists even when
the process started by on has terminated. For this reason, specify only ttys that aren’t
currently in use.
You can use on to set the runmask and inherit mask for a new process; to change the
masks for threads that are already running, use slay. Both commands interpret the -C
and -R options in the same way.
You can use more than one -R option to specify a runmask that’s more than 32 bits
long. The first -R option specifies bits 0 through 31, the second specifies bits 32
through 63, and so on.
If you use both the -C and -R options or multiple instances of them, the resultant mask
is the bitwise ORing of all -C and -R options. For example, on -R 0x1 is equivalent
Examples:
Run login on console 2:
on -t con2 login
on -n ruth who
Run who on node george with a new session, its standard I/O connected to console 1
on node ruth:
Exit status:
The on utility exits with the exit status of command.
See also:
nice, sh, slay
stat() in the Library Reference
Multicore Processing chapter of the System Architecture guide, the Multicore
Processing User’s Guide
Adaptive Partitioning User’s Guide
Syntax:
op command
Runs on:
QNX Neutrino
Options:
None.
Description:
The op utility was designed as an easy way to run commands as root.
CAUTION: This utility is a security hole. You have to log in as root and do the
! following in order to make it do anything:
chmod +s /usr/bin/op
See also:
login, passwd, su
Logging In, Logging Out, and Shutting Down in the Neutrino User’s Guide
Syntax:
openssl command [command_opts] [command_args]
openssl [list-standard-commands |
list-message-digest-commands |
list-cipher-commands |
list-cipher-algorithms |
list-message-digest-algorithms |
list-public-key-algorithms]
Runs on:
QNX Neutrino
Options:
None.
Description:
OpenSSL is a cryptography toolkit implementing the Secure Sockets Layer (SSL
v2/v3) and Transport Layer Security (TLS v1) network protocols and related
cryptography standards that they require.
The openssl program is a command-line tool for using the various cryptography
functions of OpenSSL’s crypto library from the shell. You can use it for the following:
Command summary
The openssl program provides a rich variety of commands (command in the
synopsis above), each of which often has a wealth of options and arguments
(command_opts and command_args).
Standard commands
asn1parse Parse an ASN.1 sequence.
env:var Obtain the password from the environment variable var. Since
the environment of other processes is visible on certain
platforms, you should use this option with caution.
file:pathname The first line of pathname is the password. If you supply the
same pathname argument to -passin and -passout
arguments, the first line is used for the input password, and the
next line for the output password. The pathname need not refer
to a regular file; it could, for example, refer to a device or named
pipe.
fd:number Read the password from the given file descriptor number. You
can use this, for example, to send the data via a pipe.
Exit status:
0 Success.
1 An error occurred.
Name:
/etc/party.conf
Description:
The party.conf is used to define the different parties you’ll be using for your
SNMPv2 communication.
Here’s the search order that’s used to find this file:
2 /etc/party.conf
FriendlyName PartyID
TDomain IP-address UDP-port
authProtocol privProtocol
lifetime maxmessagesize
clock
authPrivate authPublic-length authPublic
privPrivate privPublic-length privPublic
where:
For example:
agent_party .1.3.6.1.6.3.3.1.3.10.0.0.59.5
snmpUDPDomain 10.0.0.59 161
noAuth noPriv
300 484
29F660EA
00000000000000000000000000000000 Null
00000000000000000000000000000000 Null
Opening port(s):
See also:
snmpget, snmpgetnext, snmptest, snmptrapd, snmpwalk
Based on ISO IS 8824 (ASN.1), RFC 1065, RFC 1066, RFC 1067, RFC 1446
Syntax:
passwd [name]
Runs on:
Neutrino
Options:
name The username whose password is to be changed or for whom an account is
to be created (root only).
Description:
You can use the passwd utility to change your login password, and if you’re logged in
as the superuser (root), you can create a new user account.
This utility needs to have the setuid (“set user ID”) bit set in its permissions. If you use
mkefs, mketfs, or mkifs on a Windows host to include this utility in an image, use
the perms attribute to specify its permissions explicitly, and the uid and gid
attributes to set the ownership correctly.
If you’re changing your password, passwd prompts for the old password and then for
the new password. The new password must be entered twice, to avoid typing mistakes.
Only the owner or the superuser may change a password.
To create a new user account, type:
passwd new_user_name
Make sure that the user name is no longer than 14 characters; otherwise, that user
won’t be able to log in.
passwd file
When creating a new user account, passwd prompts for information, such as the
user’s group list, home directory, and shell. The /etc/default/passwd file (see
“Files,” below) specifies the default values for these prompts. You can edit this file to
modify passwd’s behavior to suit local requirements.
The /etc/passwd file contains the following fields, separated by colons:
username:has_passwd:userid:groupid:misc:home_directory:initial_command
If the has_passwd field contains an x character, a password has been defined for this
user. If no character is present, no password has been defined. Use of any other
character is reserved and may cause side-effects for the user.
The groupid field contains a group number. Users may log in under the groupid listed
in their /etc/passwd file entry without being listed as a member of that group in the
/etc/group file.
The misc field stores supplemental information, with commas separating subfields.
Usually, the first subfield contains the user’s “real life” name. Some utilities use this
information.
The initial_command field contains the initial command to run after the user has
successfully logged in. This command and any arguments it takes must be separated
by tab or space characters. As the command is spawned directly (not run by a shell),
no shell expansions is performed. There is no mechanism for specifying
command-line arguments that contain space or tab characters themselves. (Quoting
isn’t supported.)
If no initial_command is specified, /bin/sh is used.
Files:
/etc/.pwlock This file is created by passwd to indicate to other instances of
passwd that the password file is currently being modified. When
passwd finishes, the file is removed. See “Caveats,” below.
/etc/group This file defines the known groups for the system. It associates
group names with a numerical ID and a list of usernames who
are members of the group.
Entries in this file appear in the following format:
groupname:x:groupid:user[,user]...
/etc/passwd Contains the user account entries. The format of entries in this
file are as follows:
username:has_passwd:userid:groupid:misc:home_directory:initial_command
/etc/opasswd
/etc/oshadow When passwd modifies a password file, it first locks the
password files with the /etc/.pwlock file, then copies the
contents of the current /etc/passwd and /etc/shadow files to
/etc/opasswd and /etc/oshadow, respectively. If passwd is
killed before it finishes writing the updated file, the password
files may be restored from these backup versions. See “Caveats,”
below.
/etc/default/passwd
Specifies the settings that the passwd utility uses when you
create a new user account. If you’re the system administrator,
you can edit this file. The settings include the following, shown
with the value specified by default in this file:
Caveats:
The passwd utility creates the /etc/.pwlock file during updates to the password
database. If for some reason the system crashes at an inopportune moment and leaves
this file present, passwd will refuse to work until the file is removed by the system
administrator. If the password files are somehow left in an inconsistent state as a result
of the crash, the system administrator should also copy /etc/oshadow to
/etc/shadow and copy /etc/opasswd to /etc/passwd.
See also:
login, su
crypt(), qnx_crypt() in the Library Reference
Managing User Accounts in the Neutrino User’s Guide
Syntax:
paste [-s] [-d list] file
Runs on:
Neutrino
Options:
-d list Specifies that each character in the list is an element specifying a delimiter
character. Unless a backslash character appears in list, each character in list
is an element specifying a delimiter character. If a backslash character
appears in list, the backslash character and one or more characters
following it are an element specifying a special delimiter character,
described below. These elements specify one or more delimiters to use,
instead of the default tab, to replace the newline of the input lines. If the -s
option is also specified:
• The last <newline> in a file isn’t modified.
• The delimiter is reset to the first element of the list after each file
operand is processed.
If the -s option is not specified:
• The <newline>s in the file specified by the last file operand can’t be
modified.
• The delimiter is reset to the first element of the list each time a line is
processed from each file.
When a backslash character appears in list, the backslash character and the
other characters that follow it are used to represent these delimiter
characters:
• \n represents a <newline>
• \t represents a <tab>
• \\ represents a backslash character
• \0 represents an empty string, not a NULL character. If a lower case or
upper case “x” immediately follows \0, or any character defined by the
LC_CTYPE digit keyword, the results are unspecified. For more
information, see the Base Definitions volume of IEEE Std 1003.1-2001,
Chapter 7, Locale.
When the escape sequences of the list argument are used in a shell script, you must use
single quotation marks; otherwise, the shell interprets the backslash character as a
special character.
The input files must be text files.
-s Concatenates all lines of each separate input file in command line order.
Except for the last line in each input file, the <newline> of every line is
replaced with <tab>, unless otherwise specified by the -d option.
file The pathname of an input file. Specifying “-” for one or more of the files
uses the standard input, which is input read one line at a time for each
instance of “-”.
Description:
For every file you name, the paste utility pastes columns or fields from each line,
concatenates them, and writes them to the standard output.
By default, paste assumes the field delimiter character to be tab. You can use the -d
option to specify another delimiter.
Examples:
The following are examples of the list argument:
Exit status:
0 Successful completion.
See also:
cut, grep, pr
Syntax:
patch [option]... [origfile [patchfile]]
Runs on:
QNX Neutrino
Options:
Input options:
-p num
--strip= num Strip num leading components from file names.
-F lines
--fuzz lines Set the fuzz factor to lines for inexact matching.
-l
--ignore-whitespace
Ignore white space changes between the patch and the input.
-c
--context Interpret the patch as a context difference.
-e
--ed Interpret the patch as an ed script.
-n
--normal Interpret the patch as a normal difference.
-u
--unified Interpret the patch as a unified difference.
-N
--forward Ignore patches that appear to be reversed or already applied.
-R
--reverse Assume patches were created with old and new files swapped.
-i patchfile
--input=patchfile
Read the patch from patchfile instead of stdin.
Output options:
-o file
--output=file Output the patched files to file.
-r file
--reject-file=file
Output rejects to file.
-D name
--ifdef=name Make merged if-then-else output using name.
-E
--remove-empty-files
Remove output files that are empty after patching.
-Z
--set-utc Set the times of patched files, assuming diff uses UTC (GMT).
-T
--set-time Likewise, assuming local time.
--quoting-style=word
Output file names using quoting style word. The values for word
are: literal, shell, shell-always, c, and escape. The
default is taken from the QUOTING_STYLE environment
variable; if this variable isn’t set, patch uses shell.
-b
--backup Back up the original contents of each file.
--backup-if-mismatch
Back up if the patch doesn’t match exactly.
--no-backup-if-mismatch
Back up mismatches only if otherwise requested.
-V style
--version-control=style
Use style version control, where style is simple, numbered, or
existing.
-B prefix
--prefix=prefix Prepend prefix to the names of backup files.
-Y prefix
--basename-prefix=prefix
Prepend prefix to the base names of backup files.
-z suffix
--suffix=suffix Append suffix to the names of backup files.
-g num
--get=num Get files from RCS etc., if num is positive; ask if it’s negative.
Miscellaneous options:
-t
--batch Ask no questions; skip bad-Prereq patches; assume reversed.
-f
--force Like -t, but ignore bad-Prereq patches, and assume unreversed.
-s
--quiet
--silent Work silently unless an error occurs.
--dry-run Don’t actually change any files; just print what would happen.
-d dir
--directory=dir
Change the working directory to dir first.
--binary Read and write data in binary mode (no effect on this platform).
-v
--version Output version info.
Description:
The patch utility use the output from diff, diff3, and cmp to update a file.
Environment variables:
QUOTING_STYLE
The default quoting style. The possible values are: literal, shell,
shell-always, c, and escape. If QUOTING_STYLE isn’t set, patch uses
shell. You can override this variable by using the --quoting-style option.
Contributing author:
GNU
See also:
cmp, diff, diff3
Syntax:
List archive contents:
Read an archive:
Write an archive:
Copy files:
Runs on:
QNX Neutrino, Microsoft Windows
Options:
-a Append the files specified by pathname to the archive specified with
-f.
-b blocking Block the output at blocking bytes per write to the archive file. A k
suffix multiplies blocking by 1024, a b suffix multiplies blocking by
512, and an m suffix multiplies blocking by 1048576 (1 megabyte). If
not specified, blocking is automatically determined on input and is
ignored for -rw (copy files).
-f archive Use archive as the pathname of the input or output archive, overriding
the default of standard input for -r or standard output for -w.
-n When you specify -r, but not -w, treat the pattern operands as
ordinary filenames. Only the first occurrence of each of these files in
the input archive is read. The pax utility exits with an exit status of 0
after all files in the list have been read. If it can’t find one or more of
the files in the list, pax writes a diagnostic to standard error for each
of these files and exits with a nonzero exit status. The filenames are
compared before any of the -i, -s, or -y options are applied.
-p Preserve the access time of the input files after they have been copied.
-t device The device argument names the input or output archive device,
overriding the default of standard input for -r and standard output for
-w.
-u Copy each file only if it is newer than a preexisting file with the same
name.
-x format Use this output archive format. The input format is automatically
determined when you use the -r option. The supported formats are:
directory The destination directory pathname for copies when both the -r and
-w options are specified. The directory must exist and you must have
the appropriate write permissions, or an error results.
Modes of operation:
If you don’t specify -r or -w, then pax lists the contents of the specified archive. In
this mode, pax lists normal files one per line. Hard link pathnames are listed as:
pathname == linkname
where pathname is the name of the file being extracted, and linkname is the name of a
file that appeared earlier in the archive.
Symbolic link pathnames are listed as:
If you specify -v, then pax lists normal pathnames in the same format used by the ls
utility with the -l (“el”) option, except for hard links, which are shown as:
-r Read an archive file from the standard input; select for extraction only those
files whose names match any of the pattern operands. The selected files are
conditionally created and copied relative to the current directory tree, subject
to the options chosen. By default, the owner and group of selected files are
those of the invoking process, and the permissions and modification times are
the same as those in the archive.
The supported archive formats are automatically detected on input.
-w Write the files and directories specified by pathname operands to the standard
output, together with the pathname and status information prescribed by the
archive format used. The default output format is tar, but you can override
this by using the -x format option described below.
A directory pathname operand refers to the files and (recursively)
subdirectories of that directory. If no pathname operands are given, then the
standard input is read to get a list of pathnames to copy, one pathname per
line. In this case, only those pathnames appearing on the standard input are
copied.
-rw Read the files and directories named in the pathname operands and copy them
to the destination directory. A directory pathname operand refers to the files
and (recursively) subdirectories of that directory. If no pathname operands
are given, the standard input is read to get a list of pathnames to copy, one
pathname per line. In this case, only those pathnames appearing on the
standard input are copied. The directory named by the directory operand must
exist and must have the proper permissions before the copy can occur.
Description:
The pax utility reads and writes archive files that conform to the archive/interchange
file format specified in POSIX Std 1003.1-1988. The utility can also read, but not
write, a number of other file formats. Support for these traditional file formats (such as
V7 tar and System V binary cpio format archives) is provided for backward
compatibility and to maximize portability.
The pax utility also supports traditional cpio and System V tar interfaces if invoked
with those names (they’re links to pax).
The pax utility is capable of reading and writing archives that span multiple physical
volumes. Upon detecting an end of medium on an archive that isn’t yet completed,
pax prompts you for the next volume of the archive and lets you specify the location
of the next volume.
If the pax archive is stored directly in a floppy disk block special file (e.g.
/dev/fd0), the archive overwrites the first block of the disk, which the floppy driver,
devb-fdc, uses to store media-type information that lets it dynamically adjust to
diskettes of differing media capacity being inserted in the drive (e.g. 720k vs 1.4M,
360k vs 1.2M etc.). If the floppy driver can’t determine the capacity, it assumes 1.4M.
The user ID and group ID of the process, together with the appropriate privileges,
affect the ability of pax to restore ownership and permissions attributes of the archived
files. (See Archive/Interchange File Format in POSIX Std 1003.1-1988.)
Note that the options -a, -c, -d, -i, -l, -p, -t, and -y are provided for functional
compatibility with the historical cpio and tar utilities. The option defaults were
chosen based on the most common usage of these options, so some of the options have
meanings different from those of the historical commands.
Examples:
Copy the contents of the current directory to the floppy drive:
pax -w -f /dev/fd0 .
mkdir newdir
cd olddir
pax -rw . ../newdir
Read the archive pax.out with all files rooted in /usr in the archive extracted
relative to the current directory (note the use of commas as pattern separators for the
-s option):
Files:
The controlling terminal (/dev/tty) is used to prompt the user for information when
the -i or -y options are specified.
Exit status:
0 All files in the archive were processed successfully.
>0 The pax utility aborted due to errors encountered during operation.
Caveats:
Special permissions may be required to copy or extract special files.
Device, user ID, and group ID numbers larger than 65535 cause additional header
records to be output. These records are ignored by some historical versions of cpio
and tar.
The archive formats described in Archive/Interchange File Format have certain
restrictions that have been carried over from historical usage. For example, pathnames
stored in the archive can be no more than 255 characters in length.
When getting an ls -l style listing on tar format archives, link counts are listed as
zero since the ustar archive format doesn’t keep link count information.
On 16-bit architectures, including 16-bit versions of QNX 4., the largest buffer size is
32K-1. This is due, in part, to using integers in the buffer allocation schemes. On
many of these machines, however, it isn’t possible to allocate blocks of memory larger
than 32K.
See also:
bzip2, cp, cpio, find, gzip, tar
Backing Up and Recovering Data in the Neutrino User’s Guide
Syntax:
pccard-launch [-nv] ’type,command’...
Runs on:
Neutrino
Options:
-n Don’t lock the socket where the expected card is found.
’type,command’ For this PC Card type, spawn command. Types may be specified
in decimal (nnnn) or hexadecimal (0xnnn), and are followed by a
comma (,) and the command to execute. For example:
Description:
The pccard-launch utility automatically starts drivers and sets environment
variables describing the ports and IRQs used by a card, thus permitting a non-PC
Card-aware driver to be started automatically when a card is inserted, and stopped
when removed.
The environment variables may be named in the command lines for the drivers to be
run, thus allowing the port and IRQ information to be passed on the command line to
the drivers, most of which aren’t aware of the environment variables set by
pccard-launch.
This utility both starts driver when cards are plugged in and stops them via a
SIGTERM signal when cards are removed.
When a card is plugged in, pccard-launch checks the card type against the list of
card types/driver commands supplied to it on its command line. If it doesn’t know
about the card type, it does nothing. If it has been provided with a command for the
card type, it does the following:
• Sets up environment variables detailing I/O port locations, IRQ used, etc.
When the card is removed, pccard-launch unlocks the card and signals the
previously spawned process with SIGTERM.
You can determine the card type by using the pin command. A pin con command
displays configuration information for the PC Card. Look at the config line, which
should look something like:
where NN is the configuration number and TTTT is the type of the card. For example,
a modem card has a type of 0x200. This is the type that you must use on the
command line for pccard-launch.
Examples:
Automatically start the ne2000 driver with the appropriate I/O port and IRQ settings,
for PC Card type 0x600:
Files:
pccard-launch This utility is located in the /usr/sbin/ directory.
Environment variables:
The environment variables set by pccard-launch are:
See also:
devp-pccard, pin
Syntax:
pci [-n] [-v]
Runs on:
Neutrino
Options:
-n The maximum number of PCI buses to scan.
Description:
The pci utility displays Peripheral Component Interconnect devices. By default, it
displays only disk, network, and graphics devices. Use the -v (verbose) option to
display all PCI devices.
Examples:
Here’s some sample output from pci:
See also:
pci-bios
pci_attach(), pci_attach_device(), pci_detach(), pci_detach_device(),
pci_find_class(), pci_find_device(), pci_present(), pci_read_config(),
pci_read_config8(), pci_read_config16(), pci_read_config32(), pci_write_config(),
pci_write_config8(), pci_write_config16(), pci_write_config32() in the Library
Reference
Connecting Hardware in the Neutrino User’s Guide
Syntax:
For pci-bios:
pci-bios [-b buses] [-B] [-c] [-m] [-v] [-x] [-dbios bios_options]
Runs on:
Neutrino
Targets:
x86
Options:
-b buses The number of PCI buses to scan. The default is 10.
-B Force enumeration of bridges of type “OTHER”.
-c Ignore class code check.
-D (pci-bios-v2 only) Enable Message Signaled Interrupts (MSI)
and Extended MSI (MSI-X) for video.
-dbios bios_options
BIOS options, which include:
irqlist=irq1,irq2,. . .
Pass a list of IRQs to the BIOS. For example:
irqlist=5,7,9
Description:
The pci-bios server provides PCI BIOS support. You’ll have to provide it in your
boot image for systems with a PCI BIOS. Invoke seedres before starting pci-bios.
This server creates the /dev/pci device. Wait for it to appear by specifying the
following in the buildfile used by mkifs:
pci-bios
waitfor /dev/pci
If you’re using pci-bios-v2, you must name it pci-bios in order for the
enumerators to work correctly. In your buildfile, add pci-bios-v2 like this:
pci-bios=pci-bios-v2
See also:
seedres
pci_attach(), pci_attach_device(), pci_detach(), pci_detach_device(),
pci_find_class(), pci_find_device(), pci_present(), pci_read_config(),
pci_read_config8(), pci_read_config16(), pci_read_config32(), pci_write_config(),
pci_write_config8(), pci_write_config16(), pci_write_config32() in the Library
Reference
Controlling How Neutrino Starts in the Neutrino User’s Guide
Syntax:
pcnfsd
Runs on:
Neutrino
Options:
None.
Description:
The pcnfsd utility is used for authentication purposes by NFS clients in a PC
environment that has no concept of user/password identification (e.g. DOS).
There’s no direct check for root on the mount. The nfsd utility checks only that the
requests come from a privileged port (which implies root access). The check may be
disabled using the -norsvd option in the /etc/exports file.
If a configuration file is present ( /etc/pcnfsd.conf) pcnfsd uses the information
it contains to replace certain builtin elements.
See also:
/etc/exports, /etc/pcnfsd.conf, nfsd
Name:
/etc/pcnfsd.conf
Description:
The pcnfsd.conf file contains a range of acceptable user IDs. The pcnfsd utility
uses this file to authenticate users trying to log on. The default range is 101-60002.
The file is in the format:
keyword argument
Format rules:
For example:
To authenticate users with a uid between 100 and 200:
uidrange 100-200
uidrange 152
uidrange 5
uidrange 150-200
uidrange 500-600
See also:
pcnfsd
Syntax:
pdebug [-1eflsv] [-n priority_levels] device
Runs on:
Neutrino
Options:
-1 (“One”) Exit pdebug after the debugging session is done.
-v Be verbose;
device The device to use for the remote debug protocol; one of:
Description:
This utility provides access to process-level debugging from a remote host. To use
pdebug, you need to run devc-pty on the target machine (i.e. the machine being
debugged).
Examples:
For a 57600 baud serial connection on /dev/ser2:
See also:
devc-pty
“Debugging” in the Compiling & Debugging chapter of the Programmer’s Guide
Syntax:
ped [-adfr] [-c function] [-g line]
[-h height[%]] [-l locale] [-p filespec]
[-S i|m|n] [-s server] [-t space]
[-w width[%]] [-x position[%][r]]
[-y position[%][r]]
Runs on:
Neutrino
Options:
-a Save and load files with attributes (special fonts, bold, italic,
etc.).
-d Use the default locale list, which provides the following locales:
• ja_JP.euc
• ja_JP.sjis
• ja_JP.jis
• zh_CN.euc
• zh_CN.big5
• ko_KR.euc
• C
-l locale Use the given locale to encode and decode when loading and
saving files. The default is “C” for English and UTF-2.
Description:
The ped application is a simple editor designed to support Unicode (UTF-8) formatted
files only. It also provides simple search and replace capabilities.
The name and path of the file opened in the editor appear in the top window frame. At
the bottom of the window, the line and column indicators as well as the filename (no
path) appear.
CAUTION: Depending on the preferences you set, ped might append a block of text
! to the end of your files, which might upset any applications that read the files. With the
default preferences, ped doesn’t write this block. You can control this behavior by
choosing Preferences from the Edit menu and setting the options in the Styles &
Markers tab.
The font button in the top right corner indicates the current font of the text at the
cursor position. Clicking on this button is the same as selecting the Font option from
the Type menu (Ctrl-Alt-F). The colored rectangle beside the text field indicates the text
color at the current cursor position. Clicking on this rectangle is the same as selecting
the Color option from the Type menu (Ctrl-Alt-C).
You can use the following mouse shortcuts to select text:
You can use keyboard commands to select, copy, paste, and format text, as well as
select items from the menu.
Deletion commands
If you want to delete: Press:
The line Ctrl-U
To the end of the line Ctrl-K
The character to the right of the cursor Delete
position
The character to the left of the cursor Backspace
position
Selected text Any key that deletes or inserts text.
When you have text selected for deletion, any key that types or deletes text replaces
the selected text. The deleted text is moved to the clipboard until it’s replaced by the
next deletion or explicit clipboard loading operation.
Formatting commands
If text is selected, only the selected text is formatted. If no text is selected, begin to
format text when typed.
Centering commands
To align the text: Press: Description:
Left margin Alt-L Align the line of text that
the cursor is on to the left
margin.
Center Alt-C Center the line that the
cursor is on.
Right margin Alt-R Align the line of text that
the cursor is on to the
right margin.
Clipboard commands
If you want to: Press:
Copy selected text to the clipboard. Ctrl-C
Move selected text to the clipboard (and Ctrl-X or
delete the selected text). Ctrl-Alt-X
Delete the current line. Ctrl-U
Paste the clipboard text at the current Ctrl-V or
cursor position. Ctrl-Alt-V
When you’re in overwrite mode, each character you type gets saved to the clipboard.
Special commands
If you want to: Press: Description:
Invoke Helpviewer Ctrl-Alt-H Searches for the selected text in Helpviewer.
You can also open a file by dragging it from a pfm window and dropping it into ped.
Each dragged file is opened as a new buffer.
continued. . .
When the Find dialog is displayed, Enter finds the next occurrence when the search
field has focus. F2 repeats the search; the search window doesn’t have to be in focus or
even open.
When the Search and Replace dialog is displayed, Enter repeats the operation while
the Replace field has focus. F2 finds the next occurrence of the search string. F3
replaces the currently selected text, then finds and highlights the next instance of the
search string. Esc closes the Search window.
With the Defaults dialog, you can set the default for background color, text color, font,
tab size, text wrap, auto indent, and the file specification to use when bringing up
load/save dialogs.
In addition, there’s a control that dictates whether or not attribute information is
preserved when loading or saving files. (The attributes are saved in a C-style comment
at the end of the file if this option is enabled.) The attribute information is saved to
.ph/pedrc.
The background and text colors are applied (updated) immediately when a color is
selected so that you can see the change without leaving the dialog box.
The specified encoding is assumed on the file. When the file is loaded, it’s converted
to UTF-8. When the file is saved, it’s converted from UTF-8. (The editor works with
UTF-8 encoded Unicode text internally.)
If the current encoding selection of the editor doesn’t match a file being loaded, the
file will likely fail to load in its entirety. You’ll have to select a new translation and try
to load the file again. To translate a file from one encoding to another:
4 Save the file (translate from UTF-8 using the new translation during the save).
In the Font dialog, you can choose the font (typeface, style, and size) for the selected
range. The selected font is used to modify the selected text range. If there’s no
selected text range, the selected font is used for the next text entered. (The font buttons
indicate the typeface and style of the text that’s inserted whenever text is entered at the
current cursor location.)
In the Color dialog, you can choose the text color for the selected range. This dialog
lets you select a foreground color for the selected text range. If there’s no selected text
range, the selected color is used for the next text entered. (The color button always
indicates the color of text that’s to be inserted when text is entered at the current cursor
location.)
Examples:
Run ped using the Photon server on node my_node:
ped -s/net/my_node/dev/photon
Run ped at initial position (10,10) with initial dimension of 200×300:
ped -a -l ja_JP.sjis
Files:
${HOME}/.ph/pedrc
User’s configuration file.
See also:
ed, elvis, qed, vi
Using Editors in the Neutrino User’s Guide
Name:
/dev/pf
Description:
Packet filtering takes place in io-pkt. A pseudo-device, /dev/pf, lets user processes
control the behavior of the packet filter through an ioctl() interface. There are
commands to enable and disable the filter, load rule sets, add and remove individual
rules or state table entries, and retrieve statistics. The most commonly used functions
are covered by pfctl.
If you’re using QNX Neutrino 6.4.1 or earlier, you should use ioctl_socket() instead of
ioctl() in your packet-filtering code. With the microkernel message-passing
architecture, ioctl() calls that have pointers embedded in them need to be handled
specially. The ioctl_socket() function uses ioctl() for functionality that doesn’t require
special handling.
In QNX Neutrino 6.5.0 and later, ioctl() handles embedded pointers, so you don’t have
to use ioctl_socket() instead.
Manipulations such as loading a rule set that involve more than a single ioctl() call
require a ticket, which prevents the occurrence of multiple concurrent manipulations.
Fields of ioctl() parameter structures that refer to packet data (such as addresses and
ports) are generally expected in network-byte order.
Rules and address tables are contained in anchors. When servicing an ioctl() request,
if the anchor field of the argument structure is empty, io-pkt uses the default anchor
(i.e. the main rule set) in operations. Anchors are specified by name and may be
nested, with components separated by slashes, similar to the way that filesystem
hierarchies are laid out. The final component of the anchor path is the anchor under
which operations will be performed.
ioctl() interface
The pf pseudo-device supports the following ioctl() commands, available through
<net/pfvar.h>:
DIOCSTARTALTQ Start the ALTQ bandwidth control system (see altq in the
NetBSD documentation).
struct pfioc_qstats {
u_int32_t ticket;
u_int32_t nr;
void *buf;
int nbytes;
u_int8_t scheduler;
};
struct pfioc_ruleset {
u_int32_t nr;
char path[MAXPATHLEN];
char name[PF_ANCHOR_NAME_SIZE];
};
struct pfioc_state_kill {
sa_family_t psk_af;
int psk_proto;
struct pf_rule_addr psk_src;
struct pf_rule_addr psk_dst;
char psk_ifname[IFNAMSIZ];
};
struct pfioc_if {
char ifname[IFNAMSIZ];
};
struct pf_status {
u_int64_t counters[PFRES_MAX];
u_int64_t lcounters[LCNT_MAX];
u_int64_t fcounters[FCNT_MAX];
u_int64_t scounters[SCNT_MAX];
u_int64_t pcounters[2][2][3];
u_int64_t bcounters[2][2];
u_int64_t stateid;
u_int32_t running;
u_int32_t states;
u_int32_t src_nodes;
u_int32_t since;
u_int32_t debug;
u_int32_t hostid;
char ifname[IFNAMSIZ];
};
struct pfioc_natlook {
struct pf_addr saddr;
struct pf_addr daddr;
struct pf_addr rsaddr;
struct pf_addr rdaddr;
u_int16_t sport;
u_int16_t dport;
u_int16_t rsport;
u_int16_t rdport;
sa_family_t af;
u_int8_t proto;
u_int8_t direction;
};
struct pfioc_states {
int ps_len;
union {
caddr_t psu_buf;
struct pf_state *psu_states;
} ps_u;
#define ps_buf ps_u.psu_buf
#define ps_states ps_u.psu_states
};
struct pfioc_tm {
int timeout;
int seconds;
};
The old value is placed into seconds. For the possible values of
timeout, see the PFTM_* values in <net/pfvar.h>.
DIOCGETTIMEOUT struct pfioc_tm *pt
Get the state timeout of timeout. The value is placed into the
seconds field.
struct pfioc_limit {
int index;
unsigned limit;
};
struct pfioc_table {
struct pfr_table pfrio_table;
void *pfrio_buffer;
int pfrio_esize;
int pfrio_size;
int pfrio_size2;
int pfrio_nadd;
int pfrio_ndel;
int pfrio_nchange;
int pfrio_flags;
u_int32_t pfrio_ticket;
};
struct pfr_addr {
union {
struct in_addr _pfra_ip4addr;
struct in6_addr _pfra_ip6addr;
} pfra_u;
u_int8_t pfra_af;
u_int8_t pfra_net;
u_int8_t pfra_not;
u_int8_t pfra_fback;
};
#define pfra_ip4addr pfra_u._pfra_ip4addr
#define pfra_ip6addr pfra_u._pfra_ip6addr
struct pfr_astats {
struct pfr_addr pfras_a;
u_int64_t pfras_packets
[PFR_DIR_MAX][PFR_OP_ADDR_MAX];
u_int64_t pfras_bytes
[PFR_DIR_MAX][PFR_OP_ADDR_MAX];
long pfras_tzero;
};
You can delete tables if you remove the PFR_TFLAG_PERSIST flag of an unreferenced
table.
DIOCRINADEFINE struct pfioc_table *io
Define a table in the inactive set. On entry, pfrio_table contains
the table ID, and pfrio_buffer[pfrio_size] contains the list of
pfr_addr structures to put in the table. A valid ticket must also
be supplied to pfrio_ticket. On exit, pfrio_nadd contains 0 if
the table was already defined in the inactive list, or 1 if a new
table has been created. The pfrio_naddr member contains the
number of addresses effectively put in the table.
DIOCXBEGIN struct pfioc_trans *io
Clear all the inactive rule sets specified in the pfioc_trans_e
array. The pfioc_trans structure is defined as follows:
struct pfioc_trans {
int size; /* number of elements */
int esize; /* size of each element in bytes */
struct pfioc_trans_e {
int rs_num;
char anchor[MAXPATHLEN];
u_int32_t ticket;
} *array;
};
For each rule set, a ticket is returned for subsequent “add rule”
ioctl() commands, as well as for the DIOCXCOMMIT and
DIOCXROLLBACK calls.
Rule set types, identified by rs_num, include the following:
• PF_RULESET_SCRUB — scrub (packet normalization) rules.
struct pf_osfp_ioctl {
struct pf_osfp_entry {
SLIST_ENTRY(pf_osfp_entry) fp_entry;
pf_osfp_t fp_os;
char fp_class_nm[PF_OSFP_LEN];
char fp_version_nm[PF_OSFP_LEN];
char fp_subtype_nm[PF_OSFP_LEN];
} fp_os;
pf_tcpopts_t fp_tcpopts;
u_int16_t fp_wsize;
u_int16_t fp_psize;
u_int16_t fp_mss;
u_int16_t fp_flags;
u_int8_t fp_optcnt;
u_int8_t fp_wscale;
u_int8_t fp_ttl;
int fp_getnum;
};
You must zero the structure’s slack space for correct operation; memset() the whole
structure to zero before filling and sending it to io-pkt.
DIOCOSFPGET struct pf_osfp_ioctl *io
Get the passive OS fingerprint number fp_getnum from
io-pkt’s fingerprint list. The rest of the structure members
comes back filled. Get the whole list by repeatedly incrementing
the fp_getnum number until ioctl() gives an error of EBUSY.
DIOCGETSRCNODES struct pfioc_src_nodes *psn
Get the list of source nodes kept by sticky addresses and source
tracking. The pfioc_src_nodes structure is defined as
follows:
struct pfioc_src_nodes {
int psn_len;
union {
caddr_t psu_buf;
struct pf_src_node *psu_src_nodes;
} psn_u;
#define psn_buf psn_u.psu_buf
#define psn_src_nodes psn_u.psu_src_nodes
};
Examples:
The following example demonstrates how to use the DIOCNATLOOK command to find
the internal host/port of a NATed connection:
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/fcntl.h>
#include <net/if.h>
#include <netinet/in.h>
#include <net/pfvar.h>
#include <err.h>
#include <stdio.h>
#include <stdlib.h>
u_int32_t
read_address(const char *s)
{
int a, b, c, d;
void
print_address(u_int32_t a)
{
a = ntohl(a);
printf("%d.%d.%d.%d", a >> 24 & 255, a >> 16 & 255,
a >> 8 & 255, a & 255);
}
int
main(int argc, char *argv[])
{
struct pfioc_natlook nl;
int dev;
if (argc != 5) {
printf("%s <gwy addr> <gwy port> <ext addr> <ext port>\n",
argv[0]);
return 1;
}
printf(":%u\n", ntohs(nl.rsport));
return 0;
}
Caveats:
The following functionality is missing from pf in this version of NetBSD:
See also:
pfctl
ioctl() in the Neutrino Library Reference
altq, bridge, pflog in the NetBSD documentation at
http://www.netbsd.org/docs/
Name:
/etc/pf.conf
Description:
The pf packet filter modifies, drops or passes packets according to rules or definitions
specified in pf.conf. The default location of this file is /etc/pf.conf.
Statement order
The pf.conf file can include the following types of statements:
Packet Filtering Stateful and stateless packet filtering provides rule-based blocking
or passing of packets.
With the exception of macros and tables, the types of statements should be grouped
and appear in pf.conf in the order shown above, as this matches the operation of the
underlying packet filtering engine. By default, pfctl enforces this order (see set
require-order below).
Macros
Much as for cpp or m4, you can define macros that will later be expanded in context.
Macro names must start with a letter, and may contain letters, digits and underscores.
Macro names may not be reserved words (for example, pass, in, out). Macros aren’t
expanded inside quotes.
For example:
ext_if = "kue0"
all_ifs = "{" $ext_if lo0 "}"
pass out on $ext_if from any to any keep state
pass in on $ext_if proto tcp from any to any port 25 keep state
Tables
Tables are named structures that can hold a collection of addresses and networks.
Lookups against tables in pf are relatively fast, making a single rule with tables much
more efficient, in terms of processor usage and memory consumption, than a large
number of rules that differ only in IP address (either created explicitly or automatically
by rule expansion).
You can use tables as the source or destination of filter rules, scrub rules or translation
rules such as nat or rdr (see below for details on the various rule types) You can also
use tables for the redirect address of nat and rdr rules and in the routing options of
filter rules, but only for round-robin pools.
You can define tables with any of the following pfctl mechanisms. As with macros,
reserved words may not be used as table names.
Manually Persistent tables can be manually created with the add or replace
option of pfctl, before or after the rule set has been loaded.
Via pf.conf Table definitions can be placed directly in this file, and loaded at the
same time as other rules are loaded, atomically. Table definitions
inside pf.conf use the table statement, and are especially useful to
define non-persistent tables. The contents of a pre-existing table
defined without a list of addresses to initialize it isn’t altered when
pf.conf is loaded. A table initialized with the empty list, { }, is
cleared on loading.
persist Force io-pkt to keep the table even when no rules refer to it. If the flag
isn’t set, io-pkt automatically removes the table when the last rule
referring to it is flushed.
const Prevent the user from altering the contents of the table once it’s been
created. Without this flag, you can use pfctl to add or remove
addresses from the table at any time, even when running with
securelevel = 2.
For example:
creates a table called private, to hold RFC 1918 private network blocks, and a table
called badhosts, which is initially empty. A filter rule is set up to block all traffic
coming from addresses listed in either table.
The private table can’t have its contents changed, and the badhosts table will exist
even when no active filter rules refer to it. Addresses may later be added to the
badhosts table, so that traffic from these hosts can be blocked by using:
A table can also be initialized with an address list specified in one or more external
files, using the following syntax:
table <spam> persist file "/etc/spammers" file "/etc/openrelays"
block on fxp0 from <spam> to any
The files /etc/spammers and /etc/openrelays list IP addresses, one per line.
Any lines beginning with a # are treated as comments and ignored. In addition to
being specified by IP address, hosts may also be specified by their hostname. When
the resolver is called to add a hostname to a table, all resulting IPv4 and IPv6
addresses are placed into the table. IP addresses can also be entered in a table by
specifying a valid interface name or the self keyword, in which case all addresses
assigned to the interface(s) are added to the table.
Options
You can tune pf for various situations by using the set command:
With 9000 state table entries, the timeout values are scaled to 50%
(tcp.first 60, tcp.established 43200).
set loginterface
Enable the collection of packet and byte count statistics for the given
interface. To view these statistics, use:
pfctl -s info
set limit Set hard limits on the memory pools used by the packet filter. For
example:
sets the maximum number of entries in the memory pool used by state
table entries (generated by keep state rules) to 20000. This command:
sets the maximum number of entries in the memory pool used for
fragment reassembly (generated by scrub rules) to 20000. This
command:
sets the maximum number of entries in the memory pool used for
tracking source IP addresses (generated by the sticky-address and
source-track options) to 2000.
You can combine them:
set limit { states 20000, frags 20000, src-nodes 2000 }
set optimization
Optimize the engine for one of the following network environments:
• normal — a normal network environment. Suitable for almost all
networks.
• high-latency — a high-latency environment (such as a satellite
connection).
• satellite — alias for high-latency.
set block-policy
Set the default behavior for the packet block action:
• drop — the packet is silently dropped.
• return — a TCP RST is returned for blocked TCP packets, an
ICMP UNREACHABLE is returned for blocked UDP packets,
and all other packets are silently dropped.
For example:
set state-policy
Set the default behavior for states:
• if-bound — states are bound to interface.
• group-bound — states are bound to interface group (e.g. ppp).
• floating — states can match packets on any interfaces (the
default).
For example:
set require-order
By default, pfctl enforces an ordering of the statement types in the
rule set to: options, normalization, queueing, translation, and
filtering. Setting this option to no disables this enforcement.
Setting this option may leave a small period of time where the
fingerprints referenced by the currently active rule set are inconsistent
until the new rule set finishes loading.
Traffic normalization
Traffic normalization is used to sanitize packet content in such a way that there are no
ambiguities in packet interpretation on the receiving side. The normalizer does IP
fragment reassembly to prevent attacks that confuse intrusion detection systems by
sending overlapping IP fragments. Packet normalization is invoked with the scrub
directive, which has the following options:
fragment reassemble
Using scrub rules, fragments can be reassembled by
normalization. In this case, fragments are buffered until they
form a complete packet, and only the completed packet is
passed on to the filter. The advantage is that filter rules have to
deal only with complete packets, and can ignore fragments. The
drawback of caching fragments is the additional memory cost.
But the full reassembly method is the only method that
currently works with NAT. This is the default behavior of a
scrub rule if no fragmentation modifier is supplied.
For example:
The no option prefixed to a scrub rule causes matching packets to remain unscrubbed,
much in the same way as drop quick works in the packet filter (see below). This
mechanism should be used when it is necessary to exclude specific packets from
broader scrub rules.
Queueing
Packets can be assigned to queues for the purpose of bandwidth control. At least two
declarations are required to configure queues, and later any packet filtering rule can
reference the defined queues by name. During the filtering component of pf.conf,
the last referenced queue name is where any packets from pass rules will be queued,
while for block rules it specifies where any resulting ICMP or TCP RST packets
should be queued. The scheduler defines the algorithm used to decide which packets
get delayed, dropped, or sent out immediately.
The currently supported schedulers are:
cbq Class Based Queueing. Queues attached to an interface build a tree, and thus
each queue can have further child queues. Each queue can have a priority
and a bandwidth assigned. Priority mainly controls the time packets take to
get sent out, while bandwidth has primarily effects on throughput.
The cbq scheduler achieves both partitioning and sharing of link bandwidth
by hierarchically structured classes. Each class has its own queue and is
assigned its share of bandwidth. A child class can borrow bandwidth from
its parent class, as long as excess bandwidth is available (see the option
borrow, below).
priq Priority Queueing. Queues are flat attached to the interface, and thus queues
can’t have further child queues. Each queue has a unique priority assigned,
ranging from 0 to 15. Packets in the queue with the highest priority are
processed first.
hfsc Hierarchical Fair Service Curve. Queues attached to an interface build a tree,
and thus each queue can have further child queues. Each queue can have a
priority and a bandwidth assigned. Priority mainly controls the time packets
take to get sent out, while bandwidth has primarily effects on throughput.
The hfsc scheduler supports both link-sharing and guaranteed realtime
services. It employs a service-curve-based QoS model, and its unique
feature is an ability to decouple delay and bandwidth allocation.
The interfaces on which queueing should be activated are declared using the altq on
declaration, which has the following keywords:
bandwidth bw The maximum bit rate for all queues on an interface. You can
specify the value as an absolute value or as a percentage of the
interface bandwidth. When using an absolute value, you can use
the suffixes b, Kb, Mb, and Gb to represent bits, kilobits, megabits,
and gigabits per second, respectively. The value mustn’t exceed
the interface bandwidth. If you don’t specify bandwidth, the
interface bandwidth is used.
qlimit limit The maximum number of packets held in the queue. The default
is 50.
tbrsize size Adjust the size, in bytes, of the token bucket regulator. If not
specified, heuristics based on the interface bandwidth are used to
determine the size.
Translation
Translation rules modify either the source or destination address of the packets
associated with a stateful connection. A stateful connection is automatically created to
track packets matching such a rule as long as they aren’t blocked by the filtering
section of pf.conf. The translation engine modifies the specified address and/or port
in the packet, recalculates IP, TCP and UDP checksums as necessary, and passes it to
the packet filter for evaluation.
Since translation occurs before filtering the filter engine will see packets as they look
after any addresses and ports have been translated. Filter rules will therefore have to
filter based on the translated address and port number. Packets that match a translation
rule are automatically passed only if the pass modifier is given; otherwise they’re still
subject to block and pass rules.
The state entry created permits pf to keep track of the original address for traffic
associated with that state and correctly direct return traffic for that connection.
Various types of translation are possible with pf:
nat Specifies that IP addresses are to be changed as the packet traverses the
given interface. This technique allows one or more IP addresses on the
translating host to support network traffic for a larger range of machines on
an “inside” network. Although in theory any IP address can be used on the
inside, it is strongly recommended that one of the address ranges defined
by RFC 1918 be used. These netblocks are:
• 10.0.0.0–10.255.255.255 (all of net 10, i.e. 10/8)
• 172.16.0.0–172.31.255.255 (i.e., 172.16/12)
• 192.168.0.0–192.168.255.255 (i.e., 192.168/16)
In addition to modifying the address, some translation rules may modify source or
destination ports for TCP or UDP connections; implicitly in the case of nat rules and
explicitly in the case of rdr rules. Port numbers are never translated with a binat
rule.
For each packet processed by the translator, the translation rules are evaluated in
sequential order, from first to last. The first matching rule decides what action is taken.
The no option prefixed to a translation rule causes packets to remain untranslated,
much in the same way as drop quick works in the packet filter (see below). If no
rule matches the packet, the packet is passed to the filter engine unmodified.
Translation rules apply only to packets that pass through the specified interface, and if
no interface is specified, translation is applied to packets on all interfaces. For
instance, redirecting port 80 on an external interface to an internal web server works
only for connections originating from the outside. Connections to the address of the
external interface from local hosts aren’t redirected, since such packets don’t actually
pass through the external interface. Redirections can’t reflect packets back through the
interface they arrive on; they can only be redirected to hosts connected to different
interfaces or to the firewall itself.
Note that redirecting external incoming connections to the loopback address, as in:
rdr on ne3 inet proto tcp to port 8025 -> 127.0.0.1 port 25
effectively allows an external host to connect to daemons bound solely to the loopback
address, circumventing the traditional blocking of such connections on a real interface.
Unless this effect is desired, any of the local non-loopback addresses should be used as
redirection target instead, which allows external connections only to daemons bound
to this address or not bound to any address.
See “Translation examples,” below.
Packet filtering
The pf pseudo-device can block and pass packets based on attributes of their layer-3
(see IP and IPv6 in the Neutrino Library Reference) and layer-4 (see ICMP, ICMP6,
TCP, and UDP) headers. In addition, packets may also be assigned to queues for the
purpose of bandwidth control.
For each packet processed by the packet filter, the filter rules are evaluated in
sequential order, from first to last. The last matching rule decides what action is taken.
You can use the following actions in the filter:
block Block the packet. There are a number of ways in which a block rule can
behave when blocking a packet. The default behavior is to drop packets
silently, however you can override this or make it explicit either globally,
by setting the block-policy option, or on a per-rule basis with one of the
following options:
• drop — silently drop the packet.
• return-rst — this applies only to TCP packets, and issues a TCP
RST that closes the connection.
• return-icmp, return-icmp6 — cause ICMP messages to be
returned for packets that match the rule. By default, this is an ICMP
UNREACHABLE message, however you can override this by
specifying a message as a code or number.
• return — cause a TCP RST to be returned for TCP packets and an
ICMP UNREACHABLE for UDP and other packets.
Options returning ICMP packets currently have no effect if pf operates on
a bridge, as the code to support this feature hasn’t yet been implemented.
If no rule matches the packet, the default action is to pass it. To block everything by
default and pass only packets that match explicit rules, use:
block all
Parameters
The rule parameters specify the packets to which a rule applies. A packet always
comes in on, or goes out through, one interface. Most parameters are optional. If a
parameter is specified, the rule applies only to packets with matching attributes.
Certain parameters can be expressed as lists, in which case pfctl generates all
needed rule combinations.
quick If a packet matches a rule that has the quick option set, this rule
is considered the last matching rule, and evaluation of subsequent
rules is skipped.
on interface This rule applies only to packets coming in on, or going out
through, this particular interface. It’s also possible to simply give
the interface driver name, such as ppp or fxp, to make the rule
match packets flowing through a group of interfaces.
proto protocol This rule applies only to packets of this protocol. Common
protocols are ICMP, ICMP6, TCP, and UDP. For a list of all the
protocol name-to-number mappings used by pfctl, see the file
/etc/protocols.
(or host name) changes (under DHCP or PPP, for instance), the
rule set must be reloaded for the change to be reflected in io-pkt.
Surrounding the interface name (and optional modifiers) in
parentheses changes this behavior: the rule is automatically
updated whenever the interface changes its address. The rule set
doesn’t need to be reloaded. This is especially useful with nat.
You can specify ports either by number or by name. For example,
port 80 can be specified as www. For a list of all port
name-to-number mappings used by pfctl, see the file
/etc/services.
You can use these operators to specify ports and ranges of ports:
Operator Meaning
= Equal to
!= Unequal to
< Less than
<= Less than or equal to
> Greater than
>= Greater than or equal to
: Range, including boundaries
>< Range, excluding boundaries
<> Except range
The ><, <> and : operators are binary; they take two arguments.
For instance:
This: Means:
port 2000:2004 All ports ≥ 2000 and ≤ 2004; hence ports
2000, 2001, 2002, 2003 and 2004
port 2000 >< 2004 All ports > 2000 and < 2004; hence ports
2001, 2002 and 2003
port 2000 <> 2004 All ports < 2000 or > 2004; hence ports
1-1999 and 2005-65535
pass in all
pass in from any to any
pass in proto tcp from any port <= 1024 to any
pass in proto tcp from any to any port 25
pass in proto tcp from 10.0.0.0/8 port > 1024 \
to ! 10.1.2.3 port != ssh
pass in proto tcp from any os "OpenBSD" flags S/SA
pass in proto tcp from route "DTAG"
flags a/b | /b This rule applies only to TCP packets that have the flags a set out
of set b. Flags not specified in b are ignored. The flags are: (F)IN,
(S)YN, (R)ST, (P)USH, (A)CK, (U)RG, (E)CE, and C(W)R. For
example:
This: Means:
flags S/S Flag SYN is set. The other flags are ignored.
flags S/SA Out of SYN and ACK, exactly SYN may be set.
SYN, SYN+PSH and SYN+RST match, but
SYN+ACK, ACK and ACK+RST don’t. This is
more restrictive than the previous example.
flags /SFRA If the first set isn’t specified, it defaults to none.
All of SYN, FIN, RST and ACK must be unset.
allow-opts By default, packets that contain IP options are blocked. When you
specify allow-opts for a pass rule, packets that pass the filter
based on that rule (last matching) do so even if they contain IP
options. For packets that match a state, the rule that initially
created the state is used. The implicit pass rule that’s used when
a packet doesn’t match any rules doesn’t allow IP options.
label string Add a label (name) to the rule, which you can use to identify the
rule. For instance, pfctl -s labels shows per-rule statistics
for rules that have labels.
You can use the following macros in labels:
Macro Meaning
$if The interface
$srcaddr The source IP address
$dstaddr The destination IP address
$srcport The source port specification
$dstport The destination port specification
$proto The protocol name
$nr The rule number
For example:
ips = "{ 1.2.3.4, 1.2.3.5 }"
pass in proto tcp from any to $ips \
port > 1023 label "$dstaddr:$dstport"
expands to:
pass in inet proto tcp from any to 1.2.3.4 \
port > 1023 label "1.2.3.4:>1023"
pass in inet proto tcp from any to 1.2.3.5 \
port > 1023 label "1.2.3.5:>1023"
The macro expansion for the label directive occurs only when the
configuration file is parsed, not during runtime.
queue queue | (queue, queue)
Packets matching this rule are assigned to the specified queue. If
you specify two queues, packets that have a TOS of lowdelay
and TCP ACKs with no data payload are assigned to the second
one. See “Queueing,” for setup details. For example:
pass in proto tcp to port 25 queue mail
pass in proto tcp to port 22 queue(ssh_bulk, ssh_prio)
tag string Packets matching this rule are tagged with the specified string.
The tag acts as an internal marker that can be used to identify
these packets later on. You can use this, for example, to provide
trust between interfaces and to determine if packets have been
processed by translation rules.
Tags are “sticky”, meaning that the packet is tagged even if the
rule isn’t the last matching rule. Further matching rules can
replace the tag with a new one, but don’t remove a previously
applied tag. A packet is only ever assigned one tag at a time. Any
pass rules that use the tag keyword must also use keep state,
modulate state or synproxy state.
You can tag packets during nat, rdr, or binat rules in addition
to filter rules. Tags take the same macros as labels (see above).
tagged string Used with filter or translation rules to specify that packets must
already be tagged with the given tag in order to match the rule.
You can also do inverse tag matching by specifying the ! operator
before the tagged keyword.
probability number
A probability attribute can be attached to a rule, with a value set
between 0 and 1, bounds not included. In that case, the rule is
honored using the given probability value only. For example, the
following rule drops 20% of incoming ICMP packets:
Routing
If a packet matches a rule with a route option set, the packet filter routes the packet
according to the type of route option. When such a rule creates state, the route option
is also applied to all packets matching the same connection.
fastroute Do a normal route lookup to find the next hop for the packet.
route-to Route the packet to the specified interface with an optional address
for the next hop. When a route-to rule creates state, only packets
that pass in the same direction as the filter rule specifies are routed in
this way. Packets passing in the opposite direction (replies) aren’t
affected and are routed normally.
reply-to Similar to route-to, but routes packets that pass in the opposite
direction (replies) to the specified interface. Opposite direction is
defined only in the context of a state entry, and reply-to is useful
only in rules that create state. You can use it on systems with multiple
external connections to route all outgoing packets of a connection
through the interface the incoming connection arrived through
(symmetric routing enforcement).
dup-to Create a duplicate of the packet and route it like route-to. The
original packet gets routed as it normally would.
Pool options
For nat and rdr rules, (as well as for the route-to, reply-to and dup-to rule
options) for which there is a single redirection address that has a subnet mask smaller
than 32 for IPv4 or 128 for IPv6 (more than one IP address), you can use a variety of
different methods for assigning this address:
bitmask Apply the network portion of the redirection address to the address
to be modified (source with nat, destination with rdr).
static-port With nat rules, prevent pf from modifying the source port on
TCP and UDP packets.
Additionally, you can specify the sticky-address option to help ensure that
multiple connections from the same source are mapped to the same redirection
address. You can use this option with the random and round-robin pool options.
Note that by default, these associations are destroyed as soon as there are no longer
states that refer to them; in order to make the mappings last beyond the lifetime of the
states, increase the global options with set timeout source-track. See “Stateful
tracking options” for more ways to control the source tracking.
Stateful inspection
The pf packet filter is stateful, which means it can track the state of a connection.
Instead of passing all traffic to port 25, for instance, it’s possible to pass only the initial
packet, and then begin to keep state. Subsequent traffic will flow because the filter is
aware of the connection.
If a packet matches a pass ... keep state rule, the filter creates a state for this
connection and automatically lets pass all subsequent packets of that connection.
Before any rules are evaluated, the filter checks whether the packet matches any state.
If it does, the packet is passed without evaluation of any rules.
States are removed after the connection is closed or has timed out.
This has several advantages:
• Looking up states is usually faster than evaluating rules. If there are 50 rules, all of
them are evaluated sequentially in O(n). Even with 50000 states, only 16
comparisons are needed to match a state, since states are stored in a binary search
tree that allows searches in O(log2 n).
For instance:
block all
pass out proto tcp from any to any flags S/SA keep state
pass in proto tcp from any to any port 25 flags S/SA keep state
This rule set blocks everything by default. Only outgoing connections and incoming
connections to port 25 are allowed. The initial packet of each connection has the SYN
flag set, will be passed and creates state. All further packets of these connections are
passed if they match a state.
By default, packets coming in and out of any interface can match a state, but it’s also
possible to change that behavior by assigning states to a single interface or a group of
interfaces.
The default policy is specified by the state-policy global option, but you can adjust this
on a per-rule basis by adding one of the if-bound, group-bound, or floating
keywords to the keep state option. For example, if a rule is defined as:
a state created on ppp0 would match packets an all PPP interfaces, but not packets
flowing through fxp0 or any other interface.
Keeping rules floating is the more flexible option when the firewall is in a dynamic
routing environment. However, this has some security implications, since a state
created by one trusted network could allow potentially hostile packets coming in from
other interfaces.
Specifying flags S/SA restricts state creation to the initial SYN packet of the TCP
handshake. You can also be less restrictive, and allow state creation from intermediate
(non-SYN) packets. This causes pf to synchronize to existing connections, for
instance if you flush the state table.
For UDP, which is stateless by nature, keep state creates state as well. UDP
packets are matched to states using only host addresses and ports.
ICMP messages fall into two categories: ICMP error messages, which always refer to
a TCP or UDP packet, are matched against the referred to connection. If you keep
state on a TCP connection, and an ICMP source quench message referring to this TCP
connection arrives, it will be matched to the right state and get passed.
For ICMP queries, keep state creates an ICMP state, and pf knows how to match
ICMP replies to states. For example:
pass out inet proto icmp all icmp-type echoreq keep state
allows echo requests (such as those created by ping) out, creates state, and matches
incoming echo replies correctly to states.
The nat, binat, and rdr rules implicitly create state for connections.
State modulation
Much of the security derived from TCP is attributable to how well the initial sequence
numbers (ISNs) are chosen. Some popular stack implementations choose very poor
ISNs, and thus are normally susceptible to ISN prediction exploits. By applying a
modulate state rule to a TCP connection, pf creates a high-quality random sequence
number for each connection endpoint.
The modulate state directive implicitly keeps state on the rule and is applicable
only to TCP connections. For instance:
block all
pass out proto tcp from any to any modulate state
pass in proto tcp from any to any port 25 flags S/SA modulate state
• The other caveat affects currently modulated states when the state table is lost
(firewall reboot, flushing the state table, etc...). The pf packet filter can’t infer a
connection again after the state table flushes the connection’s modulator. When the
state is lost, the connection may be left dangling until the respective endpoints time
out the connection. It’s possible on a fast local network for the endpoints to start an
ACK storm while trying to resynchronize after the loss of the modulator. Using a
flags S/SA modifier on modulate state rules between fast networks is
suggested to prevent ACK storms.
SYN proxy
By default, pf passes packets that are part of a TCP handshake between the endpoints.
You can use the synproxy state option to cause pf itself to complete the
handshake with the active endpoint, perform a handshake with the passive endpoint,
and then forward packets between the endpoints.
No packets are sent to the passive endpoint before the active endpoint has completed
the handshake, hence so-called SYN floods with spoofed source addresses will not
reach the passive endpoint, as the sender can’t complete the handshake.
The proxy is transparent to both endpoints, they each see a single connection from/to
the other endpoint. The pf packet filter chooses random initial sequence numbers for
both handshakes. Once the handshakes are completed, the sequence number
modulators (see previous section) are used to translate further packets of the
connection. Hence, synproxy state includes modulate state and keep state.
max number Limit the number of concurrent states the rule may create. When
this limit is reached, further packets matching the rule that would
create state are dropped, until existing states time out.
timeout seconds Change the timeout values used for states created by this rule. For
a list of all valid timeout names, see “Options,” above.
If you specify the source-track keyword, the number of states per source IP is
tracked:
source-track rule
The maximum number of states created by this rule is limited by the rule’s
max-src-nodes and max-src-state options. Only state entries created by
this particular rule count toward the rule’s limits.
source-track global
The number of states created by all rules that use this option is limited. Each
rule can specify different max-src-nodes and max-src-states options,
however state entries created by any participating rule count towards each
individual rule’s limits.
max-src-nodes number
Limit the maximum number of source addresses that can simultaneously have
state table entries.
max-src-states number
Limit the maximum number of simultaneous state entries that a single source
address can create with this rule.
For stateful TCP connections, limits on established connections (those that have
completed the TCP 3-way handshake) can also be enforced per source IP.
max-src-conn number
Limit the maximum number of simultaneous TCP connections that have
completed the 3-way handshake that a single host can make.
Because the 3-way handshake ensures that the source address isn’t being spoofed,
more aggressive action can be taken based on these limits. With the overload table
state option, source IP addresses that hit either of the limits on established connections
will be added to the named table. You can use this table in the rule set to block further
activity from the offending host, redirect it to a tarpit process, or restrict its bandwidth.
The optional flush keyword kills all states created by the matching rule that originate
from the host that exceeds these limits. The global modifier to the flush command
kills all states originating from the offending host, regardless of which rule created the
state.
For example, the following rules protect the web server against hosts making more
than 100 connections in 10 seconds. Any host that connects faster than this rate will
have its address added to the bad_hosts table and have all states originating from it
flushed. Any new packets arriving from this host will be dropped unconditionally by
the block rule.
"OpenBSD 2.6"
The subtype of an operating system is typically used to describe the patchlevel if that
patch led to changes in the TCP stack behavior. In the case of OpenBSD, the only
subtype is for a fingerprint that was normalized by the no-df scrub option and would
be specified as:
Fingerprints for most popular operating systems are provided by /etc/pf.os. Once
pf is running, you can get a complete list of known operating system finger listed by
running:
# pfctl -so
Filter rules can enforce policy at any level of operating system specification assuming
a fingerprint is present. Policy could limit traffic to approved operating systems or
even ban traffic from hosts that aren’t at the latest service pack.
You can also use the unknown class as the fingerprint that matches packets for which
no operating system fingerprint is known.
Examples:
pass out proto tcp from any os OpenBSD keep state
block out proto tcp from any os Doors
block out proto tcp from any os "Doors PT"
block out proto tcp from any os "Doors PT SP3"
block out from any os "unknown"
pass on lo0 proto tcp from any os "OpenBSD 3.3 lo0" keep state
Operating system fingerprinting is limited only to the TCP SYN packet. This means
that it doesn’t work on other protocols and doesn’t match a currently established
connection.
Operating system fingerprints are occasionally wrong. There are several problems:
• an attacker can trivially craft his packets to appear as any operating system he
chooses
• an operating system patch could change the stack behavior, and no fingerprints will
match it until the database is updated
expands to:
block drop in on ! lo0 inet from 127.0.0.1/8 to any
block drop in on ! lo0 inet6 from ::1 to any
For non-loopback interfaces, there are additional rules to block incoming packets with
a source IP address identical to the interface’s IP(s). For example, assuming the
interface wi0 has an IP address of 10.0.0.1 and a netmask of 255.255.255.0, the
line:
expands to:
block drop in on ! wi0 inet from 10.0.0.0/24 to any
block drop in inet from 10.0.0.1 to any
Rules created by the antispoof directive interfere with packets sent over loopback
interfaces to local addresses. You should pass these explicitly.
Fragment handling
The size of IP datagrams (packets) can be significantly larger than the maximum
transmission unit (MTU) of the network. In cases when it is necessary or more
efficient to send such large packets, the large packet will be fragmented into many
smaller packets that will each fit onto the wire. Unfortunately for a firewalling device,
only the first logical fragment will contain the necessary header information for the
subprotocol that allows pf to filter on things such as TCP ports or to perform NAT.
Besides the use of scrub rules as described in “Traffic normalization” above, there are
three options for handling fragments in the packet filter.
One alternative is to filter individual fragments with filter rules. If no scrub rule
applies to a fragment, it’s passed to the filter. Filter rules with matching IP header
parameters decide whether the fragment is passed or blocked, in the same way as
complete packets are filtered. Without reassembly, fragments can be filtered based
only on IP header fields (source/destination address, protocol), since subprotocol
header fields aren’t available (TCP/UDP port numbers, ICMP code/type). You can use
the fragment option to restrict filter rules to apply only to fragments, but not
complete packets. Filter rules without the fragment option still apply to fragments, if
they only specify IP header fields. For instance, the rule:
pass in proto tcp from any to any port 80
never applies to a fragment, even if the fragment is part of a TCP packet with
destination port 80, because without reassembly this information isn’t available for
each fragment. This also means that fragments can’t create new or match existing state
table entries, which makes stateful filtering and address translation (NAT, redirection)
for fragments impossible.
It’s also possible to reassemble only certain fragments by specifying source or
destination addresses or protocols as parameters in scrub rules.
In most cases, the benefits of reassembly outweigh the additional memory cost, and
it’s recommended you use scrub rules to reassemble all fragments via the fragment
reassemble modifier.
You can limit the memory allocated for fragment caching by using pfctl. Once this
limit is reached, fragments that would have to be cached are dropped until other
entries time out. You can also adjust the timeout value.
Currently, only IPv4 fragments are supported, and IPv6 fragments are blocked
unconditionally.
Anchors
Besides the main rule set, pfctl can load rule sets into anchor attachment points. An
anchor is a container that can hold rules, address tables, and other anchors.
An anchor has a name that specifies the path where you can use pfctl to access the
anchor to perform operations on it, such as attaching child anchors to it or loading
rules into it. Anchors may be nested, with components separated by slashes (/),
similar to how file system hierarchies are laid out. The main rule set is actually the
default anchor, so filter and translation rules, for example, may also be contained in
any anchor.
An anchor can reference another anchor attachment point using the following kinds of
rules:
nat-anchor name
Evaluate the nat rules in the specified anchor.
rdr-anchor name
Evaluate the rdr rules in the specified anchor.
binat-anchor name
Evaluate the binat rules in the specified anchor.
When evaluation of the main rule set reaches an anchor rule, pf evaluates all rules
specified in that anchor.
Matching filter and translation rules in anchors with the quick option are final and
abort the evaluation of the rules in other anchors and the main rule set.
Anchor rules are evaluated relative to the anchor in which they are contained. For
example, all anchor rules specified in the main rule set reference anchor attachment
points underneath the main rule set, and anchor rules specified in a file loaded from a
load anchor rule are attached under that anchor point.
Rules may be contained in anchor attachment points that don’t contain any rules when
the main rule set is loaded, and later such anchors can be manipulated through pfctl
without reloading the main rule set or other anchors. For example:
ext_if = "kue0"
block on $ext_if all
anchor spam
pass out on $ext_if all keep state
pass in on $ext_if proto tcp from any \
to $ext_if port smtp keep state
blocks all packets on the external interface by default, then evaluates all rules in the
anchor named spam, and finally passes all outgoing connections and incoming
connections to port 25.
The following command loads a single rule into the anchor, which blocks all packets
from a specific address:
The anchor can also be populated by adding a load anchor rule after the anchor
rule:
anchor spam
load anchor spam from "/etc/pf-spam.conf"
When pfctl loads pf.conf, it also loads all the rules from the file
/etc/pf-spam.conf into the anchor.
Optionally, anchor rules can specify the parameter’s direction, interface, address
family, protocol and source/destination address/port using the same syntax as filter
rules. When parameters are used, the anchor rule is evaluated only for matching
packets. This allows conditional evaluation of anchors, like:
The rules inside the anchor spam are evaluated only for TCP packets with destination
port 25. Hence:
anchor "spam/*"
evaluates each rule in each anchor attached to the spam anchor. Note that it evaluates
only anchors that are directly attached to the spam anchor, and doesn’t descend to
evaluate anchors recursively.
Since anchors are evaluated relative to the anchor in which they are contained, there’s
a mechanism for accessing the parent and ancestor anchors of a given anchor. Similar
to file system path name resolution, if the sequence .. appears as an anchor path
component, the parent anchor of the current anchor in the path evaluation at that point
becomes the new current anchor. As an example, consider the following:
Evaluation of the main rule set leads into the spam/allowed anchor, which evaluates
the rules in the spam/banned anchor, if any, before finally evaluating the pass rule.
Since the parser specification for anchor names is a string, any reference to an anchor
name containing slash (/) characters requires double quote (") characters around the
anchor name.
Translation examples
This example maps incoming requests on port 80 to port 8080, on which a daemon is
running (because, for example, it isn’t run as root, and therefore lacks permission to
bind to port 80):
If the pass modifier is given, packets matching the translation rule are passed without
inspecting the filter rules:
rdr pass on $ext_if proto tcp from any to any port 80 -> 127.0.0.1 \
port 8080
In the example below, the machine sits between a fake internal 144.19.74.*
network, and a routable external IP of 204.92.77.100. The no nat rule excludes
protocol AH from being translated:
# NO NAT
no nat on $ext_if proto ah from 144.19.74.0/24 to any
nat on $ext_if from 144.19.74.0/24 to any -> 204.92.77.100
In the example below, packets bound for one specific server, as well as those generated
by the system administrators aren’t proxied; all other connections are:
# NO RDR
no rdr on $int_if proto { tcp, udp } from any to $server port 80
no rdr on $int_if proto { tcp, udp } from $sysadmins to any port 80
rdr on $int_if proto { tcp, udp } from any to any port 80 -> 127.0.0.1 \
port 80
This longer example uses both a NAT and a redirection. The external interface has the
address 157.161.48.183. On the internal interface, we are running ftp-proxy,
listening for outbound ftp sessions captured to port 8021:
# NAT
# Translate outgoing packets’ source addresses (any protocol).
# In this case, any address but the gateway’s external address is mapped.
nat on $ext_if inet from ! ($ext_if) to any -> ($ext_if)
# NAT PROXYING
# Map outgoing packets’ source port to an assigned proxy port instead of
# an arbitrary port.
# In this case, proxy outgoing isakmp with port 500 on the gateway.
nat on $ext_if inet proto udp from any port = isakmp to any -> ($ext_if) \
port 500
# BINAT
# Translate outgoing packets’ source address (any protocol).
# Translate incoming packets’ destination address to an internal machine
# (bidirectional).
binat on $ext_if from 10.1.2.150 to any -> $ext_if
# RDR
# Translate incoming packets’ destination addresses.
# As an example, redirect a TCP and UDP port to an internal machine.
rdr on $ext_if inet proto tcp from any to ($ext_if) port 8080 \
-> 10.1.2.151 port 22
rdr on $ext_if inet proto udp from any to ($ext_if) port 8080 \
-> 10.1.2.151 port 53
# RDR
# Translate outgoing ftp control connections to send them to localhost
# for proxying with ftp-proxy(8) running on port 8021.
rdr on $int_if proto tcp from any to any port 21 -> 127.0.0.1 port 8021
In this example, a NAT gateway is set up to translate internal addresses using a pool of
public addresses (192.0.2.16/28) and to redirect incoming web server connections
to a group of web servers on the internal network:
Filter examples
# The external interface is kue0
# (157.161.48.183, the only routable address)
# and the private network is 10.0.0.0/8, for which we are doing NAT.
# block and log outgoing packets that don’t have our address as source,
# they are either spoofed or something is misconfigured (NAT disabled,
# for instance), we want to be nice and don’t send out garbage.
block out log quick on $ext_if from ! 157.161.48.183 to any
# block and log incoming packets from reserved address space and invalid
# addresses, they are either spoofed or misconfigured, we can’t reply to
# them anyway (hence, no return-rst).
block in log quick on $ext_if from { 10.0.0.0/8, 172.16.0.0/12, \
192.168.0.0/16, 255.255.255.255/32 } to any
# ICMP
# UDP
# TCP
# pass in certain TCP connections and keep state (SSH, SMTP, DNS, IDENT)
pass in on $ext_if proto tcp from any to any port { ssh, smtp, domain, \
auth } flags S/SA keep state
# Packet Tagging
Grammar
The syntax for pf.conf in BNF is as follows:
line = ( option | pf-rule | nat-rule | binat-rule | rdr-rule |
antispoof-rule | altq-rule | queue-rule | anchor-rule |
trans-anchors | load-anchors | table-rule )
hosts = "all" |
"from" ( "any" | "no-route" | "self" | host |
"{" host-list "}" | "route" string ) [ port ] [ os ]
"to" ( "any" | "no-route" | "self" | host |
"{" host-list "}" | "route" string ) [ port ]
os-name = operating-system-name
os-list = os-name [ [ "," ] os-list ]
Associated files
/etc/hosts Host name database.
/usr/share/examples/pf
Examples of rule sets.
See also:
/etc/hosts, pf, /etc/pf.os, pfctl, /etc/protocols, route,
/etc/services
ICMP, ICMP6, IP, IP6, ROUTE, TCP, UDP in the Neutrino Library Reference
bridge, ftp-proxy, pcap, pflog, pflogd in the NetBSD documentation at
http://www.netbsd.org/docs/
Syntax:
pfctl [-AdeghmNnOoqRrvz] [-a anchor] [-D macro=value]
[-F modifier ] [-f file] [-i interface] [-k host]
[-p device] [-s modifier]
[-t table -T command [address ...]] [-x level]
Runs on:
Neutrino
Options:
-A Load only the queue rules present in the rule file. Other rules and
options are ignored.
-a anchor Apply the -f, -F, and -s options only to the rules in the
specified anchor. In addition to the main rule set, pfctl can load
and manipulate additional rule sets by name, called anchors. The
main rule set is the default anchor.
Anchors are referenced by name and may be nested, with the
various components of the anchor path separated by slashes (/),
similar to how file system hierarchies are laid out. The last
component of the anchor path is where rule-set operations are
performed.
Evaluation of anchor rules from the main rule set is described in
the documentation for pf.conf.
Private tables can also be put inside anchors, either by having
table statements in the pf.conf file that is loaded in the anchor,
or by using regular table commands, as in:
-F modifier Flush the filter parameters specified by modifier (which you can
abbreviate):
• nat — flush the NAT rules.
• queue — flush the queue rules.
• rules — flush the filter rules.
• state — flush the state table (NAT and filter).
• Sources — flush the source tracking table.
• info — flush the filter information (statistics that aren’t
bound to rules).
• Tables — flush the tables.
• osfp — flush the passive operating system fingerprints.
• all — flush all of the above.
-f file Load the rules contained in the specified file. This file may
contain macros, tables, options, and normalization, queueing,
translation, and filtering rules. With the exception of macros and
tables, the statements must appear in that order.
Specify - for the file to use standard input.
-k host Kill all of the state entries originating from the specified host.
You can specify a second -k option, which will kill all the state
entries from the first host to the second host. For example, to kill
all of the state entries originating from host:
# pfctl -k host
-N Load only the NAT rules present in the rule file. Other rules and
options are ignored.
The rule-set optimizer modifies the rule set to improve performance. A side effect of
the ruleset modification is that per-rule accounting statistics will have different
meanings than before. If per-rule accounting is important (e.g. for billing purposes),
either you shouldn’t use the rule-set optimizer, or you should add a label field to all of
the accounting rules to act as optimization barriers.
-p device Use the device file device instead of the default, /dev/pf.
-q Print only errors and warnings.
-R Load only the filter rules present in the rule file. Other rules and
options are ignored.
-r Perform reverse DNS lookups on states when displaying them.
-s modifier Show the filter parameters specified by modifier (which you can
abbreviate):
• nat — show the currently loaded NAT rules.
• queue — show the currently loaded queue rules. When used
together with -v, pfctl also shows per-queue statistics.
When used together with -v -v, pfctl loops and shows
updated queue statistics every five seconds, including
measured bandwidth and packets per second.
• rules — show the currently loaded filter rules. When used
together with -v, pfctl also shows the per-rule statistics
(number of evaluations, packets and bytes).
Note that the skip step optimization done automatically by
io-pkt skips the evaluation of rules where possible. Packets
passed statefully are counted in the rule that created the state
(even though the rule isn’t evaluated more than once for the
entire connection).
For the add, delete, replace, and test commands, you can
specify the list of addresses either directly on the command line
and/or in an unformatted text file, using the -f flag. Comments
starting with a # are allowed in the text file. With these
commands, you can also use the -v option once or twice, in
which case pfctl prints the detailed result of the operation for
each individual address, prefixed by one of the following letters:
• A — the address/network has been added.
• C — the address/network has been changed (negated).
• D — the address/network has been deleted.
• M — the address matches (test operation only).
• X — the address/network is duplicated and therefore ignored.
• Y — the address/network can’t be added/deleted due to
conflicting ! attributes.
• Z — the address/network has been cleared (statistics).
Each table maintains a set of counters that you can retrieve using
the -v option. For example, the following commands define a
wide-open firewall that keeps track of packets going to or coming
from the OpenBSD FTP server. The following commands
configure the firewall and send 10 pings to the FTP server:
# printf "table <test> { ftp.NetBSD.org }\n \
pass out to <test> keep state\n" | pfctl -f-
# ping -qc10 ftp.NetBSD.org
We can now use the table show command to output, for each
address and packet direction, the number of packets and bytes
that are being passed or blocked by rules referencing the table.
The time at which the current accounting started is also shown
with the Cleared line:
# pfctl -t test -vTshow
129.128.5.191
Cleared: Thu Feb 13 18:55:18 2003
In/Block: [ Packets: 0 Bytes: 0 ]
In/Pass: [ Packets: 10 Bytes: 840 ]
Out/Block: [ Packets: 0 Bytes: 0 ]
Out/Pass: [ Packets: 10 Bytes: 840 ]
-x level Set the debugging level to one of the following (which you can
abbreviate):
• none — don’t generate debug messages.
• urgent — generate debug messages only for serious errors.
• misc — generate debug messages for various errors.
• loud — generate debug messages for common conditions.
Description:
The pfctl utility communicates with the packet filter device using the ioctl() or
ioctl_socket() interface described in pf. It lets you configure rule sets and parameters
and retrieve status information from the packet filter.
Packet filtering restricts the types of packets that pass through network interfaces
entering or leaving the host based on filter rules as described in pf.conf. The packet
filter can also replace addresses and ports of packets. Replacing source addresses and
ports of outgoing packets is called NAT (Network Address Translation) and is used to
connect an internal network (usually reserved address space) to an external one (the
Internet) by making all connections to external hosts appear to come from the gateway.
Replacing destination addresses and ports of incoming packets is used to redirect
connections to different hosts and/or ports. A combination of both translations,
bidirectional NAT, is also supported. Translation rules are described in the
documentation for pf.conf.
The packet filter doesn’t itself forward packets between interfaces. Forwarding can be
enabled by setting the sysctl variables net.inet.ip.forwarding and/or
net.inet6.ip6.forwarding to 1. Set them permanently in /etc/sysctl.conf.
Files:
/etc/pf.conf Packet filter rules file.
See also:
pf, /etc/pf.conf, /etc/pf.os, sysctl
ftp-proxy in the NetBSD documentation at http://www.netbsd.org/docs/
Syntax:
pfm [-h height[%]] [-S i|m|n] [-s server]
[-w width[%]] [-x position[%][r]] [-y position[%][r]]
Runs on:
Neutrino
Options:
-h height[%] The height of the window, in pixels, or as a percentage of the
screen height if % is specified.
Description:
The pfm utility starts a graphical file manager that lets you browse directories and
files, create and edit files, and so on.
The Photon file manager represents files and folders graphically. Double-click on a
folder to open it and display its contents. Double-click on a file to open it in an
associated application (if an association exists). The file manager also supports
drag-and-drop operations — for example, you can drag a file to a folder to move it
there. You can right-click on a file or folder to view a shortcut menu, which contains a
subset of the commands that are listed below.
You can quickly jump to an item in a long list by typing in the first few letters of the
file or directory name.
* You can view or edit only file types that are associated with an application. Use the
Edit→Associations command to add or change file-type associations.
continued. . .
Navigating
Setting Description
Filelist Options These settings allow you to show or hide
system files that begin with a period (“dot”
files), and list folders before files regardless of
alphabetical order.
Filename Encoding These settings specify how pfm displays
non-UTF8 encoded file names.
Filelist Font and Hotlist Font These settings specify the font, style, and size
to use in the file list and the bookmarks
(hotlist).
KeyFind Timeout This setting specifies the maximum time in
milliseconds between keystrokes before the
find by typing feature resets itself. Set to 0 to
disable reset.
Copy/Move Overwrite and Delete These settings configure whether pfm prompts
you before copying, moving, or deleting files.
Examples:
Run PFM using Photon server on node my_node:
pfm -s/net/my_node/dev/photon
See also:
“Browsing files with the File Manager” in the Using the Photon microGUI chapter of
the Neutrino User’s Guide
Syntax:
ph [-cNsvx] [-n name]
Runs on:
Neutrino
Options:
-c Open a terminal “dittoed” to the console.
-N Don’t explicitly load shared libraries; let the applications load them as
required.
-n name Use the device name to start Photon (defaults to /dev/photon). Use
this option if you must run more than one Photon window system on a
single node.
-s Safe mode. Use this option if Photon doesn’t display correctly on start
up. This option forces Photon to start in 16-color VGA mode.
-v Be verbose.
Description:
The ph utility is a shell script that starts the Photon window system. The script starts
the following, as required:
• inputtrap to detect the input hardware and start the input manager (see below)
If you’ve defined the PHGFX and PHINPUT environment variables, ph uses their
values to start graphics/input drivers.
Examples:
Start Photon:
ph
Files:
${HOME}/.ph/phapps
Contains a user’s list of applications for Photon to launch automatically when it
starts. This file must be executable.
/etc/system/config/nophoton
If this file exists, the system doesn’t boot into Photon. The file’s contents aren’t
important; you can just touch the file to create it.
Environment variables:
The ph command sets or uses these environment variables:
PHEXIT_DISABLE
Turn off phlogin’s Exit button.
PHFONT Set the registered name of the font server (e.g. /dev/phfont).
PHGFX The full command that you want to use instead of the default
commands to start the graphics driver.
For example, on an Aspen/Tahoe board, you could specify:
export PHGFX="io-graphics \
-amode=/usr/photon/config/q2sd.conf \
-dldevg-q2sd.so -g640x480x16"
PHINPUT The full command that you want to use instead of the default
commands to start the input driver.
See also:
inputtrap, phlogin, Photon, pwm
Using the Photon microGUI and Configuring Your Environment in the Neutrino
User’s Guide
Syntax:
phablang [options]
Runs on:
QNX Neutrino, Microsoft Windows
Options:
-h height[%] The height of the window, in pixels, or as a percentage of the
screen height if % is specified.
Description:
The phablang command starts the PhAB language editor. It’s used to translate PhAB
applications into other languages. For more information, see the International
Language Support chapter of the Photon Programmer’s Guide.
Files:
/usr/photon/appbuilder/languages.def
The currently defined set of language codes.
Environment variables:
ABLPATH A list of directories in which an application looks for its translations.
See also:
International Language Support chapter of the Photon Programmer’s Guide
Syntax:
phabmsg [filename] [-h height[%]] [--Si|m|n]
[-s server_name] [-w width[%]] [-x position[%][r]]
[-y position[%][r]]
Runs on:
Neutrino
Options:
filename The path and name of a message database to open.
Description:
The phabmsg utility starts a graphical Photon editor for managing message databases.
Message databases are convenient places to keep strings for one or more applications,
and they provide multi-language support for PhAB applications. You must be running
Photon in order to run phabmsg.
1 Select File→New.
2 Add items by adding a tag, description, and value, then clicking Insert item.
You can add multiple-value items by toggling between Multi and Single.
To change an existing database, use File→Open to open the database, then select
items, change the contents, and click Modify current.
Once a message database is populated with values, you can use the PhAB translation
editor to create translate the database into different languages. You can launch the
PhAB translation editor phablang for the current message database open in phabmsg
by selecting File→Launch Translation Editor.
For more information, see the International Language Support chapter of the Photon
Programmer’s Guide.
Examples:
Run phabmsg using the Photon server on node my_node:
phabmsg -s/net/my_node/dev/photon
phabmsg /tmp/all.mdb
See also:
ApLoadMessageDB(), ApCloseMessageDB(), ApGetMessage(), phablang, the
International Language Support chapter of the Photon Programmer’s Guide.
Syntax:
phcalc [-s server] [-x position[%][r]]
[-y position[%][r]]
Runs on:
Neutrino
Options:
-s server_name The name of the Photon server:
Description:
This utility starts a graphical calculator. You must be running Photon in order to run
phcalc.
Examples:
Run phcalc using the Photon server on node my_node:
phcalc -s/net/my_node/dev/photon
Syntax:
phdialer options
Runs on:
Neutrino
Options:
-a If possible, begin dialing immediately.
-n dialup_name Make the dialup with the given name the current one.
Description:
The phdialer command starts Photon’s modem dialer (for example, so you can
access your ISP):
The phdialer is meant to be simple and small. You can change only the bare
minimum of dialup settings in its base window — just enough so you get a dialup
started. If data has been entered it and the Save changes box is checked, phdialer
asks you for a name to save the dialup as. If you cancel, the changes are lost. All
dialups in your dialup directory are listed in the combobox at the top.
The phlip, command gives you access to all information about a dialup. When you
click on Edit in phdialer, it spawns phlip and makes the dialup that was current
come up.
In addition to the system device and network settings, phlip has a dialup tab that lists
the user’s dialup configurations. There’s one panel and one configuration file per
dialup. These usually reside in the ${HOME}/.ph/dialups directory. You can copy
these files from one user’s dialup directory to another, but the password isn’t be
preserved and the new user must enter it again (even root).
If you’re not root when you run phlip, the network and device panels contain
read-only information. You can make changes only to your dialups.
See also:
/etc/autoconnect, phlip, pppd
TCP/IP Networking in the Neutrino User’s Guide
Syntax:
phditto [-b baud] [-H time1[,time2][,time3]]
[-h height] [-i igrp] [-k]
[-M kbytes[,Mbytes]] [-m modem]
[-N number] [-n path[+]] [-o options]
[-p path]
[-s service] [-t ipaddr[:port]]
[-U userid[:password]] [-u] [-V[V]...]
[-w width] [-X offset] [-x offset]
[-Y offset] [-y offset] [host]
Runs on:
Neutrino
Options:
-b baud Specify the effective baud rate of the communication link. The
default is the current baud rate of the communication link.
-H time1 [,time2] [,time3]
Mouse holdoff times (in tenths of a second):
• time1 — normal mouse motion.
• time2 — motion with button press.
• time3 — motion with a drag cursor.
Default times are scaled, based on baud rate, yielding 1.2, 0.6,
and 0.3 seconds at 9600 baud. The default mouse holdoff is
disabled at baud rates above 115,200.
-h height The height of the window, in pixels. The default is 480 pixels.
-M kbytes [,Mbytes]
Specify RAM cache (and optionally the disk cache) limits. The
default is 4096,20, which corresponds to a 4M cache and a 20M
disk cache.
-m modem Specify the name of the QNX serial device to use for remote
connect.
-n path[+] View and interact with Photon in the specified path, e.g. -n
/dev/photon. To create a new private Photon session on a
QNX4 host, end path with +, e.g. -n//3+.
-o options Options:
• 0 — no compression.
• 1 — BPE (Byte-Pair Encoding) compression.
• 2 — RLL (Run Length Limited) compression.
• 8 — Use CRC (Cyclic Redundancy Check) error checking.
Combine options by addition, e.g. to specify BPE and CRC,
select 9. If the selected baud rate requires it, compression will be
automatically selected unless you specify 0.
-p path Use the path for the disk cache. If not specified, the default is
/usr/photon. If you don’t have permission to write to this
location caching is disabled.
-U userid[:password]
Login as this user (with optional password) when using services.
The default is $LOGNAME.
-w width The width of the window, in pixels. The default is 640 pixels.
-X offset Specify the initial x offset in the local Photon event space.
-Y offset Specify the initial y offset in the local Photon event space.
Description:
The phditto utility lets you view and interact with another Photon workspace in a
network. When you “ditto” the remote node, both you and the remote user can share
the same workspace.
You can end the phditto session by selecting Close from phditto’s window menu
(click the right mouse button on the phditto label in the Taskbar).
exec /usr/bin/phrelay
The phditto program will then synchronize with the remote phrelay program and
start to function as a Photon graphics terminal.
Examples:
Run an encapsulated Photon session (Photon within Photon) on the local machine:
phditto localhost
Start a private pfm service on host:
phditto -Spfm -t host
Connect through the modem on /dev/ser2 to a remote QNX box. Once logged into
QNX, type exec /usr/bin/phrelay:
phditto -m/dev/ser2
Connect via the Internet to an IP port on a remote QNX machine where a remote
Photon session will be automatically started:
phditto -t198.53.31.1:4869
Connect to a remote QNX machine and run an encapsulated PhAB session as user
joe:
phditto -t198.53.31.1 -sphab -Ujoe:password
Caveats:
1 To create a new private Photon session on a remote node, you must specify one
of -m, -t, or host because native QNX messaging is not currently implemented
as a transport mechanism.
You can use Qnet to connect to an existing Photon session on a remote node.
For example:
phditto -tlocalhost -n/net/remotehost/dev/photon
See also:
phrelay, phrelaycfg
Using the Photon microGUI in the Neutrino User’s Guide
Syntax:
phfind [options]
Runs on:
Neutrino
Options:
-c Case-sensitive pattern match. The default is case-insensitive.
-t options The types of files to look for. Combine one or more of:
• a — all (the default setting)
• b — block special
• c — character special
• d — directories
• f — regular files
• l — symbolic links
• n — named special
• p — FIFOs (pipes)
• s — sockets
Description:
This utility starts a graphical file search application. You must be running Photon in
order to run phfind.
The phfind utility can find and display a maximum of 65535 files.
The application has three tabs, Name & Location, Types, and Sizes:
• The Name & Location tab lets you enter a file name, select the search path, and set
basic search options.
• The Types tab lets you set a filter for the types of files phfind looks for. For a
description of the types of files in a QNX filesystem, see “Working with files” in
the Neutrino User Guide.
• The Sizes tab lets you set a filesize range for files found by phfind.
See also:
find, pfm
Using the Photon microGUI in the Neutrino User’s Guide
Syntax:
phfont [-A] [-b file]
[-C[-]SANSERIF|SERIF|DECORATIVE=description[;description2[;...]]]
[-D directory]
[-d directory] [-E rule]
[-F types] [-e file] [-I] [-i file]
[-K[-]FONDRY|AFTERFOUNDRYKEYS|KEYS=key[;key2[;...]]]
[-L] [-l list]
[-mPHF|PFR|TTF=newname[=realname][;newname2=[realname2][;...]]]
[-N number]
[-O[-]keyword[;[-]keyword2[;...]]]
[-n name] [-s directory]
[-U family] [-u file]
[-X] [-Z alignment]
Runs on:
Neutrino
Options:
-A Force all text bitmaps to be anti-aliased wherever possible. Only
scalable fonts can be anti-aliased.
-b file Save font usage information to the specified file when phfont
exits.
-C[-]SANSERIF|SERIF|DECORATIVE=description[;description2[;...]]
Manage the font classification list. Font classification lists are used
to return correct information to the user’s application when fonts
(such as PHF fonts) don’t contain classification information in
them.
This option is used to add or remove a description to or from a font
class. Use the - preceding the font class name to remove
descriptions. This option could be used more than once on the
command-line.
-d directory Specify the font directory. All configuration files and font files are
assumed to be in this directory. The default is
/usr/photon/font_repository.
-E rule Specify the extension/dropout rule to use. The fontext file may
contain a number of different extension rules (e.g. language rules
that search the Chinese, Japanese, or Korean character set) of which
only one is active. By default, the first “+” rule in the fontext file
is used.
-e file Specify the font extension/dropout file. This file contains rules that
extend a base output character set to include multiple font files (e.g.
to add special symbols or languages other than English). The
default file is fontext.
-F types Print the defaults for the specified types and exit, where types is a
string containing one or more of:
• C — font classes
• K — font keys
• O — oriental keywords
• m — font mappings
-I Use strict international mapping rules.
-i file Specify the font index file. This file contains header information of
every known/usable font in the system and allows the font server to
quickly perform font mappings and character dropouts without
accessing the disk. The default file is fontdir.
-K[-]FONDRY|AFTERFOUNDRYKEYS|KEYS=key[;key2[;...]]
Font Keys are removed from the font description from the specific
location within description.
If - is used, the specified keys are removed from the specified key
location. This option could be used more than once.
-L Deny local metrics loading.
-l list Specify a list of fonts to preload and lock into cache. You can use
this to ensure fast access to common fonts. The list is formatted as a
comma-separated list of font names. For example:
helv10,phcursor,cour10b,swissi
Default is none.
-M Disable the display of missing-character symbols. By default,
whenever a character is rendered for which no definition can be
found, the font server displays an empty rectangle.
-mPHF|PFR|TTF=newname[=realname][;newname2=[realname2][;...]]
For internal use only. Entries in this file override the descriptive
name (for example, Helvetica) for a particular font stem (helv).
This option adds a new mapping to the specified font type list. If
realname is not provided, this newname is removed from the
specified font type list. This option can be used more than once on
the command-line.
-N number Specify the number of times the font manager tries to attach a
device before exiting.
Default is 15.
-n name Specify the name to register the font server with. By default the
value of the PHFONT environment variable is used; if this isn’t set,
the prefix /dev/phfont is used.
-O[-]keyword[;[-]keyword2[;...]]
Manage oriental keywords. Keywords used to identify Asian
(Oriental) font foundry names, and are used to optimize the
extension system.
If a keyword starts with a -, this keyword is removed from the list,
otherwise it is added to the list. This option can be used more than
once on the command-line.
-U family Specify the font family to use for unknown fonts. Whenever a
named font doesn’t exist and can’t be resolved by explicit mapping
entries, this default font family is used. By default the ? entry in the
fontmap file is used.
-u file Specify the unknown font-mapping table file. This file creates font
synonyms (or virtual fonts) and configuration rules for augmenting
bitmap fonts with scalable fonts. The default file is fontmap.
-X Prevent the font server from terminating after the last client
disconnects. The default is for the font server to exit once all clients
have terminated.
-Z alignment Set the bitmap alignment to 8, 32, or 64 bit. This is used in DLL
mode only. See PfSetOptionsDll().
You can pass options through the -F option to io-graphics when you aren’t running
an external font server. The format is slightly different, based on the getsubopt()
format. For example:
Description:
The phfont utility provides all font services to Photon applications and drivers. This
includes the calculation of text extents and metrics and the generation of bitmaps
representing character strings. It also maintains a central cache of font metric and
bitmap data. The configuration files used by phfont are described in Files below.
When phfont is being initialized, it pre-processes the command line to find out which
configuration directory to use, then it tries to load the $HOME/.ph/font/fontopts
file. If this file doesn’t exist, it tries to load the config_dir/fontopts file. It tries
to load the [io-font] and then it tries to load the [io-font-server] sections.
The options from the loaded sections are combined with the options from the
command line and then processed, with the options in the command line taking higher
precedence in the case of conflicts. The options in the [io-font] section of the
fontopts file are used by all applications that load phfont.so. When using
PfAttachLocalDll, the option name is used to try to load the
[io-font-option_name] section from the fontopts file too.
This utility needs to have the setuid (“set user ID”) bit set in its permissions. If you use
mkefs, mketfs, or mkifs on a Windows host to include this utility in an image, use
the perms attribute to specify its permissions explicitly, and the uid and gid
attributes to set the ownership correctly.
The phfont utility loads the phfont.so DLL to provide font rendering services. The
phfont.so loads DLLs located in /lib/dll/font which provide rendering
services for specific font types, such as PHF, TTF, TTC, PFR, Stroke, etc.
If a particular type of rendering is not desired, you can remove the specific dll. To
determine which services are provided by each DLL, use the use dll_name command,
which displays the usage message for that particular DLL. If an external font server is
not started, io-graphics attempts to invoke a font server instance.
The phfont server can run as a stand alone process (we refer to this as an external
server) or as a plugin to io-graphics (which we call an internal server). We
recommend you run an external server in these conditions:
To run an external font server, start phfont before io-graphics. To run an internal
font server, simply start io-graphics.
Examples:
Start the server:
Files:
The rendering DLLs used by the font server are located in /lib/dll/font/*.so.
These files support rendering for at least these font types:
• TrueType
• TrueType collections
• Photon Bitmap
• Bitstream Stroke
• Bitstream Speedo
• Bitstream T2K
• Adobe Type1
• Adobe Type2
Use the use command to view the font types supported by a DLL.
Other files used by phfont include:
These files were used by previous versions of phfont, but are now deprecated:
• font-traplist
• fontdynamic
• fontopt
• fontpreferred
fontdir
Directory of known fonts — required. Each entry in this file contains information such
as the name and type of the font, its size and style, a textual description of the font
family, and the range of characters defined within the font. To be available to an
application, at least one font must be defined in this configuration file. Entries in this
file are static, they can’t be loaded dynamically.
Each line in this file contains the following comma-separated fields, in this order, for
each known font:
• stem name
• font type/location — for phf files, this is simply the string to add to the stem name
to get the filename containing the font. For others, this is in the form index@filename,
where index is the index into the font contained in filename. This value is always 0.
fontext
A set of extension rules to handle character dropouts (missing characters) — required.
The format of this file is as follows:
Where type is the font type (normal, bold, etc.) and fontname is the font name to
search for symbols.
fontmap
A set of mapping rules — required. There are two types:
In this mapping rule, newfont doesn’t exist, but realfont does. If you try to use
newfont as a font name, it’s mapped to realfont.
The following special-case entry is a default mapping for any unknown font name:
? = realfont
For example, if geneva = helv, then the font geneva12 is translated to helv12.
• Scaling entries, that have the form:
font = {when}scalefont
In this mapping rule, both font and scalefont must exist. When there isn’t an exact
PHF file for font, then a scaled version of scalefont is made according to the when
character used:
For example, if the files helv08.phf, helv10.phf, and helv12.phf are present
and swiss is a scalable font, the following translations are made:
In all cases, the fonts helv08, helv10, and helv12 (known valid fonts) are used
directly.
fontopts
Contains the command-line options, one option per line — optional. Options are
located under the appropriate schema section. For example, phfont-specific options
are located in the [io-font] section. Options targeted towards a specific rendering
DLL are divided into subsections: boolean, numeral, string. They are formatted as
follows:
[dll id-subsection-schema]
The font server may run in one of two modes: server mode, or private client DLL
mode. In order to differentiate options between the two, by default there is a "dll"
schema. If the font server is running in server mode, it searches for options under
[dll id-subsection], but if the font server is running in client DLL mode, it
searches for options under [dll id-subsection-dll]. If no options are specified,
the default values are used.
Environment variables:
PHFONT The default name with which to register the font server.
See also:
bdftophf2, mkfontdir
Using the Photon microGUI and Configuring Your Environment in the Neutrino
User’s Guide
Syntax:
phgrafx [-s] [-x position[%][r]] [-y position[%][r]]
[-S i|m|n] [-c file]
[-d dir] [-K]
Runs on:
Neutrino
Options:
-s server The full path of the server or the device name.
Description:
You can choose the display preferences for your workstation with the phgrafx utility.
This utility needs to have the setuid (“set user ID”) bit set in its permissions. If you use
mkefs, mketfs, or mkifs on a Windows host to include this utility in an image, use
the perms attribute to specify its permissions explicitly, and the uid and gid
attributes to set the ownership correctly.
The list of available graphics modes displayed in the above dialog most likely is
different from those on your machine.
The initial settings are the result of a hardware scan Photon did during the installation.
The default selection is a “safe” choice based on this scan; you’ll probably want to
choose something better. The hardware detection program presents only options that
correspond to the kind of graphics card you have. To save these initial settings, click
Apply to accept the new settings, then click the Exit button.
WARNING:
Setting the refresh value incorrectly can damage your monitor. Consult your
monitor and video card manuals first.
Global Options
Click Global Options, then click the No Photon on startup check box to disable
Photon on startup. This setting will take effect the next time the computer restarts.
Advanced Options
Click Advanced to edit the advanced settings for the software driver. In the Driver’s
mode options field, enter any command line arguments for the video driver.
Hardware Details
Click H/W Details to view the current hardware information for the computer.
Region Settings
Click Region Settings, then enter x and y coordinates, to define to define the position
of the graphics region on the screen. Enter an input group value to define the input
device to use.
Examples:
Run at initial position (10,10).
See also:
enum-devices, io-graphics,
Using the Photon microGUI in the Neutrino User’s Guide
Syntax:
phin [-AhLMqW] [-C children] [-f chars] [-n name] [-P name]
[-p pid] [-R rid] [-r rid] [-T type] [command]
Runs on:
Neutrino
Options:
-A Show all regions.
-n name The name of the Photon Manager to communicate with. If the name
starts with a digit, the utility treats it as a node number and
communicates with /dev/photon on that node. If the name starts
with a slash, the utility treats it as a full path. Otherwise, the utility
looks for it in your /dev directory. The default is /dev/photon.
-P name Show information only for the process with this name.
-p pid Show information only for the process with this PID. This option
may be repeated.
-q Suppress all output; the exit value is the number of regions that would
have been listed.
-R rid Start with the region that has this region identifier (RID) and show
information about its children and the siblings behind.
-r rid Show information only for the region with this RID. This option may
be repeated.
command A command that lets you view specific groups of information and
provides a compact way to specify commonly used -f combinations.
Only the first two letters of a command are required:
Description:
The phin utility displays information about the state of the Photon window system.
Here’s what the options of the region flags, event flags, window flags, window render,
window state, process flags, and channel flags indicate.
• B —Force boundary
• F —Force front
• A —Audio
• I —Input group
• K —Keyboard
• P —Pointer
• G —Graphics
• M —Window Manager
• W —Window Region
• i —Info events
• s —System events (s is low bandwidth, S is high bandwidth,
and A is all)
• T —Timer events
• R —Raw events
• W —Window-Manager events
• c —Covered events
• d —Drag events
• D —Draw events
• E —Expose events
• B —Boundary events
• m —Motion flags: (m is EV_PTR_MOTION; M is
EV_PTR_MOTION_BUTTON; A is both m and M)
• # —Button flags: (1 is EV_BUT_PRESS; 2 is
EV_BUT_RELEASE; 4 is EV_BUT_REPEAT). Note that
buttons accumulate (e.g.
EV_BUT_PRESS+EV_BUT_RELEASE=3).
• k —Sensitive/opaque to key events
• F —Foreground
• B —Backdrop
• X —Maximize
• I —Iconify
• M —Move
• R —Resize
• s —Console switch
• < —To back
• > —To front
• f —Focus
• T —Terminate
• C —Close
• M —Maximized
• n —Minimized
• c —Close
• m —Menu
• t —Title
• r —Resize
• b —Border
• M —Is maximized
• D —Is a backdrop
• p —Is PDM
• I —Is an icon
• i —Is iconified
• h —Is hidden
• f —Force front
• A —Accepts Alt keys
• R —Is Remote
• F —Is Focused
• V —Virtual
• A —Armed
• B —Blocked
• H —Held
• C —Catch up
• D —Dynamic Buffer
• B —Block overflow
• T —Term overflow
• P —No proxy
• H —No hold
• D —Dynamic Buffer
Examples:
Display default information:
phin
Display parent, child, and brother information about regions on the device
/dev/photon:
Syntax:
phlip [options]
Runs on:
Neutrino
Options:
-a Disable the option to create new dialups.
Description:
The phlip command starts Photon’s TCP/IP configuration manager. It’s the front end
for netmanager; it reads and writes the /etc/net.cfg configuration file.
When phlip starts, it invokes netmanager -w all to dump the current snapshot of
all network configuration to the file /etc/net.cfg. It then reads the file and displays
the data.
If you make changes and click Apply, phlip writes all its data and spawns
netmanager -r all. If netmanager reports any errors, phlip displays them in a
popup window.
After netmanager has applied the changes, phlip spawns it again to get an
up-to-date copy of the network settings (netmanager -w all). Any inconsistencies
between the contents of the file after phlip wrote it out and asked netmanager to
apply them, and after netmanager grabbed the latest settings, are changes that for
some reason, netmanager couldn’t make. The netmanager should have reported
these problems when it ran into them. If netmanager printed those errors, phlip
should have brought up a popup window. (To check for inconsistencies, use phlip
-d.)
If you make changes and simply click Done instead of Apply, phlip writes the data
to net.cfg, runs netmanager -r all to apply the changes, reports any errors that
netmanager prints, but then exits immediately, without updating the file and
redisplaying the information.
Remember that your network configuration isn’t really a file, it’s the state of all the
network software currently running. Interfaces come up and go down, nameservers
and routes come and go. The file is only a starting point. Both phlip and
netmanager use net.cfg more as a scratch pad for communication.
If you have obtained a DHCP IP address from the DHCP server, and then you switch
from DHCP mode to manual mode, the DHCP address is released to the server.
Devices tab
This screen gives you information about all the network interfaces detected on your
computer. The name of the interface is shown next to an icon depicting a network card
in the top right-hand corner of each pane.
The fields on this screen depend on the type of connection that you choose from the
dropdown menu:
Manual If you’re configuring a manual connection, you just have to enter your IP
address and netmask:
DHCP If you select a DHCP connection, you are given the opportunity to fill in
two optional fields, ID and Server IP:
If you display the advanced options, you will see an additional pane showing the IP
aliases for this interface. To add an IP alias, simply fill in the IP and Netmask fields,
and then click the Add button. To remove, highlight the alias and click Remove.
This screen displays information about all the connections you can enable. The top
pane shows the connection’s name (this name will be shown in associated applications
such as phdialer), its type, and its interface device.
If you want applications to automatically connect the system to your network or ISP,
use the Automatically Connect check box. If you don’t use this checkbox, the dialer
will be started and you will have to initiate the connection. (For more information on
automatic TCP/IP connection, see /etc/autoconnect.)
If you want to specify a default connection for applications to use, check Always Use
This Connection for that connection.
The Network pane in this screen enables you to select which login type the connection
will use:
Automatic (PAP/CHAP).
This is the type of login used most often. It does everything for you;
all you have to enter is your user name and password.
Script Select this login type if you want to enter a set of commands when
you log in. You must provide a script file containing the set of
commands and enter the name of this file in the new field labeled
Script. Login scripts enable you to set up a consistent set of variables
for each connection.
Interactive Select this option if you want to configure the network connection via
the command line.
This pane also allows you to enter optional nameservers if your server doesn’t provide
this information.
This pane is shown only for modem interface connections. Most of the options are
self-explanatory.
The Baud Rate selector is provided for those cases where the modem speed isn’t
auto-negotiated; you could also use this option to set the baud rate lower than would
be auto-negotiated (you might do this for noisy connections when you want to reduce
communication errors).
If you enable logging in this pane, debugging information is logged to syslogd. This
pane also shows administrative information about the selected connection.
Network tab
A check box in this pane allows you to force the connection to look into the local
/etc/hosts file for hostname lookup before consulting the network server for this
information.
• routing table entries — for more information on routing tables, see route.
• search suffixes — entries list the domains to query if a hostname is not fully
qualified. These entries override the default domain name used to search for
hostnames that don’t contain a dot.
Examples:
Show the current version, build time and the files that phlip will edit (use this to
confirm that you have the latest information):
phlip -v
See also:
/etc/autoconnect, dhcp.client, ifconfig, netmanager, route
Using the Photon microGUI in the Neutrino User’s Guide
Syntax:
phlocale [options]
Runs on:
Neutrino
Options:
Description:
This application is used to set/modify the user localization information such as the
timezone, language and keyboard.
This utility needs to have the setuid (“set user ID”) bit set in its permissions. If you use
mkefs, mketfs, or mkifs on a Windows host to include this utility in an image, use
the perms attribute to specify its permissions explicitly, and the uid and gid
attributes to set the ownership correctly.
You can start phlocale from the command line, or by clicking on the Localization
icon in the shelf:
The changes (except for the language selection) go into effect when you click on the
Apply or OK button. Any language change takes effect the next time the user logs into
the system.
Files:
The following files are databases of the choices for keyboards, timezones, and
languages:
• /usr/photon/keyboard/uc_keyboard_t
• /usr/photon/translations/uc_language_t
• /etc/timezone/uc_tz_t
The phlocale utility creates (if the file doesn’t exist yet) and modifies the following
files:
${HOME}/.ph/uc_local_t
The main user configuration file.
/etc/country The country you’re in, based on your selection of the time zone.
${HOME}/.ph/.ABLANG
The selected PhAB language identifier.
/etc/system/trap/.KEYBOARD
The keyboard file_name is inserted, so that the correct keyboard
definition file is used.
See also:
date, rtc
Using the Photon microGUI and Configuring Your Environment in the Neutrino
User’s Guide
Syntax:
phlogin [options]
phlogin2 [options]
Runs on:
Neutrino
Options:
-B phlogin only.
Use slow machine screensaver mode. Forces phlogin to use a
different screensaver mode (see option -T). Normally, when
phlogin enters the screensaver mode, it moves the login dialog
smoothly around the screen. If the graphics driver doesn’t support
hardware blitting, “Slow machine” mode is used, meaning the login
dialog is moved to random locations on the screen.
-i phlogin only.
Don’t wait for an input driver.
-n phlogin2 only.
Disable the user-selector icons.
-U user[:password]
phlogin only.
The user to log in as, and optionally the password to use.
If you specify both a user name and password (or the name of a user who doesn’t have
a password), the command phlogin executes runs in parallel with the script that has
just launched Photon. You should make sure that this doesn’t create dangerous race
conditions.
For example, the default command that phlogin executes is the ph script. It starts an
input driver if one isn’t running yet. It may happen that both scripts decide to run an
input driver at the same time. Instead of allowing phlogin to run the default ph
script, it’s better to use a modified version that doesn’t attempt to do things that the
script that launched Photon takes care of already.
Description:
The phlogin and phlogin2 utilities are typically used for nodes that boot directly
into Photon or for users who start Photon via a phindows or phditto session.
You can’t start these utilities from the command line — Photon runs one of them
automatically if it was started with the -l option. The ph script sets that option if the
LOGNAME environment variable isn’t set, in particular when tinit is executed
with the -p option (which runs the ph script). To pass command line arguments to
phlogin or phlogin2, use Photon’s -l option. For more information on how to
start Photon without using the ph script, see Photon in Embedded Systems in
the Photon Programmer’s Guide.
The phlogin utility prompts you to enter a userid and optional password through the
Photon Login dialog. The phlogin2 utility is a simplified alternative to the phlogin
utility. In either utility, you can also click on an Exit or Shutdown button to return to
the text-mode console (this runs phlogin or phlogin2 with the -S shutdown
command). To prevent users from exiting to text mode, you can disable this button by
setting the PHEXIT_DISABLE environment variable to 1.
These utilities set the file owner on the Photon server (/dev/photon) to the userid of
the user logging on. Attempts to run Photon applications by other users who don’t
have read and write permission to the Photon server will fail.
If you want to run chmod and chown on your Photon server to allow other users
access, you can do so from the ˜/.ph/phapps script, which is run by the ph script to
initialize the new Photon session. You shouldn’t hard code /dev/photon in this
script; use the $PHOTON environment variable instead.
You can create a configuration file that specifies command line arguments for your
shell to run as a login shell. You might want to do this if you require your .profile
script to run, for example. The configuration file must have the same name as the shell,
and be located in these folders, searched in this order:
1 ˜/.ph/login/shells/
2 /etc/photon/login/shells/
The configuration file can contain any number of blank lines and comments, followed
by a single line of command-line arguments for your shell, including argv[0].
Arguments must be separated by white space. Lines starting with # are comments.
The path to ph is appended to the arguments. You can use a backslash to escape a
white space character, a backslash, or the # character.
The default is:
- -c
• argv[0] = -
• argv[1] = -c
• argv[2] = /usr/bin/ph
• argv[3] = NULL
You can pass command line options to phlogin or phlogin2 when you start
Photon by using the -l option. For example:
Environment variables:
These environment variables affect phlogin and phlogin2:
PHLOGIN_NO_FACES
If this environment variable is set, phlogin2 does not display
the the user-selector icons.
PHEXIT_DISABLE
Turn off the Exit button so that users won’t be able to exit to text
mode.
See also:
login, ph, tinit
Logging In, Logging Out, and Shutting Down and Managing User Accounts in the
Neutrino User’s Guide
Syntax:
phmenu [-s server][-x position[%][r]][-y position[%][r]]
Runs on:
Neutrino
Options:
-s server_name The name of the Photon server:
Description:
The phmenu utility starts a graphical Photon window manager menu editor that lets
you use drag-and-drop capabilities to create a customized PWM menu. The PWM
menu appears when you right-click the Photon desktop. You must be running Photon
in order to run phmenu.
1 Drag the Menu Item to the menu list, dropping it in the location where you’d
like it to appear on the PWM menu.
A blank plugin appears in the list.
2 Fill in the plugin’s Label, enter its Command line, and give it an Accelerator
Key.
3 Click Save.
Do not enter the same accelerator key for more than one menu item, or that accelerator
key will not work.
To add a submenu:
1 Drag the Sub Menu icon to the menu list, dropping it in the location where
you’d like it to appear on the PWM menu.
3 Open the new submenu on the list, and complete the new plugin’s information.
5 Click Save.
• Add a separator to the menu list by dragging the Separator icon to the location
where you’d like a separator to appear.
You can also perform all of these operations by right-clicking an existing item or new
item icon, and selecting an operation from the menu.
When you delete an item, it appears in a list of all recently deleted items under the
Delete Selection button. You can drag an item out of this list to a position in the menu
to un-delete it.
Examples:
Run phmenu using the Photon server on node my_node:
phmenu -s/net/my_node/dev/photon
See also:
pwm
Using the Photon microGUI in the Neutrino User’s Guide
Syntax:
Photon [-b color] [-C pixels] [-D time] [-g]
[-l command] [-m timers] [-N name] [-n clients]
[-q] [-R time] [-r regions] [-s] [-t tiles]
[-T pixels] [-U pixels] [-v]
Runs on:
Neutrino
Options:
-b color Background color (hex RGB value).
-C pixels Specify the mouse multi-click threshold. This option affects only
multi-clicks and takes effect when the supplied value is larger than
the specified -T value. This option is useful for touch screens.
Default is 0 pixels.
-D time Set the mouse repeat delay in milliseconds (default is 500). This is
the amount of time before mouse repeat events (
Ph_EV_BUT_REPEAT) are generated.
-m timers Set the total number of timers that the Photon Server can support. If
you specify the -r option, the default is 4 times the number of
regions.
-n clients Set the maximum number of clients that can communicate with the
Photon Server (default is no limit).
-q Be quiet.
-R time Set the mouse repeat rate in milliseconds (default is 33). This is the
amount of time between mouse repeat events (
Ph_EV_BUT_REPEAT).
-r regions Set the maximum number of regions that the Photon Server can
support. Default is no limit.
-t tiles Set the total number of tiles that the Photon Server can support.
This number includes the complete rectangle set for each active
event in the event space. If you specify the -r option, the default is
12 times the number of regions. Otherwise, the default is an
unlimited number of tiles.
-T pixels Specify the mouse click threshold for drag initiation and multi
clicking. Default is 5 pixels.
-U pixels Specify the size of the area where the position of the release is
forced to be the same position of the press. This may be used to
prevent random changes in position because the size of a finger
press is larger than a pixel. Default is 0 pixels.
-v Be verbose.
Description:
The Photon server lets applications open regions from which Photon events may be
emitted and collected. Specifying the number of clients, regions, and rectangles limits
the resources available to the Photon server.
This utility needs to have the setuid (“set user ID”) bit set in its permissions. If you use
mkefs, mketfs, or mkifs on a Windows host to include this utility in an image, use
the perms attribute to specify its permissions explicitly, and the uid and gid
attributes to set the ownership correctly.
The Photon device is owned by and has the permissions associated with the user who
invoked it.
To connect with a Photon device, a user must have read permission on the device. To
emit events or to create a region, the user must also have write permission.
The Photon Server registers the name of /dev/photon by default. If the PHOTON
environment variable is defined, that name is be registered instead.
Examples:
Start the Photon server, configuring it for 5 clients that can open a maximum of 200
regions along with up to 1000 rectangles:
Environment variables:
PHOTON The name of the photon device (defaults to /dev/photon).
Syntax:
phrelay [-eGx] [-b number] [-D debugfile] [-g port]
[-k delay,interval,retry] [-V...]
Runs on:
Neutrino
Options:
-b number Set the number of messages buffered to allow write-ahead draws to
Phindows or phditto. The actual number used is the lesser of this
option and the -N option of Phindows or phditto. The default
value is 20. Use a lower value to save memory at the expense of
throughput, or, if memory isn’t an issue, a higher value to gain some
additional throughput performance. Adjusting this setting has the
most effect when end-to-end response time is slow compared with
throughput, such as over a modem or when there are many network
hops between the local and remote ends.
-g port This is the same as -G, but you specify the port.
-k delay,interval,retry
The keepalive delay (in seconds), interval (in seconds), and retry
count. This option determines how long phrelay will stay alive
when a network connection to a client has failed (for example, if a
network cable is unplugged). The default setting is 20,5,3.
-V... Be verbose. Add more V’s for greater verbosity. Output is sent to the
file or device you specify in the -D option that’s required if you
specify -V.
-x Embed color palette information into the data stream. This option
works around a problem where some applications with many small
graphics may have incorrect palette tags, and therefore are displayed
Description:
The phrelay utility supports remote user interface clients on other nodes.
exec /usr/bin/phrelay
The remote client synchronizes with phrelay and starts to function as a Photon
graphics terminal.
There are several configuration issues that need to be taken care of before you can use
phrelay over TCP/IP.
First, the QNX host must have TCP/IP installed and running. In addition, inetd must
be running with the following items specified in the inetd configuration file
/etc/inetd.conf:
The file /etc/services file must include the following line (it’s in the default
file):
phrelay 4868/tcp
These two entries cause inetd to listen for incoming requests to establish a new
Photon session. When a request is detected (from a remote phindows or phditto
client), inetd automatically establishes a full TCP/IP connection and launch
phrelay on that connection. The remote phindows or phditto client is then fully
connected to a local Photon session.
3 In the phditto/phindows window, get the ksh prompt and then run stty +raw
+echoe +echoke +echoctl +imaxbel +onlcr </dev/ser1
You should see the phrelay connect sequence automatically resume. Another way to
connect to the target is as follows:
3 In the phditto/phindows window, get the “login” prompt, log in, and then run:
stty +raw +echoe +echoke +echoctl +imaxbel +onlcr
</dev/ser1
The phditto/phindows -U option is often used with the -s option to specify a QNX
userid to use when running the remote Photon command. If no userid is given, and the
phrelay service doesn’t specify a default userid, then Photon pops up the QNX
Photon Login dialog requesting the QNX userid before proceeding. By specifying a
userid with the -U option, you can avoid this login dialog.
For example, if a MS-Windows shortcut were created as follows:
phindows -tx.x.x.x -svpoker -Ujoe
where the IP address x.x.x.x specified the TCP/IP address of QNX node 2, and the
phrelay configuration file on node 2 (/etc/config/phrelay.2) contained the
following line:
vpoker % /usr/photon/bin/vpoker
then Joe could directly launch a Photon vpoker session (running as QNX userid joe)
on his MS-Windows desktop by clicking on the shortcut icon.
The phrelay utility processes requests for service according to the contents of a
configuration file. If phrelay is running on QNX node n, then the file
/etc/config/phrelay.n is used. If this file doesn’t exist, then the default file
/etc/config/phrelay is used.
The format of each service entry in the phrelay configuration file is as follows:
service user [-W pwm_options] command
where:
service is the symbolic name of the Photon service (matches the -s phindows or
phditto parameter).
user defines how to process userids that may be specified on the phindows or
phditto command line (-U option).
user can be one of:
pwm_options can be one or more of the following Photon Window Manager options:
command is the Photon command to launch instead of the default command, which
starts the Photon desktop.
• Run Length Limited — (RLL) provides good data compression. Although not as
highly compressed as BPE, RLL encoding is both quick to decode and encode.
RLL encoding is recommended for network TCP/IP connections because it places
less CPU load on the QNX host, yet provides fair compression.
• None — With data compression turned off, Photon draw events are transmitted “as
is.” This might make sense if the connection bandwidth is very high (say 100Mb
Ethernet), making the extra processing time involved in data compression an
unnecessary step.
Encryption
The phrelay utility supports encrypted connections with Phindows versions 3.09
and later.
When Phindows requests an encrypted connection (by specifying a key using the -K
commandline option), phrelay looks for a matching key in the
/etc/config/phkeys file. Each line of the file has this format:
*|user private_key
Keys can be up to 31 characters long.
The line that starts with the * character applies to connections that don’t specify a
Photon service and user ID. For Phindows connections that specify a service (-s), a
user ID can also be specified using -U. In this case, phrelay finds the user in the
/etc/config/phkeys, and checks that the specified key matches the key sent by
Phindows. If a matching key isn’t found, phrelay doesn’t allow the connection, and
Phindows displays a “Error: Permission problem on host” message.
Security
Both Phindows and phditto allow a user to connect to an existing Photon session,
which displays the contents of the Photon session on the remote client’s screen. You
can disable this option by creating an /etc/system/config/noditto file on your
target. When this file exists, remote clients can still connect to your target machine
using their own private Photon session, but they can’t view an already running Photon
session.
Examples:
From a remote phindows or phditto session, type:
exec /usr/bin/phrelay
See also:
phditto, phrelaycfg
Using the Photon microGUI in the Neutrino User’s Guide
Syntax:
phrelaycfg [options]
Runs on:
Neutrino
Options:
-h height[%] The height of the window, in pixels, or as a percentage of the
screen height if % is specified.
Description:
The phrelaycfg command configures remote access to your Photon workspace. The
main window looks like this:
When you uncheck the Enable remote access to your graphical environment
checkbox and click Apply, phrelaycfg creates a
/etc/system/config/noditto. The presence of this file prevents remote users
from connecting to your Photon session using phditto.
• You must also configure and run phrelay to allow remote access. If the remote
access is over a TCP/IP connection, you must configure and run inetd, which will
run phrelay.
Files:
/etc/system/config/noditto
The presence of this file prevents anyone from accessing your Photon workspace
from a remote machine.
See also:
inetd, phrelay, phditto
Using the Photon microGUI in the Neutrino User’s Guide
Syntax:
phs-to-bjc [-A] [-B size] [-b size] [-C]
[-c colors] [-D debug_fname] [-d]
[-h height] [-M model] [-m model]
[-n name] [-ocn] [-odn] [-of] [-oh]
[-oin] [-omn] [-opn] [-oQn] [-oq]
[-orn] [-oSX,Y] [-oyn]
[-P file] [-p start[,end]] [-pr]
[-s level] [-U filename]
[-V] [-w width] [-x offset] [-y offset]
filename
Runs on:
Neutrino
Options:
-A Force anti-aliasing of fonts.
-B size Specify the size of the printer buffer in bytes. This buffer is used
if the specified input file is a FIFO.
-h height Specify the initial height of the source image. The default is 480
pixels.
-M model Select the model by specifying the QNX model ID, which is a
hexadecimal integer.
-m model Select the model by specifying the MicroSoft model ID, which
is a string of up to 20 ASCII characters.
-orn Set the resolution; the default is 360 DPI unless specified by the
source file. Valid choices are 90, 180, 360, and 720.
If you set only the X scale factor, the Y scale factor is assumed to
be the same value. For example, -oS0.5 sets both X and Y to
0.5, meaning the image will fill 14 of the page.
-P file The name of the Photon palette file to use. The default is
default.pal.
-U filename Delete this file when the print job is completed. Use for
synchronizing print-spooling operations.
-w width Specify the initial width of the source image. The default is 640
pixels.
Description:
This utility converts Photon draw-stream (.phs) output for into a form that a Canon
printer understands. The configuration file for Canon printers,
/etc/printers/bjc.cfg specifies phs-to-bjc as a filter for spooler to use.
The output is sent to stdout. Typically, this is redirected to a printer device, as shown
in the example. This utility sends any error messages to slogger; use sloginfo to
display them.
Examples:
phs-to-bjc file.phs >/dev/par
See also:
phs-to-bmp, phs-to-escp2, phs-to-ijs, phs-to-pcl, phs-to-ps, spooler
“Printing with spooler” in the Printing chapter of the Neutrino User’s Guide
Syntax:
phs-to-bmp [-A] [-B size] [-b size] [-c colors]
[-D debug_fname] [-d] [-h height]
[-n name] [-orn] [-oSX,Y]
[-P file] [-p start[,end]]
[-pr] [-s level] [-U filename]
[-V] [-w width] [-x offset] [-y offset]
filename
Runs on:
Neutrino
Options:
-A Force anti-aliasing of fonts.
-B size Specify the size of the printer buffer in bytes. This buffer is used
if the specified input file is a FIFO.
-b size Specify the size of the printer buffer, in bytes.
-c colors The number of colors available (bytes per pixel); colors must be
1 (256 colors) or 3 (16 million colors). The default is 3.
If you set only the X scale factor, the Y scale factor is assumed to
be the same value. For example, -oS0.5 sets both X and Y to
0.5, meaning the image will fill 14 of the page.
-P file The name of the Photon palette file to use. The default is
default.pal.
-w width Specify the initial width of the source image. The default is 640
pixels.
Description:
This utility converts Photon draw-stream (.phs) output into a bitmap (.bmp) file.
Currently, only one page of output is supported.
The output is sent to stdout. Typically, you redirect it to a file, as shown in the
example.
This utility sends any error messages to slogger; use sloginfo to display them.
Examples:
phs-to-bmp file.phs >outfile.bmp
See also:
phs-to-bjc, phs-to-escp2, phs-to-ijs, phs-to-pcl, phs-to-ps, spooler
“Printing with spooler” in the Printing chapter of the Neutrino User’s Guide
Syntax:
phs-to-escp2 [-A] [-B size] [-b size] [-C]
[-c colors] [-D debug_fname] [-d]
[-h height] [-M model] [-m model]
[-n name] [-ocn] [-oD n] [-odn] [-of]
[-oh] [-oin] [-omn] [-opn] [-oQn]
[-oq] [-orn] [-oSX,Y] [-oyn] [-P file]
[-p start[,end]] [-pr] [-s level]
[-U filename]
[-V] [-w width] [-x offset] [-y offset]
filename
Runs on:
Neutrino
Options:
-A Force anti-aliasing of fonts.
-B size Specify the size of the printer buffer in bytes. This buffer is used
if the specified input file is a FIFO.
-h height Specify the initial height of the source image. The default is 480
pixels.
-M model Select the model by specifying the QNX model ID, which is a
hexadecimal integer:
Model ID
MODEL_COLOR 0x101
MODEL_Pro 0x201
MODEL_ProXL 0x202
continued. . .
Model ID
MODEL_COLOR_IIs 0x203
MODEL_COLOR_II 0x204
MODEL_ProXL_Plus 0x301
STYLUS_COLOR_400 0x63C3C3D
STYLUS_COLOR_440 0x640FC3F
STYLUS_COLOR_500 0x63DFC6C
STYLUS_COLOR_600 0x63EFC9C
STYLUS_COLOR_640 0x6423C9E
STYLUS_COLOR_680 0x6463C9B (same printer as 777)
STYLUS_COLOR_740 0x643FCCF
STYLUS_COLOR_750 0x6446CCE
STYLUS_COLOR_777 0x646CE8E
STYLUS_COLOR_800 0x6403FFD
STYLUS_COLOR_820 0x6425FFC
STYLUS_COLOR_850 0x6456FFE
STYLUS_COLOR_870 0x6470FFF
STYLUS_COLOR_880 0x648FFFA
STYLUS_COLOR_900 0x641FFAC
STYLUS_COLOR_1160 0x63A69AF
STYLUS_COLOR_1200 0x63BC95C
STYLUS_COLOR_1270 0x63BF95E
STYLUS_COLOR_1500 0x63E08ED
STYLUS_COLOR_1520 0x63E68EC
STYLUS_COLOR_3000 0x63BB1FC
-m model Select the model by specifying the MicroSoft model ID, which
is a string of up to 20 ASCII characters.
If you set only the X scale factor, the Y scale factor is assumed to
be the same value. For example, -oS0.5 sets both X and Y to
0.5, meaning the image will fill 14 of the page.
-P file The name of the Photon palette file to use. The default is
default.pal.
-w width Specify the initial width of the source image. The default is 640
pixels.
Description:
This utility converts Photon draw-stream (.phs) output into a form that an Epson
ESC/P2 printer understands. The configuration file for Epson ESC/P2 printers,
/etc/printers/epson.cfg, specifies phs-to-escp2 as a filter for spooler to
use.
The output is sent to stdout. Typically, this is redirected to a printer device, as shown
in the example. This utility sends any error messages to slogger; use sloginfo to
display them.
Examples:
phs-to-escp2 file.phs >/dev/par
See also:
phs-to-bjc, phs-to-bmp, phs-to-ijs, phs-to-pcl, phs-to-ps, spooler
“Printing with spooler” in the Printing chapter of the Neutrino User’s Guide
Syntax:
phs-to-ijs [options] -Xoutfile phsfile
Runs on:
Neutrino
Options:
-A Force anti-aliasing of fonts.
-B size Specify the size of the printer buffer in bytes. This buffer is used if
the specified input file is a FIFO.
-b size Specify the size of the slice buffer in bytes. The size can be:
• 0 — automatically determine the size, based on the page size.
• positive — use the specified fixed buffer size.
• negative — don’t allocate a buffer.
The page slice buffer must be large enough to hold at least one line
of the output image; that is:
size ≥ dots_per_inch * page_width(inches) *
bytes_per_pixel
-h height Specify the initial height of the source image, if it isn’t specified by
the input file. The default is 480 pixels.
-m model Select the printer model by specifying a string that matches the
MODEL field of the IEEE 1284 Device ID string. For example,
-m"Stylus COLOR 777".
-opn Specify printing type. The choices are: 1 (B/W); 3 (CMY color); 4
(CMYK); 6 (CcMmYK).
If you set only the X scale factor, the Y scale factor is assumed to be
the same value. For example, -oS0.5 sets both X and Y to 0.5,
meaning the image fills 14 of the page.
-p start[,end] Specify the starting (and optionally ending) page number to print. If
start is greater than end, the pages are printed in reverse order.
-w width The initial width of the source image, if not specified by the input
file. The default is 640 pixels.
Description:
The phs-to-ijs utility is an IJS client for printing Photon draw-stream (.phs)
output using an IJS server. The configuration file for Epson IJS printers,
/etc/printers/epijs.cfg specifies phs-to-ijs as a filter for spooler to use.
If the printer model cannot be determined from the output device, then you need to use
the -m option to specify the printer model.
This utility sends any error messages to slogger; use sloginfo to display them.
Examples:
phs-to-ijs -oS1 -or360x720 -X/dev/par1 file.phs
See also:
phs-to-bjc, phs-to-bmp, phs-to-escp2, phs-to-pcl, phs-to-ps, spooler
“Printing with spooler” in the Printing chapter of the Neutrino User’s Guide
Syntax:
phs-to-pcl -m model [options] filename > device
Runs on:
Neutrino
Options:
-A Force the anti-aliasing of fonts.
-B size Specify the size of the printer buffer, in bytes. This buffer is used
if the specified input file is a FIFO.
-h height Specify the initial height of the source image. The default is 480
pixels.
If you specify an unsupported printer model, the filter doesn’t produce any output. Use
a model of list_supported to get a list of the substrings of all supported printers.
-opmode Specify the color mode. The choices are 1 (black and white), 3
(color), or 4 (Color).
If you set only the X scale factor, the Y scale factor is assumed to
be the same value. For example, -oS0.5 sets both X and Y to
0.5, meaning the image will fill 14 of the page.
-P file The name of the Photon palette file to use. The default is
default.pal.
-w width Specify the initial width of the source image. The default is 640
pixels.
Description:
This utility converts Photon draw-stream (.phs) output into a form that
Hewlett-Packard PCL-compatible printers can understand. The configuration for HP
PCL printers, /etc/printers/pcl.cfg, specifies phs-to-pcl as a filter for
spooler to use.
The phs-to-pcl filter is based on HP’s Appliance Printing Development Kit
(APDK), a library that generates PCL output for a wide range of HP printers. To
produce the correct output, it must be given the printer model, which for best results
should be extracted from the model field of the printer’s PnP string. The spooler
utility does this automatically if you start it without specifying a configuration file (
with the -c option). For example:
spooler -d /dev/usbpar0
This is the case when spooler is started by an enumerator. To get a list of all valid
printer model substrings, pass a model name of list_supported and a valid .phs
file. For example:
phs-to-pcl -m list_supported file.phs > /dev/null
This displays a list of printer model substrings accepted by the APDK. For example, if
DESKJET 85 is in the list, then a printer that identifies itself as DESKJET 850 will be
accepted. Note that some printers may not identify themselves as exactly the same
model they’re labelled with. For example, the HP Deskjet 5650 isn’t in the substring
list, but it actually identifies itself as a Deskjet 5600, which is.
According to the HP APDK documentation, the following printer models and/or
families are supported:
• Deskjet 350C
• Deskjet 810C, 812C, 815C, 816C, 830, 832, 840, 841, 842, 843
• Deskjet 5740
• Deskjet 6840
• Deskjet 9300
• Deskjet 96XX
• Deskjet 98XX
• Officejet 11XX
• Officejet 51XX, 61XX, 62XX, 63XX, 4100, 4105, 4200, 5500, 9100
• Officejet 9x11
• Officejet d Series
• Officejet G Series
• Officejet J Series
• Officejet K Series
• Officejet Lx
• Officejet R Series
• Officejet t Series
• Officejet v Series
• PhotoSmart 71XX, 72XX, 73XX, 74XX, 75XX, 76XX, 77XX, 78XX, 79XX
• All Monochrome Laserjet Printers and MFPs (except LJ 1000, 1005, 1018, 1020)
• All Color LaserJet Printers and MFPs (except LJ 1600, 2600, 3500, 3550, 3600)
• E-Printer e20
• Business InkJet 1000, 1100 Series, 1200 Series, 22XX Series, 2300 Series, 2600
Series, 2800 Series, 3000 Series
• Get the PNP model information from your printer by using the enum-par (see the
documentation for enum-devices) or usb command, and then checking it against
the substring list given by phs-to-pcl’s -mlist_supported option. If a string
in this list is a substring of your printer’s PNP model, then the printer is supported.
If there is no substring match, phs-to-pcl filter aborts when that model name
is used.
Examples:
phs-to-pcl -mDeskjet_6940_series file.phs > /dev/usbpar0
See also:
phs-to-bjc, phs-to-bmp, phs-to-escp2, phs-to-ijs, phs-to-ps, spooler
“Printing with spooler” in the Printing chapter of the Neutrino User’s Guide
Syntax:
phs-to-ps [-D debug_fname] [-d] [-E] [-F]
[-l1] [-od] [-p start[,end]] [-pr]
[-U filename] [-V]
filename
Runs on:
Neutrino
Options:
-D debug_fname Send debug information to the specified file.
alias = fontname
Or:
default=default
Description:
This utility converts Photon draw-stream (.phs) output into PostScript. The
configuration file for PostScript printers, /etc/printers/ps.cfg, specifies
phs-to-ps as a filter for spooler to use.
The output is sent to stdout. Typically this is redirected to a printer device, as shown in
the example. This utility sends any error messages to slogger; use sloginfo to
display them.
Examples:
phs-to-ps file.phs >/dev/par
See also:
phs-to-bjc, phs-to-bmp, phs-to-escp2, phs-to-ijs, phs-to-pcl, spooler
“Printing with spooler” in the Printing chapter of the Neutrino User’s Guide
Syntax:
phshutdown [options]
Runs on:
Neutrino
Options:
-f Shut down fast. Send a SIGTERM signal, but wait only one second
before rebooting.
-q Be quiet.
-v Be verbose.
Description:
In its default configuration, phshutdown allows any user to shut the system down.
This makes it easy to use in a single-user desktop environment but is not desirable in a
multi-user, networked configuration. If you want to make it more secure, restrict this
shutdown privilege to root by simply creating a new file, like this:
$ touch /usr/photon/config/phshutdown.restrict
The presence of this file allows any user to end a Photon session, but prevents users
who do not have the root password from shutting down or rebooting the machine.
If you are root, this restriction does not apply unless you pass the -i option with
phshutdown. In this case, you are treated as a non-root user and will be asked for the
root password before being allowed to shut the system down. Using this option
always provides a secure shutdown dialog, even from phlogin, where it’s always
root that launches phshutdown.
This utility needs to have the setuid (“set user ID”) bit set in its permissions. If you use
mkefs, mketfs, or mkifs on a Windows host to include this utility in an image, use
the perms attribute to specify its permissions explicitly, and the uid and gid
attributes to set the ownership correctly.
If you choose to shut down the entire system, phshutdown does it in an orderly way
by:
2 Waiting for ten seconds (or one second if the -f option is specified)
The ten-second interval allows processes that have elected to catch the SIGTERM
signal to perform any cleanup they need to do before the system is rebooted.
Files:
/usr/photon/config/phshutdown.restrict
The presence of this file prevents non-root users from shutting down or
rebooting the machine.
$HOME/.ph/phshutdown.cfg
This file holds the type of shut down selected the last time phshutdown was
used.
See also:
procnto, shutdown
Logging In, Logging Out, and Shutting Down in the QNX Neutrino User’s Guide
shutdown_system() in the QNX Neutrino Library Reference
Syntax:
phuser [options]
Runs on:
Neutrino
Options:
-h height[%] The height of the window, in pixels, or as a percentage of the
screen height if % is specified.
Description:
The phuser utility provides a GUI to manage user accounts on a Photon system.
Using this utility, you can:
For information about managing user accounts, groups, and shells, see the Managing
User Accounts chapter of the Neutrino User’s Guide.
To change your icon:
2 Select a new icon from the list. The default icon and a selection of others are
located in /usr/share/faces.
3 Click Open.
If you have root priviledges, you can also create, edit, and delete users, groups, and
shells:
1 Click Advanced.
This utility needs to have the setuid (“set user ID”) bit set in its permissions. If you use
mkefs, mketfs, or mkifs on a Windows host to include this utility in an image, use
the perms attribute to specify its permissions explicitly, and the uid and gid
attributes to set the ownership correctly.
See also:
login, phlogin2
Managing User Accounts in the Neutrino User’s Guide
Syntax:
phview [-h height] [-m f|s|t] [-N server] [-S i|m|n]
[-s server] [-w width] [-x x_pos] [-y y_pos]
Runs on:
Neutrino
Options:
-h height Set initial height of window to height pixels.
Description:
The phview utility displays a front, top, or side view of the regions used on a given
Photon server. Each of the main region types (e.g. windows) is displayed in a different
color. In the top or side view, click on a region to identify it.
To learn more about regions, refer to the Photon Programmer’s Guide.
Examples:
Run phview at initial position (10,10) with initial dimension of 200×300.
Run phview using the Photon server on the computer known as remote_server on
your network:
phview -s remote_server
Or
phview -s remote_server/dev/photon
See also:
Photon Programmer’s Guide.
Syntax:
pidin [options] shorthand
Runs on:
Neutrino
Options:
The options are:
-F formats A combination of format letters, like the format string for printf().
Like printf(), you can specify the width for a field by including a
number with the format, such as "%I %60N".
Format Description
A Arguments
a Process ID
B What you’re blocked on; see “Values in the Blocked
column,” below.
b Thread ID
c Code size of the process
d Data size of the process
E Environment
e Parent PID
f Process flags (see the flags shorthand below)
H Scheduling-specific information for each thread. For
adaptive partitioning scheduling, it’s the name of the
partition that the thread is running in. For more information,
see the Adaptive Partitioning User’s Guide.
This formatting code was added in the QNX Neutrino Core
OS 6.3.2.
continued. . .
Format Description
h Thread name; if a thread doesn’t have a name, pidin
displays the thread’s ID (tid) instead.
This formatting code was added in the QNX Neutrino Core
OS 6.3.2.
R Timers
S Signal ignore mask
s Signal queued mask
T Number of threads
continued. . .
Format Description
[ Lengths of the send, receive, reply and pulse queues.
This formatting code was added in QNX Neutrino 6.4.0.
-f formats The same as the -F option, but the formats parameter is a contiguous
string of format codes that gets expanded. For example, -f mbe is
expanded to -F "%m %b %e".
-k Keep printing out data for PIDs and TIDs until an error occurs, for
example, encountering a PID/TID in an unknown state (because the
PID/TID is partially alive).
-M formats A combination of format letters, like the format string for printf(), that
controls the formatting of information about memory regions. The
formats include:
Format Description
< Memory object code size
= Memory object data size
> Memory object address
? Memory object offset
M Memory owned by the PID
: (colon) Memory object name
; (semicolon) Offset
If you don’t specify a format, the default is the empty string, "".
-n node The name of the remote node from which to get the information.
-P pid Show only the process family you’re interested in (pid may be a name
or number).
-p pid Show only the process you’re interested in (pid may be a name or
number).
If the pid is a number, it’s interpreted as a process ID; otherwise, it’s interpreted as a
name.
Don’t assign a numerical name to a process.
The shorthand name is one of the following. You need to type only as many characters
of the name as are required to uniquely identify it.
channels Display the lengths of the send, receive, reply and pulse queues.
This shorthand is useful if you’re trying to track pulse leaks —
that is, a process not receiving pulses. This can cause a growth in
kernel memory usage, since pulse structures are allocated in the
kernel.
The extsched shorthand was added in the QNX Neutrino Core OS 6.3.2.
family Show the sessions, process groups, parents, siblings, and children
of the displayed processes.
The fds shorthand was added in the QNX Neutrino Core OS 6.3.2.
Flag Value
_NTO_PF_NOCLDSTOP 0x00000001
_NTO_PF_LOADING 0x00000002
_NTO_PF_TERMING 0x00000004
_NTO_PF_ZOMBIE 0x00000008
_NTO_PF_NOZOMBIE 0x00000010
_NTO_PF_FORKED 0x00000020
_NTO_PF_ORPHAN_PGRP 0x00000040
_NTO_PF_STOPPED 0x00000080
_NTO_PF_DEBUG_STOPPED 0x00000100
_NTO_PF_BKGND_PGRP 0x00000200
_NTO_PF_NO_LIMITS 0x00000400
_NTO_PF_CONTINUED 0x00000800
continued. . .
Flag Value
_NTO_PF_CHECK_INTR 0x00001000
_NTO_PF_COREDUMP 0x00002000
_NTO_PF_PTRACED 0x00004000
_NTO_PF_RING0 0x00008000
_NTO_PF_SLEADER 0x00010000
_NTO_PF_WAITINFO 0x00020000
_NTO_PF_VFORKED 0x00040000
_NTO_PF_DESTROYALL 0x00080000
_NTO_PF_NOCOREDUMP 0x00100000
_NTO_PF_NOCTTY 0x00200000
_NTO_PF_THREADWATCH 0x80000000
irqs Show the IRQ handlers owned by the process. For each handler,
pidin shows:
mapinfo Show information about memory mappings. The output looks like
this:
4101 8 proc/boot/io-usb 10o RECEIVE 80K 424K 4096(20K)
libc.so.3 @b0300000 452K 16K
devu-uhci.so @b8200000 24K 4096
devu-ohci.so @b8207000 24K 4096
devu-ehci.so @b820e000 28K 4096
Mapped Phys Memory @40100000 (ee000000) 12K S
It includes:
• the memory object’s name, or Mapped Phys Memory for
mapped physical memory
• the memory object’s address, followed by the offset if
applicable
• the object’s code and data sizes
• the memory object’s flags, which can include:
- ANON — MAP_PRIVATE, MAP_ANON
- E — MAP_ELF
- F — MAP_FIXED
- P — MAP_PRIVATE
- S — MAP_SHARED
For more information about these flags, see mmap() in the
QNX Neutrino Library Reference.
net Display system information about all the nodes on the Qnet
network.
The rmasks shorthand was added in the QNX Neutrino Core OS 6.3.2.
The sched shorthand was added in the QNX Neutrino Core OS 6.3.2.
session Sort by session ID, then process ID. By default, pidin sorts the
output by process ID.
syspage Show the syspage entry. You can specify which section to print
by indicating a name (e.g. the command pidin
syspage=asinfo displays the asinfo section). The default is
all. For more information, see “Structure of the system page” in
the Customizing Image Startup Programs chapter of Building
Embedded Systems.
threads Show the thread name; if a thread doesn’t have a name, pidin
displays the thread’s ID (tid) instead.
timers Show the timers owned by the process. For each timer it shows:
• id — the timer ID returned by TimerCreate().
• tid — the thread ID associated with this timer (0 for the entire
process).
• overruns — the number of overruns.
• clock_type — the type of clock used. Valid descriptions
include:
- REAL — CLOCK_REALTIME
- SOFT — CLOCK_SOFTTIME
- MONO — CLOCK_MONOTONIC
• flags — the timer flag. Valid flags include:
- X — _NTO_TI_EXPIRED
- A — _NTO_TI_ABSOLUTE
- a — _NTO_TI_ACTIVE
• msec — the time left before expiry, in milliseconds.
• interval_msec — the timer interval, in milliseconds.
• event — the description of the sigevent to be delivered on
timer expiry. Valid event descriptions are listed for the irq
shorthand.
CPU usage is calculated by sampling. When the timer interrupt occurs, the kernel
determines which process is running, and adds the time to the total running times of
the active thread and its process. If the kernel itself is active, it also adds the time to
the system times (stime) of the active thread and its process. The utime is the total
running time minus the system time.
As a result, these times are approximate, and can be inaccurate (e.g. if a process is
driven by the timer interrupt). To determine more accurate times, use the system
profiler. For more information, see the System Analysis Toolkit User’s Guide, or the
Analyzing Your System with Kernel Tracing chapter of the IDE User’s Guide.
users Display the real, effective, and saved user IDs and group IDs for
the user who launched the processes. This option doesn’t display
the user name or group name, just the numerical IDs.
Description:
The pidin utility displays statistics about the processes running on a QNX Neutrino
system.
By default, pidin displays the statistics once and then exits. If you specify the -l,
pidin loops forever, displaying statistics after the delay specified by the -d option.
If you specify the -l and -k options, pidin loops until a error occurs, displaying
statistics after the given delay. The most common error encountered is a race
condition: procnto indicates that a process exists, but the process is gone when
pidin queries it.
If you want to find out how much space the image file system (IFS) occupies in the
memory, run the following command:
pidin syspage=asinfo
and look for the lines with imagefs. See the output in the display as shown in the
example below.
State Value
CONDVAR Address of the condvar
JOIN Thread ID of the blocking thread
MUTEX The address of the mutex, or the IDs of the process and thread
blocked on, followed by the number of times locked, in the form
pid-tid #times
RECEIVE ID of the channel within the process that the thread is blocked on
REPLY Process ID
SEM Address of the semaphore
SEND Process ID
STACK Stack size
WAITPAGE Virtual address of the page
WAITTHREAD Thread ID of the blocking thread
Examples:
The pidin command prints a listing similar to this:
pid tid name prio STATE Blocked
1 1 /sys/procnto-instr 0f READY
1 3 /sys/procnto-instr 10r RUNNING
1 4 /sys/procnto-instr 12r RECEIVE 1
1 5 /sys/procnto-instr 12r RECEIVE 1
1 6 /sys/procnto-instr 12r RECEIVE 1
1 11 /sys/procnto-instr 12r RECEIVE 1
1 12 /sys/procnto-instr 10r RECEIVE 1
1 13 /sys/procnto-instr 10r RECEIVE 1
1 15 /sys/procnto-instr 255r RECEIVE 1
1 16 /sys/procnto-instr 10r RECEIVE 1
1 17 /sys/procnto-instr 10r RECEIVE 1
2 1 sbin/tinit 10o REPLY 1
Using pidin -F "%I %60N" displays the PID and TID, along with up to 60
characters of the processes’ short name:
pid-tid name
1-01 rldbuild/cdr/qnx6/tmp/target/qnx6/x86/boot/sys/procnto-instr
1-03 rldbuild/cdr/qnx6/tmp/target/qnx6/x86/boot/sys/procnto-instr
1-04 rldbuild/cdr/qnx6/tmp/target/qnx6/x86/boot/sys/procnto-instr
1-05 rldbuild/cdr/qnx6/tmp/target/qnx6/x86/boot/sys/procnto-instr
1-06 rldbuild/cdr/qnx6/tmp/target/qnx6/x86/boot/sys/procnto-instr
1-11 rldbuild/cdr/qnx6/tmp/target/qnx6/x86/boot/sys/procnto-instr
1-12 rldbuild/cdr/qnx6/tmp/target/qnx6/x86/boot/sys/procnto-instr
1-13 rldbuild/cdr/qnx6/tmp/target/qnx6/x86/boot/sys/procnto-instr
1-15 rldbuild/cdr/qnx6/tmp/target/qnx6/x86/boot/sys/procnto-instr
1-16 rldbuild/cdr/qnx6/tmp/target/qnx6/x86/boot/sys/procnto-instr
1-17 rldbuild/cdr/qnx6/tmp/target/qnx6/x86/boot/sys/procnto-instr
2-01 sbin/tinit
3-01 proc/boot/slogger
5-01 proc/boot/pci-bios
6-01 proc/boot/devb-eide
...
See also:
hogs, ps, showmem, top
QNX Neutrino Microkernel chapter of the System Architecture guide
Fine-Tuning Your System in the Neutrino User’s Guide
Syntax:
pin [-s socket] [command]
Runs on:
Neutrino
Options:
-s socket Display information about this PC Card socket only (starting at 1).
Description:
The pin utility displays useful information about PC Card resources, servers and
cards.
The command specifies the type of information to be displayed:
status Show the status of each socket. This is the default command.
See also:
devp-pccard, pccard-launch
Connecting Hardware in the Neutrino User’s Guide
Syntax:
ping [-aDdfLnoPQqRrv] [-c count] [-E policy] [-g gateway]
[-h host] [-I ifaddr] [-i wait] [-i interval]
[-l preload] [-p pattern] [-s packetsize] [-t tos]
[-T ttl] [-w maxwait] host
Runs on:
Neutrino
Options:
-a Emit an audible beep (by sending an ASCII BEL character to the
standard error output) after receiving each non-duplicate response.
For the sake of your sanity, this option is disabled if you use the -f
option to do a flood ping.
Only the superuser (root) may use the -f option; it can be very hard on a network —
use it with caution.
-h host Alternate way of specifying the target host instead of as the last
argument.
-i interval Wait interval seconds between sending each packet (default is one
second). For the -f option, the interval is 0.01 seconds.
-p pattern Fill out the packet with this many “padding” bytes (maximum is
16). You should find this useful for diagnosing data-dependent
problems in a network. For example, -p ff causes the sent packet
to be filled with ones.
-s packetsize Send this many data bytes. The default is 56, which translates into
64 ICMP data bytes when combined with the 8 bytes of ICMP
header data.
-T ttl Use the specified time-to-live. It represents how many hops the
packet can go through before being discarded (when it reaches 0).
The default is 255.
Description:
The ping utility uses the ICMP protocol’s mandatory ECHO_REQUEST datagram to
elicit an ICMP ECHO_RESPONSE from the given host or gateway.
ECHO_REQUEST datagrams, known as pings, have an IP and ICMP header,
followed by a timeval structure and then an arbitrary number of padding bytes used
to fill out the packet.
This utility needs to have the setuid (“set user ID”) bit set in its permissions. If you use
mkefs, mketfs, or mkifs on a Windows host to include this utility in an image, use
the perms attribute to specify its permissions explicitly, and the uid and gid
attributes to set the ownership correctly.
When using ping for isolating faults, you should first run it on the local host to verify
that the local network interface is up and running. You should then ping hosts and
gateways further and further away. Round-trip times and packet-loss statistics are
computed. If duplicate packets are received, they aren’t included in the packet-loss
calculation, although the round-trip time of these packets is used in calculating the
minimum/average/maximum round-trip time numbers. When the specified number of
packets has been sent (and received), or if you terminate ping with a SIGINT, a brief
summary is displayed.
The ping utility is intended for testing, measuring, and managing networks. Because
of the load it can impose on the network, you shouldn’t use ping during normal
operations or from automated scripts.
Debugging
You can use the ping utility to determine if you have connectivity to other hosts.
Suppose you’ve configured a point-to-point link (PPP), but you haven’t specified a
default route. You can type the following to see if you’re connected to the other end of
the link:
ping isp.com
This report continues until ping is terminated. To terminate ping, press Ctrl-C. You’ll
see a report like this:
--- isp.com ping statistics ---
7 packets transmitted, 7 packets received, 0% packet loss
round-trip min/avg/max = 0/0/0 ms
• If nothing is displayed, ping may be having problems resolving the hostname. Try
the IP address directly to bypass the resolver (see the /etc/nsswitch.conf file).
• If only the first line of the above successful output is displayed, then ping isn’t
receiving a response from the specified host.
• All other problems and errors result in an obvious message (e.g. “No route to
host”).
The (inter)network layer should never treat packets according to the data contained in
the data portion. Unfortunately, data-dependent problems have been known to sneak
into networks and remain undetected for long periods of time. In many cases, the
particular pattern that will have problems is something that doesn’t have sufficient
“transitions,” such as all ones or all zeros, or a pattern right at the edge, such as almost
all zeros. It isn’t necessarily enough to specify a data pattern of all zeros, for example,
on the command line because the pattern of interest is at the data-link level—the
relationship between what you type and what the controllers transmit can be
complicated.
So if you have a data-dependent problem, you’ll probably have to do a lot of testing to
find it. If you’re lucky, you may manage to find a file that either can’t be sent across
your network or that takes much longer to transfer than other similar length files. You
can then examine this file for repeated patterns that you can test using the -p option.
TTL details
The TTL value of an IP packet represents the maximum number of IP routers that the
packet can go through before being thrown away. In current practice you can expect
each router in the Internet to decrement the TTL field by exactly one. The TCP/IP
specification states that the TTL field for TCP packets should be set to 60, but many
systems use smaller values (4.3 BSD uses 30, 4.2 uses 15).
The maximum possible value of this field is 255, and most UNIX systems (including
QNX) set the TTL field of ICMP ECHO_REQUEST packets to 255. Thus you’ll find
you can “ping” some hosts, but not reach them with telnet or ftp.
In normal operation, ping prints the ttl value from the packet it receives. When a
remote system receives a ping packet, it can do one of three things with the TTL field
in its response:
• Not change it — this is what Berkeley UNIX systems did before the 4.3BSD-Tahoe
release. The TTL value in the received packet is 255 minus the number of routers
in the round-trip path.
• Set it to 255 — this is what current Berkeley UNIX systems do. The TTL value in
the received packet is 255 minus the number of routers in the path from the remote
system to the pinging host.
• Set it to some other value — some machines use the same value for ICMP packets
that they use for TCP packets; for example, either 30 or 60. Others may use
completely wild values.
Files:
The ping utility requires the libsocket.so shared library.
Exit status:
0 Success (the host is alive).
Nonzero An error occurred. The arguments are incorrect or the host isn’t
responding.
Syntax:
ping6 [-dfHnNqRvw] [-a addrtype] [-b bufsiz] [-c count]
[-h hoplimit] [-I interface] [-i wait] [-l preload]
[-p pattern] [-P policy] [-S sourceaddr] [-s packetsize]
[hops...] host
Runs on:
Neutrino
Options:
-a addrtype Generate an ICMPv6 Node Information Node Addresses query
(rather than ECHO_RESPONSE), where addrtype is a string
constructed from the following characters:
Only the superuser (root) may use the -f option; it can be very hard on a network —
use it with caution.
-I interface Source packets with the given interface address. This flag applies
if the ping destination is a multicast address, or a
link-local/site-local unicast address.
-i wait Wait this many seconds between sending each packet (default is
one second). This option is incompatible with -f.
-p pattern Fill out the packet with this many “pad” bytes (maximum is 16).
You should find this useful for diagnosing data-dependent
problems in a network. For example, -p ff causes the sent packet
to be filled with ones. If specified with -q, any ICMP error
messages caused by its own ECHO_REQUEST messages are
printed.
-R Make the kernel believe that the target host (or the first hop if you
specify hops) is reachable by injecting an upper-layer reachability
confirmation hint. The option is meaningful only if the target host
(or the first hop) is a neighbor.
-S sourceaddr Specify the source address of request packets. The source address
must be one of the unicast addresses of the sending node. If the
outgoing interface is specified by the -I option as well, sourceaddr
needs to be an address assigned to the specified interface.
-s packetsize Send this many data bytes. The default is 56, which translates into
64 ICMP data bytes when combined with the 8 bytes of ICMP
header data. You may also need to specify -b to extend socket
buffer size.
-W Same as -w, but use the old packet format based on 03 draft. This
option is present for backward compatibility.
hops The IPv6 addresses for intermediate nodes, which are put into a
type 0 routing header.
Description:
The ping6 utility uses the ICMPv6 protocol’s mandatory ICMP6_ECHO_REQUEST
datagram to elicit an ICMP6_ECHO_RESPONSE from the given host or gateway.
ICMP6_ECHO_REQUEST datagrams, known as pings, have an IPv6 header, and
ICMPv6 header formatted as documented in RFC 2463.
This utility needs to have the setuid (“set user ID”) bit set in its permissions. If you use
mkefs, mketfs, or mkifs on a Windows host to include this utility in an image, use
the perms attribute to specify its permissions explicitly, and the uid and gid
attributes to set the ownership correctly.
When using ping6 for isolating faults, you should first run it on the local host to
verify that the local network interface is up and running. You should then “ping” hosts
and gateways further and further away. Roundtrip times and packet-loss statistics are
computed. If duplicate packets are received, they aren’t included in the packet-loss
calculation, although the roundtrip time of these packets is used in calculating the
minimum/average/maximum roundtrip time numbers. When the specified number of
packets has been sent (and received), or if you terminate ping6 with a SIGINT, a brief
summary is displayed.
The ping6 utility is intended for testing, measuring, and managing networks. Because
of the load it can impose on the network, you shouldn’t use ping6 during normal
operations or from automated scripts.
Files:
The ping6 utility requires the libsocket.so shared library.
Exit status:
0 Success (the host is alive).
Nonzero An error occurred. The arguments are incorrect or the host isn’t
responding.
See also:
ifconfig, netstat, ping, routed, traceroute, traceroute6
Based on:
• A. Conta, and S. Deering, Internet Control Message Protocol (ICMPv6) for the
Internet Protocol Version 6 (IPv6) Specification, RFC 2463, December 1998.
Syntax:
pipe [-1] [-a atomic_write_size]
[-P] [-s pipe_buffer_size] &
Runs on:
Neutrino
Options:
-1 ("One") Unblock select() for writing when _PC_PIPE_BUF bytes are
available (the default is 1 byte). See the description section to know about
_PC_PIPE_BUF.
-a atomic_write_size
Set the atomic write size for _PC_PIPE_BUF (the default is 5120 bytes). See
the description section to know about _PC_PIPE_BUF.
-s pipe_buffer_size
Set the total buffer size (the default is 5120 bytes).
All these options were added in the QNX Neutrino Core OS 6.3.2.
Description:
The pipe manager implements the subset of file I/O known as pipes (or anonymous
FIFOs). A simple form of interprocess communication, pipes are mostly used to
connect the output of one process to the input of another to form a series of filters.
This version of pipe is backward compatible. When you invoke pipe with no
arguments, the behavior you get is identical to that of the earlier versions of pipe.
The atomic_write_size is the size for which it’s guaranteed that a write() of data won’t
be interleaved with data from any other process; in other words the amount of data that
will be written atomically. This is required when there are multiple writers sending
data to a single reader. The POSIX maximum is referred to as PIPE_BUF, and can be
queried at runtime using fpathconf(_PC_PIPE_BUF). It isn’t recommended to
lower this value from the default 5120 bytes in case application code is using the
PIPE_BUF manifest from <limits.h> rather than a runtime fpathconf()
determination.
The pipe_buffer_size is the total buffer size of the pipe (and must be at least the
atomic write size). Effectively the pipe utility can hold this many (unread) bytes
before write() clients start to block or fail with EAGAIN (based on their
O_NONBLOCK orientation).
There is no simple mechanism (such as fpathconf()) to query the pipe-buffering
capacity, but it can be determined by writing one byte at a time to an empty
O_NONBLOCK pipe and counting how many are consumed until an EAGAIN error
(full-pipe indication) is returned. Increasing this value could make pipelines more
elastic, in terms of decoupling the writer from the reader processes, at the expense of
using extra system memory for each pipe. Across a sample of OSs, pipe-buffering
capacity is in the 4–16 KB range.
Strict POSIX conformance requires that the atime and mtime attributes of a FIFO be
updated for every read() and write() operation. As FIFOs operate by redirecting access
of the FIFO from the host filesystem to the pipe server, maintaining these attributes
requires additional synchronization messages from the pipe server back to the host
filesystem. In most cases, this level of synchronization isn’t required, and by default is
performed only at the last close() of the FIFO. For strict POSIX conformance, specify
the -P option.
The -1 option sets the behavior for select() write notification of the pipe utility. The
original behavior was to satisfy or unblock select() clients even if 1 byte of buffer
space was available. POSIX specifies a different behavior. Since the atomic write size
and the total buffer size are both equal to 5120 bytes, select() would be satisfied only
on an empty pipe, which may impact performance or establish a lock-step timing
between the writing and reading processes. If this option is enabled, consider also
increasing the -s to be larger than PIPE_BUF so that the pipe doesn’t have to
completely drain before a select() for write is satisfied.
Exit status:
The pipe utility terminates only if an error occurs during startup. If pipe fails during
startup, it prints a diagnostic message to the standard output stream and then exits with
a nonzero status.
See also:
mqueue
Controlling How Neutrino Starts in the Neutrino User’s Guide
Syntax:
pppd [options]
Runs on:
Neutrino
Options:
For details about the options, see
http://netbsd.gw.com/cgi-bin/man-cgi?pppd++NetBSD-4.0 in the
NetBSD documentation. The following options are supported by NetBSD but aren’t
documented there:
QNX Neutrino supports multilink PPP, so our pppd daemon supports the following
options, contrary to what the NetBSD documentation says:
• mp
• mpshortseq
• mrru
• multilink
• nomp
• nompshortseq
• nomultilink
• pass-filter
+stdinsecret Read PAP or CHAP secrets from standard input. If you use this
option, you need to specify explicitly a serial device on the
command line.
usefd filedes Use this file descriptor to send or receive pppd packets instead
of opening a tty_name.
useuserdns nameserver_IP
Specify the nameserver to use. This overrides any nameservers
provided by the server.
Description:
The pppd daemon is used to establish TCP/IP serial connections using the
point-to-point protocol (PPP). For more information, see
http://netbsd.gw.com/cgi-bin/man-cgi?pppd++NetBSD-4.0 in the
NetBSD documentation.
This utility needs to have the setuid (“set user ID”) bit set in its permissions. If you use
mkefs, mketfs, or mkifs on a Windows host to include this utility in an image, use
the perms attribute to specify its permissions explicitly, and the uid and gid
attributes to set the ownership correctly.
Caveats:
The following signals have the specified effect when sent to the pppd process:
SIGINT, SIGTERM
These signals cause pppd to terminate the link (by closing LCP),
restore the serial device settings, and exit.
SIGHUP Indicates that the physical layer has been disconnected; pppd attempts
to restore the serial device settings and then exits.
If you spawn pppd from another program and specify the nodetach or updetach
option, and if a signal is dropped on pppd while it’s running a connect or disconnect
script, pppd raises the signal on the entire process group, including the parent (i.e. the
program that spawned pppd). This could cause the parent to terminate unexpectedly.
To avoid this, spawn pppd with the SPAWN_SETGROUP set in the inheritence
structure. For more information, see spawn() in the Neutrino Library Reference.
See also:
/etc/autoconnect, chat, devc-*, io-pkt*, pppoed, syslogd
http://netbsd.gw.com/cgi-bin/man-cgi?pppd++NetBSD-4.0 in the
NetBSD documentation.
Based on RFC 1144, RFC 1321, RFC 1332, RFC 1334, RFC 1549, RFC 1661, RFC
1662, RFC 1962, RFC 1990
Syntax:
pppoectl [-v] ifname [parameter[=value]] [...]
pppoectl -e ethernet-ifname [-s service-name]
[-a access-concentrator-name] [-d] [-n 1 | 2] ifname
pppoectl -f config-file ifname [...]
Runs on:
Neutrino
Options:
-e ethernet-ifname The Ethernet interface to use to communicate with the access
concentrator (typically via a DSL modem).
-a access-concentrator-name
The name of the access concentrator.
Description:
The pppoectl utility displays or sets parameters for a pppoe interface. There are two
basic modes of operation:
The latter usage is indicated by the presence of the -e option, which takes the name of
the Ethernet interface as its argument. You don’t typically specify both the access
concentrator name and the service name.
Supported parameters
The currently supported parameters include:
authproto=protoname
Set both his and my authentication protocol to protoname. The
protocol name can be one of chap, pap, or none. In the latter
case, the use of an authentication protocol is turned off for the
named interface. This has the side-effect of clearing the other
authentication-related parameters for this interface as well (i.e.
the system name and authentication secret will be forgotten).
myauthproto=protoname
Same as authproto, but only for my end of the link. In other
words, this is the protocol when the remote is the authenticator,
and I am the peer required to authenticate.
hisauthproto=protoname
The same as authproto, but only for his end of the link.
hisauthname=name
Set his system name for the authentication protocol. For CHAP,
this is used only as a hint, causing a warning message if the
remote supplied a different name. For PAP, it’s the name remote
must use to authenticate itself (in connection with its secret).
myauthsecret=secret
Set my secret (key, password) for use in the authentication
phase. For CHAP, this is used to compute the response hash
value, based on remote’s challenge. For PAP, it’s transmitted as
plain text together with the system name. Don’t forget to quote
the secrets from the shell if they contain shell metacharacters
(or white space).
hisauthsecret=secret
Similar to myauthsecret, to be used if we are the
authenticator, and the remote peer needs to authenticate.
callin Require the remote to authenticate itself only when it’s calling
in, but not when we’re the caller. This is required for some
peers that don’t implement the authentication protocols
symmetrically (such as Ascend routers, for example).
norechallenge Meaningful only with CHAP. Don’t rechallenge a peer once the
initial CHAP handshake was successful. Use this to work
around broken peer implementations that can’t handle being
rechallenged once the connection is up.
idle-timeout=idle-seconds
For services that are charged by connection time, the interface
can optionally disconnect after a configured idle time. If set to
0, this feature is disabled.
For ISDN devices, it’s preferable to use the isdnd-based timeout mechanism, as
isdnd can predict the next charging unit for ISDN connections and optimize the
timeout with this information.
lcp-timeout=timeout-value
Change the value of the LCP timeout. The default value of the
LCP timeout is currently 1 second. Specify the timeout-value
in milliseconds.
max-noreceive=sec
Set the number of seconds after the last reception of data from
the peer before the line state is probed by sending LCP echo
requests. The sec interval isn’t used verbatim; the first echo
request might be delayed up to 10 seconds after the configured
interval.
max-alive-missed=count
Set the number of unanswered LCP echo requests to tolerate
before considering a connection to be dead. LCP echo requests
are sent in 10-second intervals after the configured
max-noreceive interval has passed with no data received
from the peer.
max-auth-failure=count
Since some ISPs disable accounts after too many unsuccessful
authentication attempts, there is a maximum number of
authentication failures before we will stop retrying without
manual intervention. Manual intervention is either changing the
authentication data (name, password) or setting the maximum
retry count. If count is set to 0, this feature is disabled.
clear-auth-failure
If an authentication failure has been caused by remote
problems, and you want to retry connecting using unchanged
local settings, you can use this command to reset the failure
count to zero.
query-dns=flags During PPP protocol negotiation, we can query the peer for
addresses of two name servers. If flags is 1, only the first server
address is requested; if flags is 2, the second is requested.
Setting flags to 3 queries both.
You can retrieve the result of the negotiation with the -n option.
Examples:
The following example is the complete sequence of commands to bring a PPPOE
connection up:
# Configure authentication
pppoectl pppoe0 myauthproto=pap myauthname=XXXXX \
myauthsecret=YYYYY hisauthproto=none
In order to be configured as a PPPOE server, you should set the pppoe interface to use
link0 mode, so that it can wait for incoming PPPOE session requests. For example,
the following makes the interface wait for requests coming from the en0 interface:
Files:
/dev/io-net/ppp_en
The default PPPOE device.
/etc/ppp/pppoe-down
The default downscript.
/etc/ppp/pppoe-up
The default upscript.
See also:
io-pkt, pppd
TCP/IP Networking in the Neutrino User’s Guide
If you find pppoed has problems connecting to certain sites on the Internet, take a
look at the technote PPPOE and Path MTU Discovery.
Syntax:
pppoed
Runs on:
Neutrino
Options:
None.
Description:
The pppoed binary is a shim layer that phdialer uses to dial up PPPOE. PPP over
Ethernet is now part of the io-pkt* stack; for more information, see the entry for
pppoectl.
See also:
io-pkt*, phdialer, pppoectl
TCP/IP Networking in the Neutrino User’s Guide
If you find pppoed has problems connecting to certain sites on the Internet, take a
look at the technote PPPOE and Path MTU Discovery.
Syntax:
pps [options]
Runs on:
QNX Neutrino
Options:
-b Do not run in the background. Useful for debugging.
Description:
The pps program manages the Persistent Publish/Subscribe system, which provides a
simple method of disseminating information to interested processes.
See also:
Persistent Publish/Subscribe Developer’s Guide
Syntax:
pr [+page] [-column] [-adFmrt] [-e[char][gap]]
[-L locale] [-h header]
[-i[char][gap]] [-l lines]
[-o offset] [-s[char]] [-n[char][width]]
[-w width] [file ...]
Runs on:
Neutrino
Options:
In the following option descriptions, column, lines, offset, page, and width are positive
decimal integers, and gap is a nonnegative decimal integer.
Options -e, -i, -n, and -s, do not use spaces to separate options and arguments.
-column Produce output that is columns wide (the default is 1). The text is
written vertically down each column in the order in which it is
received from the input file. The options -e and -i are assumed.
Don’t use this option with -m. If you want to display the output
using the minimum number of lines, use with -t.
-a Modify the effect of the -column option so that the columns are
filled across the page in a round-robin order (e.g. when column is
2, the first input line heads column 1, the second heads column 2,
the third is the second line in column 1, etc.). If you use this
option, you must also use the -column option.
-e[char][gap] Expand each input tab to the next greater column position
specified by the formula n*gap+1, where n is an integer > 0. If
gap is zero or is omitted, the default is 8. All tab characters in the
input are expanded into the appropriate number of spaces. If char
(any nondigit character) is specified, it is used as the input tab
character.
-h header Use the string header to replace the file name in the header line.
-i[char][gap] In the output, replace multiple spaces with tabs whenever two or
more adjacent spaces reach column positions gap+1, 2*gap+1,
etc. If gap is zero or omitted, the default tab settings are at every
eighth column position. If char (any nondigit character) is
specified, it is used as the output tab character.
-L locale Use the locale specified as argument instead of one found in the
environment. Use C to reset locale to its default.
-l lines (“el”) Override the 66-line default and reset the page length to
lines. If lines is not greater than the sum of both the header and
trailer depths (in lines), the pr utility suppresses output of both
the header and trailer, as if the -t option were in effect.
-m Merge the contents of multiple files. One line from each file
specified by a file operand is written side by side into text
columns of equal fixed widths, in terms of the number of column
positions. The number of text columns depends on the number of
file operands successfully opened. The maximum number of files
merged depends on page width and the per-process open file
limit. The options -e and -i are assumed.
-n[char][width] Provide width-digit line numbering. The default for width, if not
specified, is 5. The number occupies the first width column
positions of each text column or each line of -m output. If char
(any nondigit character) is given, it is appended to the line
number to separate it from whatever follows. The default for char
is a tab. Line numbers longer than width columns are truncated.
-o offset Each line of output is preceded by offset spaces. If the -o option
is not specified, the default is zero. The space taken is in addition
to the output line width.
-r Inhibit the warning when a file can’t be opened.
-s[char] Separate text columns by the single character char instead of by
the appropriate number of spaces (the default for char is the tab
character).
-t Print neither the five-line identifying header nor the five-line
trailer usually supplied for each page. Quit printing after the last
line of each file without spacing to the end of the page.
-w width Set the width of the line to width column positions for multiple
text-column output only. If the -w option is not specified and the
-s option is not specified, the default width is 72. If the -w
option is not specified and the -s option is specified, the default
width is 512.
file A pathname of a file to be printed. If no file operands are
specified, or if a file operand is “-”, the standard input is used.
Description:
The pr utility is a printing and pagination filter for text files. When multiple input files
are specified, each is read, formatted, and written to standard output. By default, the
input is separated into 66-line pages, each with:
• A 5-line header with the page number, date, time, and the pathname of the file.
Exit status:
0 Success.
1 An error occurred.
Errors:
If pr receives an interrupt while printing to a terminal, it flushes all accumulated error
messages to the screen before terminating. Error messages are written to stderr during
the printing process (if output is redirected) or after all successful file printing is
complete (when printing to a terminal).
Contributing author:
Keith Muller
License:
This utility is based on copyright software of The Regents of the University of
California; for licensing information, see the Third Party License Terms List at
http://licensing.qnx.com/third-party-terms/.
See also:
cat, fold, lpr, more
Syntax:
preview [-c colors] [-D debug_fname] [-d]
[-h height[%]] [-L] [-M] [-S i|m|n] [-s server]
[-U file] [-V] [-w width[%]]
[-x position[%][r]] [-y position[%][r]]
filename
Runs on:
Neutrino
Options:
-c colors Force size of color palette.
-U file Delete this file when the print job is completed. Use for
synchronizing print-spooling operations.
Description:
View the page to be printed.
Examples:
View the file webpage.phs:
preview webpage.phs
See also:
Printing in the Neutrino User’s Guide
Name:
/etc/printcap
Description:
The printcap database is a simplified version of the termcap database for
describing printers. The spooling system accesses the printcap file every time it’s
used, so you can dynamically add or remove printers. Each entry in the database
describes one printer.
Note that you can’t replace this database — as you can for termcap — because that
might allow accounting to be bypassed.
The default printer is normally lp, although you can use the environment variable
PRINTER to override this. Each spooling utility supports a -Pprinter option to
explicitly name a destination printer.
Each entry in the printcap file describes a printer. An entry is a line consisting of a
number of fields separated by : characters. The first entry for each printer gives the
known names for the printer, separated by | characters.
The first name is conventionally a number. The second name is the most common
abbreviation for the printer; the last name should be a long name fully identifying the
printer. The second name should contain no blanks; the last name may well contain
blanks for readability. Entries may continue onto multiple lines by giving a \ as the
last character of a line. Empty fields may be included for readability.
Capabilities in printcap are all introduced by two-character codes and are of these
types:
Boolean Indicates that the printer has some particular feature. Boolean
capabilities are simply written between the : characters.
Numeric Information such as baud rate, number of lines per page, and so on.
Numeric capabilities are given by the two-character capability code
followed by the # character, followed by the numeric value. The
following example is a numeric entry stating that this printer should run
at 1200 baud:
:br#1200:
Capabilities
continued. . .
If the local line printer driver supports indentation, the daemon must understand how
to invoke it.
Note that the fs, fc, xs, and xc fields are flag masks rather than values. Certain
default device flags are set when the device is opened by the line printer daemon if the
device is connected to a terminal port. The flags indicated in the fc field are then
cleared; the flags in the fs field are then set (or vice versa, depending on the order of
fc#nnnn and fs#nnnn in the /etc/printcap file).
The bits cleared by the fc field and set by the fs field are those in the sg_flags field
of the sgtty structure, as set by the TIOCSETP ioctl() call, and the bits cleared by the
xc field and set by the xs field are those in the “local flags” word, as set by the
TIOCLSET ioctl() call. See <sys/termio.h> for a description of these flags.
For example, to set exactly the flags 06300 in the fs field, which specifies that the
EVENP, ODDP, and XTABS modes are to be set and that all other flags are to be
cleared, do:
:fc#0177777:fs#06300:
The same process applies to the xc and xs fields. Alternatively, you can use the ms
field to specify modes to be set and cleared. These modes are specified as stty
modes; you can specify any mode supported by stty, except for the baud rate (which
you must specify with the br field).
For example, to set the terminal port (to which the printer is attached) to even parity,
TAB expansion, no NEWLINE to RETURN/LINEFEED translation, and RTS/CTS
flow control enabled, do the following:
:ms=evenp,-tabs,nl,crtscts:
The tc field must appear last in the list of capabilities. Each type of printer should
have a general entry describing common capabilities. Then an individual printer can
be defined with its particular capabilities, plus a tc field that points to the general
entry for that type of printer.
For information about setting up the printcap file, see the Printing chapter of the
Neutrino User’s Guide.
See also:
lpd, lpr, lprc, lprq, lprrm
Printing chapter of the Neutrino User’s Guide
Syntax:
printf format [argument...]
Runs on:
Neutrino
Options:
format A string describing how the given arguments are to be formatted.
Description:
The printf utility writes formatted arguments to standard output under control of the
format control string (the syntax for format is based upon the printf() function).
The format control string contains the following types of characters:
• Ordinary characters that are written exactly as they occur in the format string
• Conversion specifications that specify the output format of the named arguments.
Space If the first character of a conversion isn’t a sign, prefix a space to the result.
Field width
An optional decimal integer that specifies the minimum number of characters for
displaying the formatted item. If no field width is specified, or if the value is less than
the number of characters required to represent the converted value (subject to the
specified precision), a field of sufficient width to contain the converted value is used.
If the number of characters required to represent the converted value is less than the
field width, the value is padded on the left (or on the right if the - format control flag
is given) with spaces or “0” (zero) characters. If the field width begins with a zero, the
value is padded with zeros, otherwise spaces.
Precision
An optional decimal integer following a period character (.). The effect of the given
precision depends on the conversion character you specify (see “Conversion
character,” below).
Type length
An optional character that modifies the interpreted size of the conversion character.
The only supported type length character is l (“el”), which causes a d, i, o, u, X, or x
conversion to process a long int or unsigned long int argument.
Conversion character
A character that determines the type of conversion to be applied. For example, if d is
specified, printf treats the corresponding argument as a decimal integer. The
conversion characters are:
[-]d[.ddd]e{+|-}dd
[-]ddd.ddd
Escape sequences
The printf utility interprets the character escape sequences within the format string
in a way similar to the C programming language. These sequences, which you
introduce via the backslash character (\), are translated as follows:
Examples:
Display the string “hello, world” on a line by itself:
printf "hello, world\n"
Do the same as above, but don’t output a newline:
Exit status:
0 Successful completion.
See also:
echo, ksh’s print command
Syntax:
prjobs [-h height[%]] [-r] [--Si|m|n]
[-s server_name] [-w width[%]]
[-x position[%][r]] [-y position[%][r]]
Runs on:
Neutrino
Options:
-h height[%] The height of the window, in pixels, or as a percentage of the
screen height if % is specified.
r Scan for pending jobs. If there are any, query the user as what to
do.
Description:
This utility starts the spool manager. You can start it from the command line, or you
can click its icon in the shelf:
You can use the spool manager to query and cancel print jobs.
The prjobs utility cancels print jobs by removing files from the relevant mount point
owned by spooler. The command line equivalent is:
rm /dev/printers/printer_name/spool/print_file
See also:
spooler
Printing chapter of the Neutrino User’s Guide
Syntax:
procnto* [-a d|e|s] [-c] [-e n|o] [-F number] [-fe]
[-h] [-H size] [-mmemmgr_configuration]
[-P priority] [-p] [-T timeout] [-u umask] [-v]
Runs on:
Neutrino
Options:
-ad Disable alignment fault emulation. The procnto manager doesn’t
attempt to make misaligned memory accesses work; they’ll cause a
SIGBUS signal for the offending thread.
-as Use the system default for alignment faults. This behavior depends on
your platform:
ARM -ad
MIPS -ad
PowerPC -ae
SH4 -ad
x86 -ae
-e n|o (QNX Neutrino 6.4.0 or later) Specify which value to use for
EALREADY:
• -eo — use the old value, which is the same as that of EBUSY.
• -en — use the POSIX-compliant value.
-F number The maximum number of file descriptors that can be open at the same
time. The minimum allowable value is 100. The default value is 1000,
but might be constrained by the RLIMIT_NOFILE system resource.
Sockets, named semaphores, message queues, channel IDs (chids), and connection
IDs (coids) all use file descriptors.
To determine the current limit, use the ksh builtin command,
ulimit, or call getrlimit() (see the Library Reference).
-H size Sets the initial heap size for procnto. If more memory is required for
procnto, it’s dynamically obtained; however, by setting a properly
calculated value this option can speed up boot time, and reduce the
amount of physical memory fragmentation.
The size parameter indicates the number of bytes to grow the heap in
advance. You can postfix this value with a multiplier character, such
as “k” (kilobyte) or “m” (megabyte). For example:
1m == 1024k == 0x100000
If the number is less than 1024 and it isn’t postfixed by a multiplier
character, it’s assumed to be in kilobytes. The default value is 64 KB
if the -H option isn’t specified.
-m memmgr_configuration
(QNX Neutrino Core OS 6.3.2 or later) Control the behavior of the
memory manager. The memmgr_configuration string is a sequence of
characters that enable (or if preceded with a ˜ character, disable)
memory-manager aspects.
If you specify more than one -m option, procnto ignores all but the last one.
-P priority Set the lower end of the range of privileged priorities to the given
priority; the upper end of the range is 255. Only processes with an
effective user ID of 0 (i.e. root) can use these priorities. Non-root
(and root) processes can use priorities from 1 through priority − 1.
The default value of priority is 64.
-T timeout (QNX Neutrino 6.4.0 or later) Specify the number of seconds to wait
for a close() to succeed in the event of a process termination.
-u umask (QNX Neutrino 6.4.0 or later) Use the given umask when creating the
entries in /proc/pid/as. If you don’t specify this option, procnto
uses a mask of 022. You can restrict access further, but this could
break software that relies on being able to open entries in /proc. For
more information about these files, see “/proc filesystem,” below.
Description:
The procnto system process contains the QNX Neutrino microkernel, process
management, memory management and pathname management. It’s required in all
bootable images made using the mkifs utility. For more information, see the QNX
Neutrino System Architecture guide.
To determine the release version of the kernel on your system, use the uname -a
command.
There are different versions of procnto for different processors (see the Board
Support Package for your board for specific information):
procnto-booke-smp
Power Book E SMP processors.
procnto-600-smp Other supported PowerPC SMP processors, such as the 600 and
700 series.
procnto-600 Other supported PowerPC processors, such as the 600 and 700
series.
If you’re using an SMP version of procnto, you can use the appropriate startup-*
command’s -P option to specify the maximum number of CPUs to activate.
Starting in 6.3.0, procnto also manages named semaphores, which mqueue used to
do (mqueue now manages named semaphores only if it detects that procnto isn’t
doing so). Named semaphores appear in the pathname space under /dev/sem. The
sem_* client functions handle named semaphores; for more information, see the
Neutrino Library Reference.
/proc filesystem
The Process Manager component of procnto implements a /proc filesystem that
includes the following:
/proc/pid Virtual directories that let you access and control every process
and thread running within the system. For more information, see
“Controlling processes via the /proc filesystem” in the
Processes chapter of the QNX Neutrino Programmer’s Guide.
/proc/boot/ The image filesystem that comprises the boot image. For more
information, see Making an OS Image in Building Embedded
Systems.
If you list the contents of the /proc directory, /proc/mount doesn’t show up, but
you can list the contents of /proc/mount.
/proc/qnetstats
If you’re using Transparent Distributed Processing (TDP), the
lsm-qnet.so module places a qnetstats entry in /proc. If
you open this name and read from it, the Qnet resource manager
code responds with the current statistics for Qnet.
/proc/self/ The address space for yourself (i.e. for the process that’s making
the query).
Examples:
To disable preemption in kernel code:
procnto -p
See also:
fpemu.so, mkifs, startup-*, uname
The QNX Neutrino Microkernel and Process Manager chapters of the System
Architecture guide
Processes chapter of the QNX Neutrino Programmer’s Guide
mlockall(), mmap(), munmap(), munmap_flags(), sem_close(), sem_getvalue(),
sem_open(), sem_post(), sem_trywait(), sem_unlink(), sem_wait(), ThreadCtl() in the
QNX Neutrino Library Reference
System Analysis Toolkit User’s Guide
Analyzing Your System with Kernel Tracing chapter of the IDE User’s Guide
Name:
/etc/protocols
Description:
The /etc/protocols file contains information regarding the known protocols used
in the DARPA Internet. For each protocol, a single line should be present with the
following information:
official_protocol_name protocol_number aliases
Items are separated by any number of blanks or tabs, or both. A # in a line indicates
the beginning of a comment — any characters after a #, up to the end of the line, aren’t
interpreted by routines that search the file.
Protocol names may contain any printable character other than a field delimiter,
newline, or comment character.
See also:
getprotoent() in the Library Reference
Syntax:
ps [-aAdEfl] [-[gG] grplist] [-o format]... [-n namelist]
[-p proclist] [-t termlist] [-[uU] usrlist]
Runs on:
QNX Neutrino
Options:
-a Write information for all processes associated with terminals.
-G grplist Write information for processes whose real group ID is given in the
comma- and space-delimited list, grplist.
-g grplist Write information for processes whose session leader is given in the
comma- and space-delimited list, grplist.
-p proclist Write information for processes whose ID is given in the comma and
space-delimited list, proclist.
-U usrlist Write information for processes whose real user ID or login name is
given in the comma and space-delimited list, usrlist.
-u usrlist Write information for processes whose user ID or login name is given
in the comma and space-delimited list, usrlist.
Description:
The ps utility prints information about processes, subject to having the appropriate
privilege to obtain information about those processes. With no options, ps prints
information about processes associated with the current terminal. The output includes
the process ID, terminal name, cumulative execution time, and command name of
each process.
The options that use lists (-G, -g, -o, -p, -t, -U, and -u) can list multiple items
separated by commas or white space, as long as all the items are contained within a
single command-line argument. If white space is used, you’ll probably need to quote
the list when invoking ps from the shell.
The initial set of processes selected by -a, -A, or -d is intersected with the processes
selected by the -G, -g, -p, -t, -U or -u options, if any of the latter are specified. If a
process meets any of the selection criteria, its information is displayed.
If none of -a, -A, or -d is specified, ps behaves as though you specified -u your_uid.
Controlling output
The -o option controls the information that ps displays. The format argument is a
comma- or space-delimited list of field names that represent information to be
displayed about processes and threads.
You can override the header for a field by appending an equals sign and the new
header. The rest of the characters in the argument are used as the header text. The ps
utility automatically determines the width of all columns.
The ps utility recognizes the following field names:
pcpu The ratio of CPU time used to CPU time available in a recent period of
time.
The following field names are supported, even though they aren’t required by POSIX:
Some of the above fields are thread-specific. In such cases, the value for the first
thread in the process is used.
The comm, args, and env fields are the only ones that can contain blanks.
If you don’t specify a format, ps uses:
• f,s,uid,pid,ppid,c,pri,nice,addr,sz,wchan,tty,time,cmd if you
specify -l
Examples:
List the process ID, cumulative CPU time, and the command with arguments for all
processes, overriding the title of the last column:
Exit status:
0 Successful completion.
-1 An error occurred.
See also:
hogs, pidin, showmem, top
Fine-Tuning Your System in the Neutrino User’s Guide
Syntax:
pterm [-ABbcEGLlnPpQqrTUvXZz] [-a font][-C path]
[-D fd] [-d path] [-F n] [-f font]
[-g RxC] [-H N] [-h height[%]]
[-K colors] [-k]
[-M RxC] [-m RxC] [-N fd] [-R prefix]
[-S i|m|n] [-s server] [-T] [-t string]
[-u opts] [-w width[%]] [-x position[%] [r]]
[-y position[%][r]] [program [argument...]]
Runs on:
Neutrino
Options:
The default values listed below are the ones coded in the pterm application; they
might be overridden by a configuration file.
pterm -K 07
-p Decrease priority.
-r Display a scrollbar.
-X Exit with shell’s exit status (default: always exit with zero).
program [argument...]
Name of the program that pterm starts. A shell is started if
neither program nor any of the following options are specified:
-D fd, -d path, or -N fd.
Description:
The pterm application is a terminal emulator that opens a window on the Photon
workspace and attaches itself to a character device. The device is usually a pty
(pseudo-tty) on the local node, but you can use the -R option to override the node (e.g.
if the pty driver isn’t running on the local node). Or you can use the -D or -d options
to specify a device (e.g. a serial link connected to a modem).
By default, pterm starts a shell on the “slave” side of the pty. The shell won’t be
spawned if a -D or -d option is used to override the device or if a -N option is used, in
which case it outputs the device name to the given file descriptor. In all cases, you can
use a command-line argument to force a program to be started on the device.
If the -d option specifies a pty, then the program is started on the specified device and
the other side of the pty remains unused (which is probably not the desired behavior).
Before spawning the command, pterm sets the TERM environment variable to a
value depending on the chosen terminal emulation. It’ll be one of the following:
• qnxm
• qansi-m
You can use the -E option to pass the original environment to the command.
By default, pterm closes its window as soon as the program spawned in it terminates.
The -Z or -z option overrides this default — the window remains open until the user
closes it. This option can be useful when a program is spawned that outputs a message
and then exits immediately.
The -G and -X options can also be useful for a program or script that calls pterm.
If -G is used, then whenever pterm catches a signal other than SIGTERM, SIGCHLD,
SIGILL, SIGWINCH or SIGSEGV, the signal is passed to the spawned command. This
means that a script can spawn pterm and easily kill its command with a chosen signal.
The -X option causes pterm to exit with the same exit status that the command
returned (or even to kill itself with the signal that killed the command).
If the user closes the window while the command is still running, or if pterm catches
a signal and either the -G option wasn’t specified or it is the SIGTERM signal (which
can mean that either Photon is being closed or pterm is being killed using the slay
command), pterm:
3 Exits.
If the -X option was specified and the command survives both signals, pterm
terminates with exit code 1.
If a process running on the pterm’s device is producing output very quickly, you can
increase the total throughput by running the “consumer” at a priority lower than the
“producer.” Data then arrives at the pterm in larger portions. You can further increase
the throughput by using larger buffers in the pty driver — pterm uses a 4K buffer,
while the pty driver’s default is 512 bytes.
You can use the -P or -p option either to reduce pterm’s priority or increase the
spawned command’s priority. Of course, changing the priority has other side effects: if
pterm’s priority is reduced below the default (-p option), then other processes
running at the default priority may significantly reduce the speed of pterm and, as a
result, the total throughput. On the other hand, if the process in pterm is running at an
increased priority (-P option), then it may affect the performance of other processes,
especially when it doesn’t produce much output.
You can use the -g option to set an initial terminal size, and the -m and -M options to
enforce minimum and maximum sizes. These sizes apply to the terminal, and not the
pterm window. If the window is re-sized to be smaller than the minimum size, the
terminal is clipped. If the window is re-sized to be larger than the maximum size, the
terminal is centered. If there is a conflict between the -g option and either -m or -M,
all options are adjusted to reflect the last option specified on the command-line.
continued. . .
The Ctrl-Alt-[ and Ctrl-Alt-] keychords change the font to the previous/next on the list,
without changing the terminal size (rows and columns).
Ctrl-Alt-< and Ctrl-Alt-> change the font without changing the window dimensions
(measured in pixels). If, however, the new terminal size would be smaller than the
minimal size, then the window must be grown. If the new size would be larger than the
maximum size, the window won’t be made smaller — instead, the terminal’s margins
are adjusted to fill the window.
You can store certain visible aspects of the terminal in a configuration file (see the
“Files” section) and modify them by using the Terminal Properties dialog invoked by
Ctrl-Alt-C:
Window Title area Here you can change the title or restore the default title. If you
don’t remember the escape sequences you can use in the title,
press the button marked ? to see the list.
The window title can contain special escape sequences:
Escape Meaning
%% A single % character
%$ PID of the current process
%0 Just the argv[0] argument of the current process
executing in the window
%A Arguments of the current process executing in the
window starting at the argv[0] position
%a Arguments of the current process executing in the
window starting at the argv[1] position
%d Device name (e.g. ttyp1)
%N Filename of the current process executing in the
window
%P Pathname of the current process executing in the
window
%p Device path (e.g. /dev/ttyp1)
continued. . .
Escape Meaning
%T Current time
%u User’s login name
Window Size area Here you can set the current terminal’s size, as well as the
minimum and maximum size (measured in pixels).
Font area You can choose from one of the predetermined font styles and
sizes, or you can select the custom font list. You edit the
custom font list by clicking Customize... For more information
see the section, Customizing your font list.
All the fonts displayed in this dialog must have the same character encoding. By
default, pterm assumes it’s the PC character set (“IBM code page 437”). If your fonts
use a different character encoding, you’ll have to specify a charsets file (click
“Browse...”) that defines that encoding. See ptermcs for information on creating
charset files.
Examples:
Run pterm using the Photon server on node my_node:
pterm -s/net/my_node/dev/photon
Run pterm at initial position (10,10) with initial dimension of 200×300:
Files:
When pterm is started, it looks for your local configuration file— if that file doesn’t
exist, a global configuration file is loaded. Whenever you click Save & Close in the
Terminal Properties dialog, the local file is saved. The configuration files have the
following pathnames:
You can use the -n option to suppress the loading of the current settings from the
configuration files. The -c option disables the Terminal Properties dialog.
You can use the -u option to restore the default behavior of the following options:
AaBbQv. This option overrides the setup in the configuration file.
You can give several option characters to the -u option at one time (e.g.-uabQv). The
-ub and -uB options mean the same thing. The always-blink (-B) and the never-blink
(-b) options are two states of a three-state switch. The third state (activated with either
-uB or -ub) is “Blink when pterm has focus.”
When pterm is started, it searches for a palette file:
The palette file can be either a binary file containing sixteen 32-bit entries or a text file
containing sixteen 8-digit hexadecimal numbers separated by newlines (and
terminated with a single newline). If the length of the file is neither 64 nor 144 bytes,
the file is assumed invalid.
The palette file is capable of displaying 16 colors: 8 “normal” colors and 8 “bright”
colors in the same way that a standard CGA/VGA does. Color numbers are indexes
into this array. The default array has 16 elements corresponding to 16 standard CGA
colors:
Index Color
0 BLACK
1 BLUE
2 GREEN
3 CYAN
4 RED
5 MAGENTA
6 BROWN
7 WHITE (light grey)
8 BRIGHT BLACK (dark grey)
9 BRIGHT BLUE
10 BRIGHT GREEN
11 BRIGHT CYAN
12 BRIGHT RED
13 BRIGHT MAGENTA
14 BRIGHT BROWN (yellow)
15 BRIGHT WHITE
Environment variables:
PHOTON_PATH The name of the root directory containing Photon files.
See also:
ptermcs
Using the Command Line and Using the Photon microGUI in the Neutrino User’s
Guide
Syntax:
ptermcs [-S i|m|n] [-s server] [-x position[%][r]]
[-y position[%][r]] filename
Runs on:
Neutrino
Options:
-Si|m|n The initial state of the main window (iconified, maximized, or
normal).
Description:
The ptermcs utility creates files to specify character settings that pterm uses for its
custom font list.
ANSI charset Choose a character set that you want pterm to use when your
terminal emulation is set to ANSI in pterm’s Terminal Properties
dialog. The ISO 8859 character sets are a good choice for ANSI
mode because all of the printable characters are in this range
(32-127, 160-255). Default is Western European (ISO 8859-1).
Internal/QNX charset
Choose a character set that you want pterm to use when your
terminal emulation is set to QNX in pterm’s Terminal Properties
dialog. DOS code pages such as Cyrillic (IBM 866) or the PC
character set (“IBM code page 437”) are the best choices since they
contain all of the alphanumeric characters as well as the
line-drawing characters. Default is PC character set (“IBM code
page 437”).
Font charset Choose the character encoding that your fonts use. Default is PC
character set (“IBM code page 437”).
Examples:
Run ptermcs using the Photon server on node my_node:
ptermcs -s/net/my_node/dev/photon
See also:
pterm
Syntax:
pv [-C] [-h height[%]] [-S i|m|n] [-s server]
[-w width[%]] [-x position[%][r]]
[-y position[%][r]] [filename]...
Runs on:
Neutrino
Options:
-C Start “clean”; don’t load the list of files previously viewed.
Description:
The Photon image viewer displays bitmap image files on the Photon workspace. When
you first start the viewer (without specifying an image filename), you’ll see a File
menu and an empty image area.
The File menu provides a File Selector mechanism for loading image files.
Examples:
Run pv using the Photon server on node my_node:
pv -s/net/my_node/dev/photon
See also:
snapshot
Syntax:
pwd
Runs on:
QNX Neutrino, Microsoft Windows
Options:
None.
Description:
The pwd utility writes the pathname of the current working directory to the standard
output.
The pwd command is available both as a shell alias (equivalent to print "$PWD"),
and as a standalone utility. For information about the builtin pwd command, see ksh.
To make sure you use the executable, specify the full path.
Exit status:
0 Successful completion.
See also:
cd (builtin ksh command), fullpath, ksh, ls
Syntax:
pwm [-CcdfGKknPrSW] [-a C|L|R] [-b color]
[-g input_group] [-R [b|c|f|m|r|t]...]
[-s server] [-Xcurs[,clr]]
Runs on:
Neutrino
Options:
-a C|L|R Alignment. By default, title alignment is centered (C) in the title
bar. This option lets you change the alignment to either left (L) or
right (R) justification.
-C Shut down the window manager when you close the last window
(bkgdmgr and shelf are considered windows).
-Xcurs[,clr] Define default cursor type (E9xx code) and color (hex RGB
value)
Description:
The Photon Window Manager (pwm) provides standard window management
functions, including move, resize, minimize, maximize, raise, lower, and close. It
provides common window frame borders that applications can customize, depending
on their requirements.
Apart from the -f click-to-front option listed above, pwm also enables the following
key combinations:
• Alt-F7 — Move the window. Use the arrow keys or mouse to move the window.
• Alt-F8 — Resize the window. Use the arrow keys or the mouse to resize the
window.
PWM Options
Selecting Desktop Config... from the Desktop Menu launches the pwmopts program,
which lets you configure the workspace.
If you create your own menu, you won’t see new menu items when they’re added to
the default one.
= Desktop Menu
Terminal T pterm
-
Graphics Config... G phgrafx
Desktop Config... W pwmopts
Shelf Config... S shelf -c
-
Mail M pterm elm
News N pterm trn
-
Shutdown... u phshutdown
The format of the file is simple; each line describes a menu item. Menu items are
defined in the form:
MenuItemTABHotkeyTABCommandAndArguments
You can’t use environment variables because the command parsing is simple.
However, you can write the command to a shell script and specify the script as the
command to run.
Examples:
Start the window manager with left-side title alignment, cursor focus, and
click-to-front behavior:
pwm -cf -aL
Files:
$HOME/.ph/wm/wm.cfg
Holds a user’s PWM workspace configuration.
$HOME/.ph/wm/wm.menu
Holds a user’s custom PWM Workspace menu.
Environment variables:
PHWMEXIT When set, disables the confirmation dialog when Photon exits. To
disable this dialog, add the following lines before the ph
command in your /etc/rc.d/rc.local file:
PWM_PRINTSCRN_APP
The application to start when the Print Scrn key is pressed. By
default, snapshot is started.
PH_WFRAME_STYLE
Specifies the window frame style.
By default, this is set to wframe_updated2.dll (PhAB) or
wframe_updated2.so.
This setting is included to improve performance. If you wish to
change this setting to support 6.4.0 look and feel, set:
export PH_WFRAME_STYLE=wframe_updated.so
export PH_WFRAME_STYLE=wframe_updated.dll
See also:
pterm, pwmopts, savercfg
Using the Photon microGUI in the Neutrino User’s Guide
Syntax:
pwmopts [-s server] [-x position] [-y position]
Runs on:
Neutrino
Options:
-s server_name The name of the Photon server:
Description:
The pwmopts command displays a dialog for setting options that apply to the Photon
Window Manager (PWM).
You’ll see these buttons at the bottom of the window:
Cancel Quit the options configuration program without saving any changes. You
can also cancel by closing the window from the menu or by pressing the
Esc key.
Apply Apply changes and save them to the configuration file. This is useful to test
the behavior of a user interface against a variety of operating paradigms
without the need for saving and relaunching the configuration window.
Done Save any modified options. This writes the options to the user
configuration file ˜/.ph/wm/wm.cfg, and instructs PWM to reconfigure
itself to the new options. The pwmopts program also terminates.
Use image from The directory in which to look for background images. You can
type a path in the text field, or click on the button beside it to look
for a directory.
Name The name of the background image, which you can choose from a
list of images in the current image directory.
Gravity If the image doesn’t fill the screen, you can choose where it goes.
You can also decide whether to tile or stretch the image to fill the
screen.
Files:
${HOME}/.ph/wm/wm.cfg
The file in which your window-manager options are stored.
To get the default look and feel, ensure that wframe_updated.so and wm.cfg are
installed properly on your target system.
See also:
phrelay, pwm, savercfg
Using the Photon microGUI in the Neutrino User’s Guide
Syntax:
python [option] ... [-c cmd | -m mod | file | -] [arg] ...
Runs on:
Neutrino
Options:
-c cmd Pass the cmd string as the program to run. This option terminates the
option list.
-d Display debugging output from the parser. You can also enable this by
setting PYTHONDEBUG to a nonzero value.
-i Inspect interactively after running the script, and force prompts, even if
stdin doesn’t appear to be a terminal. You can also enable this by setting
PYTHONINSPECT to a nonzero value.
-m mod Run the specified library module as a script. This option terminates the
option list.
-O Optimize the generated byte code (a tad). You can also enable this by
setting PYTHONOPTIMIZE to a nonzero value.
-Q arg Control the behavior of the division (/) operator, where arg is one of the
following:
• old — use floor division for integral arguments, and true division for
floating-point or complex arguments.
• warn — generate a warning if / (instead of //) is used for integer
division.
• warnall — generate a warning whenever / is used.
• new — always perform true division.
The default is old.
This option will be removed in version 3.0 of Python, and the / operator will always
perform true division. For more information, see
http://www.python.org/dev/peps/pep-0238/.
-u Use unbuffered binary for stdout and stderr. See the Python
documentation for details on internal buffering related to this option. You
can also enable this by setting PYTHONUNBUFFERED to a nonzero
value.
-v Be verbose (trace import statements). You can also enable this by setting
PYTHONVERBOSE to a nonzero value.
-x Skip the first line of source, allowing the use of non-Unix forms of #!cmd.
- Read the program from stdin (the default; Python uses interactive mode if
run on a tty).
Description:
Python is a high-level, object-oriented programming language that supports powerful
programming constructs, can be integrated with other languages such as C and C++,
and is extendible through the addition of libraries and modules. You can use Python
for programs and sophisticated scripts.
We don’t support Python on Linux or Windows. If you need Python on these hosts,
you should download it from http:www.python.org.
Environment variables:
PYTHONCASEOK Ignore case in import statements (Windows).
PYTHONINSPECT
Inspect interactively after running the script, and force
prompts, even if stdin doesn’t appear to be a terminal.
PYTHONOPTIMIZE
Optimize the generated byte code (a tad).
PYTHONSTARTUP
The file to execute on interactive startup (no default).
PYTHONUNBUFFERED
Use unbuffered binary for stdout and stderr. See the Python
documentation for details on internal buffering.
PYTHONVERBOSE
Be verbose (trace import statements).
See also:
gawk, sed
Writing Shell Scripts chapter of the Neutrino User’s Guide
http://www.python.org/
Syntax:
qbinaudit [options] [manifest_filename]
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
-s Be silent; don’t display dots to indicate the audit’s progress.
manifest_filename The name of the manifest file that describes the binaries to
audit.
You can specify the name of the manifest filename on the command line. If you don’t,
the script looks in the known installation location of the manifest files and prompts
you to select one.
Description:
The qbinaudit script parses the chosen manifest file to retreive the checksum value
and filename for each binary. It then regenerates the binary file’s CRC32 checksum
and compares it to the one in the manifest file.
If there’s a difference, the name of the binary filename is listed on stdout, indicating
that this binary doesn’t match the version from the officially distributed QNX release.
This can happen (for example) if you download the source from the Foundry27
website and modify it.
Examples:
# qbinaudit
Select a manifest file using the prefixed selection number in the square brackets.
[1]: manifest-base
[2]: manifest-sdk-host
[3]: manifest-sdk-ide
[4]: manifest-sdk-target
[5]: manifest-target-gpl
[6]: manifest-target-htmldocs
Select? 1
**** Processing /usr/qnx640//install/qnxsdp/6.4.0/manifest-base
.......................................................................
.......................
Chksum diff: 2187478658 vs 4168080167 /etc/system/config/display.conf
.......................................................................
.......................................................................
..................
Chksum diff: 1717030851 vs 3179076788 /opt/mozilla/firefox/bin/components/xpti.dat
Chksum diff: 3527685377 vs 1769584334 /opt/mozilla/firefox/bin/components/compreg.dat
.......................................................................
.......................................................................
..................
Chksum diff: 652769104 vs 452256802 /usr/lib/ldqnx.so.2
.......................................................................
.......................................................................
.......................................................................
.....................
**** Completed ****
See also:
qconfig, QWinCfg, showlicense, sysinfo
Syntax:
For C:
For C++:
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
-A library[.a] Build a new archive.
-c Compile only.
-E Preprocess to stdout.
-EB
-EL Compile for big or little endian.
The development tools have been designed to work out of their processor directories
(x86, ppcbe, etc.). This means you can use the same tool set for any target platform.
If you have development libraries for a certain platform, put them into the
platform-specific library directory (e.g. /x86/lib), which is where the compiler tools
look by default. Don’t put the libraries in /lib or /usr/lib, which are ignored.
Alternatively, use the -L option to specify the libraries’ location.
-l library (“el”) Add library to the list of libraries to link against. Omit
the lib prefix and any extension from the library’s name. For
example, to link against libsocket, specify -l socket.
You can specify more than one -l option. The qcc
configuration files might specify some libraries for you; for
example, qcc usually links against libc.
You need to link C++ programs with the -lang-c++ option in order for exceptions to
work.
-n Don’t execute.
-O Do compile-phase optimization.
-o outfile Specify the name of the output file. The default is a.out.
Note that the make utility, when used with the default settings, produces an output file
with the same name as the input file. For example:
make file1
-set-default Set the current -V argument as the default target. For example:
You must be root to use the -set-default option. Note also that the option is
intended for use at the command line, not for makefiles.
-V [[compiler/ ]version,][target]
The compiler name, version number, and the target name. If
you don’t specify -V at all, qcc will use the default compiler,
version, and target.
If you specify the target, qcc looks for the target configuration
files in the following paths, according to how compiler, version,
and target are specified:
continued. . .
qcc -Vgcc,
lists all targets in all versions of gcc. See the Examples section
below for more examples.
The targets include:
• gcc_ntoarmle
• gcc_ntomipsbe
• gcc_ntomipsle
• gcc_ntoppcbe
• gcc_ntoshle
• gcc_ntox86
For a list of supported targets, specify -V (or -Vcompiler or
-Vcompiler/version or -Vversion, provided there’s a valid
${QCC_CONF_PATH}/version directory).
If you specify -w along with multiple warning options, all warnings are suppressed
regardless of the order of the options. In other words, -w always wins.
-w[0-9] Set the warning level (0=off). The -w9 option is the same as
gcc’s -W9 option. To generate warnings for everything, include
these options with -w9:
• -Wcast-qual
• -Wpointer-arith
• -Wshadow
• -Wwrite-strings
Note that using these options will produce warnings in the
standard C++ library headers, and possibly other system
headers.
-x extension Treat the files that follow as being of type extension. The
following values of extension are accepted:
• c
• c-header
• c++
• cpp-output
• assembler
• assembler-with-cpp
as well as valid file extensions, such as .c, .cc, .cpp, .C, .i,
.ii, .s, and .S.
Use -xnone to go back to normal suffix typing. For example,
to compile myfile.h as if it were a .c file:
-Y lib_type Select the C++ library type to be used (if available), lib_type
can be:
• _gpp — GNU C++ lib (available only for x86)
• _cpp — Dinkum C++ lib (default)
• _cpp-ne — Dinkum C++ lib (no exceptions)
• _acpp — Dinkum Abridged C++ lib
• _acpp-ne — Dinkum Abridged C++ lib (no exceptions)
• _ecpp — Embedded Dinkum C++ lib
• _ecpp-ne — Embedded Dinkum C++ lib (no exceptions)
Description:
QCC and qcc are the QNX compiler interface. They’re based on the POSIX c89
utility. By default, QCC considers a program to be C++, while qcc considers it to be C.
QCC and qcc take a list of source and object modules on the command line and
invokes the appropriate parser to compile each file. Object modules are passed straight
through to the linker. The file suffix determines which parser is used, as follows:
Suffix Parser
.s Assembler
.S Assembler with preprocessor directives
.c C compiler
.i Preprocessed C file
.C, .cc, .cpp C++ compiler
.ii Preprocessed C++ file
.o Object file
.a Library file
These utilities don’t allow multiple options to be specified after a dash character (-).
For example, -gc isn’t valid; you must specify -g -c instead. Operands (source and
object files) and options may be mixed and specified in any order. Some options, such
as -I and -L, are order-dependent—the order in which they appear in the command
line determines the order of the searches made. All command-line arguments are
processed before any compilation or linking begins.
The single-pass linker resolves symbols from left to right: If a module refers to a
symbol that is contained in a library, make sure you specify the library to the right of
the module.
When qcc encounters a compilation error that stops an object file from being created,
it writes a diagnostic to the standard error and continues to compile other source files,
but it bypasses the link phase and returns a nonzero exit status. If the link phase is
entered and is unsuccessful, a diagnostic is written and qcc exits with a nonzero status.
The -c option suppresses the link phase. If you have many separate source files that
you must update and modify individually, you’ll probably use the -c option frequently.
You may occasionally wish to examine the assembly code produced by the code
generator. The -S option produces an assembly file ending in .s.
If you need to specify a parameter to any of the language processors, you may use the
-W c,option. Check the documentation on each processor to determine its options.
The compiler defines various preprocessor symbols (or manifest constants) that can
help you make decisions at compile time. For more information, see the Manifests
chapter of the Library Reference.
Profiling
Here’s how to profile your application, so you can see where it’s spending its time:
1 Compile and link your application with profiling by using the -p option to qcc.
For example:
make CCOPTS+=-p LDOPTS+=-p
3 Run your application as root (this is important because the timers are
privileged). The result of this run is a file called gmon.out, in your program’s
current working directory when it exits.
For more information, see the GNU documentation for gprof, and Profiling an
Application in the IDE User’s Guide.
Examples:
Compile myfile.c and create a 32-bit executable program for QNX Neutrino on an
Intel x86 machine in the current directory with the name a.out:
Compile myfile.c and create a 32-bit executable program for QNX Neutrino on an
Intel x86 machine in the current directory with the name myfile:
qcc
The default compiler is gcc, the default version of the compiler is 4.2, and the default
target is ntox86.
Use the default version of the compiler, and build for an ARM little-endian target:
qcc -Vgcc_ntoarmle
Use the 3.3.5 version of the compiler, and build for a PPC big-endian target:
qcc -V3.3.5,gcc_ntoppcbe
Use make to compile myfile.c and create an executable program in the current
directory with the name myfile:
make myfile
You can’t use the default rules for make — you need to specify the target. See make.
Files:
a.out The default output file. You can use the -o option to override this.
Configuration files:
${QCC_CONF_PATH}/version/*.conf
${QCC_CONF_PATH}/default
${QCC_CONF_PATH}/gcc/default
${QCC_CONF_PATH}/gcc/version/default
Environment variables:
QCC_CONF_PATH
The name of the directory that contains the configuration files. The default
directory is ${QNX_HOST}/etc/qcc.
Exit status:
0 Success.
See also:
gcc, make
Compiling and Debugging chapter of the Neutrino Programmer’s Guide
Manifests chapter of the Library Reference
Syntax:
qconfig [-abc] [-d path] [-e | -i | -l] [-h]
[-n installation_name] [-p] [-r program]
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
-a Display all installed products and updates in a machine-readable
format.
The -a option was added in QNX Neutrino Core OS 6.3.2 and an update to QNX
Momentics 6.3.0 SP1 and QNX Momentics 6.3.0 SP2.
The -b option was added in QNX Neutrino Core OS 6.3.2 and an update to QNX
Momentics 6.3.0 SP1 and QNX Momentics 6.3.0 SP2.
The -c option was added in QNX Momentics 6.3.0 SP3 and an update to QNX
Momentics 6.3.0 SP1 and QNX Momentics 6.3.0 SP2.
-d path The name of the directory where all of the individual configuration
files are located. There’s one configuration file per installation.
-e Set up the runtime environment (see the examples). If you specify this
option, qconfig produces the commands to set these environment
variables:
• QNX_HOST
• QNX_TARGET
• PATH
• LD_LIBRARY_PATH
• MAKEFLAGS
You’ll find this option useful when setting up the environment for
building software.
count: number_of_installations
name: ...
version: ...
host: ...
target: ...
-n installation_name
Select a specific installation by name. The name may be incorporated
as part of the configuration file using the <name> tag or, if not
present, it defaults to the filename.
The -p option was added in QNX Neutrino Core OS 6.3.2 and an update to QNX
Momentics 6.3.0 SP1 and QNX Momentics 6.3.0 SP2.
Description:
The qconfig utility sets or queries the QNX configuration files. It supports the
coexistence of multiple versions of Neutrino on one machine.
To change the version of QNX Neutrino that you’re developing for on a Windows
machine, use QWinCfg instead of qconfig. QWinCfg changes the registry on your
machine; qconfig changes only the settings in your current shell.
This utility doesn’t list the installed packages in any particular order.
Examples:
List all the QNX installations:
qconfig
The syntax for evaluating the output of the -e option depends on the host OS and the
shell that you’re using. The command shown above works with ksh and bash.
Environment variables:
QNX_CONFIGURATION
The name of the directory that stores the configuration files.
See also:
qbinaudit, QWinCfg, showlicense, sysinfo
Controlling How Neutrino Starts and Configuring Your Environment in the Neutrino
User’s Guide
Syntax:
qconn [-v] [port=portnum]
[qconn_prio=qpriority]
[child_prio=cpriority]
Runs on:
Neutrino
Options:
-v Display the version number for qconn, and then exit.
port=portnum Select a different port to bind the daemon to. The default is 8000.
If you aren’t logged in as root when you start qconn, it can’t
bind to a restricted port number.
qconn_prio=qpriority
Set the priority at which qconn runs. The default is 10.
Use this option to increase qconn’s priority if CPU-intensive
programs are running at the same or a higher priority, preventing
qconn’s clients from receiving data. For example, getting a
“Could not find target: Read timed out.” error while running the
QNX Momentics IDE’s System Profiler means that the System
Profiler is unable to receive data from qconn on the target.
child_prio=cpriority
Set the priority at which children are run. The default is 10.
Description:
The qconn daemon is a service provider that provides support, such as profiling
system information, to remote IDE components. Output is based on the services
invoked and is fed to the requesting IDE component on a remote host.
If you aren’t logged in as root when you start qconn, it can’t start resource manager
components.
The functionality comes from the service modules that are currently bound directly
into the executable.
Currently, if you want to use the debugger, you must have pdebug installed on your
system in the search path used when qconn is launched. You may also have pdebug
in /usr/bin.
Files:
Supporting files are required, depending on the service being used. For example, the
memory analysis service requires libmalloc.so installed in the user’s path.
Caveats:
The qconn daemon lets anyone run any application on your target system as the
superuser. Obviously, this is a huge security risk. Don’t include qconn on systems
being deployed to customer sites.
See also:
IDE User’s Guide
Syntax:
Send files:
qcp [device] se [options] src_file[,dst_file]...
[x=index_file]...
Receive files:
qcp [device] re [options] [-f filename|-p prefix]
Runs on:
Neutrino
Targets:
x86
Options:
device Pathname of serial device to use. The default is the device
connected to stdin and stdout.
-f filename Force received files to have this name.
-F Required to receive files on a flash filesystem that doesn’t support
all the POSIX file control mechanisms.
-l logfile (“el”) Append the file transfer event to the logfile.
-m Suppress making directories for received files.
-n Receive only files that are newer than existing files.
-p prefix Place this path prefix on the names of any received files.
-q Be quiet; display nothing during the transfer.
-r Relax timing; double timeouts and quadruple retry counts.
-s packet_size The size of transmitted data bursts (default is 2048 bytes).
-t Apply today’s date to received files.
-u Unlink files that lack write permission. This allows new versions
of the affected files to be received and written to disk.
-V, -v Be verbose; display the error status while transferring files.
x=index_file A list of filenames; qcp sends each file named in the list. You can
specify multiple x=index_file options specified and intermix them
with singly named files to transmit.
Description:
The qcp utility provides an error-checked file transfer protocol that qtalk uses to
transmit or receive files. This protocol is both highly efficient on packet switched
networks and highly reliable through the use of 16-bit CRCs (Cyclic Redundancy
Check).
The qcp utility automatically sends files with their pathnames, attributes, permissions,
and date fields intact. The qcp protocol is ideally suited for use over public packet
switch networks (X.25), as well as direct modem-to-modem connections. If
communication errors are encountered, portions of the file are automatically resent
until the far end acknowledges correct reception of the file.
If you’re using qtalk to communicate with a remote system, you can both send and
receive files to the remote system with the qcp utility. To cause a file to be sent from
the remote system to your local system, type a command of the following form into
the qtalk session you have connected to the remote system:
This causes the remote end to send the files to you; qtalk automatically starts qcp to
receive the file. The files sent are:
• file1
To send a file to the remote system, type the following command into the remote shell:
qcp re
then use the Ctrl-A Ctrl-S key sequence to cause qtalk to send a file to the remote qcp
utility.
If you want qcp to send a file through an explicitly named device, use a command of
the form:
where /dev/ser1 is the port to send through. To receive from a particular device, use
a command similar to:
qcp /dev/ser1 re
You can abort a qcp file transfer in progress by pressing either Esc or Space. In turn,
qcp displays a prompt asking for confirmation of the action. To confirm aborting qcp,
you enter y. If a remote qcp in a receive state must be shut down, the following
control-character sequence aborts it:
ˆVˆXˆX
When transferring files via high speed modems, the -s 16000 option is
recommended.
See also:
ls, qtalk
Syntax:
qde [-consoleLog] [-data path] [-debug options_file]
[-nospash] [-refresh]
[-vmargs args]
Runs on:
Linux and Windows
Options:
-consoleLog Write error messages to the console.
-debug options_file
Run QDE in debug mode, loading its options from options_file.
-vmargs args Pass args unchanged to the Java VM on Windows and Linux. The
most common VM options are used to control the stack and heap
available to the VM.
• -Xmsheap_size — Set the initial Java heap size to heap_size.
• -Xmxheap_size — Set the maximum Java heap size to
heap_size.
• -Xssstack_size — Set the Java thread stack size to stack_size.
Under Windows, the default -vmargs are -Xms256m and
-Xmx512m.
The -vmargs option isn’t supported by qde on Neutrino.
Description:
On Linux and Windows development hosts, qde launches the QNX Momentics
Integrated Development Environment (IDE), a powerful set of tools based on the
Eclipse Platform. It integrates several QNX-specific plugins designed for building
projects for target systems running the QNX Neutrino RTOS.
For more information, please refer to the IDE User’s Guide.
See also:
dumper, gcc, gcov, gdb, gprof, ld, make, mkefs, mkifs, mkimage, mkrec,
mksbp, objcopy, pdebug, qcc, qconfig, qconn, QWinCfg, strip,
tracelogger, usemsg
Syntax:
qed [-br] [file [commands...]]
Runs on:
Neutrino
Options:
-b Browse only — don’t allow the user to write the file.
-r Restricted. Don’t give the user the ability to start a shell or run other
commands from the editor.
file The name of the file to edit. There’s no default; if the editor is started
without a file, one has to be specified within the editor before the text
may be saved.
commands A list of editor commands to execute on startup.
Description:
The qed utility is a fullscreen editor that’s been shipped with QNX since the early
days of the QNX 2 operating system. It has been ported to QNX Neutrino for the
convenience of the many people who have become accustomed to it. However, it’s no
longer the preferred editor in QNX Neutrino and its use is deprecated. The qed editor
is available only on the QNX OS, while other editors such as vi and emacs are more
universally available.
If you enter this editor by accident, the best way to get out is to press q Enter while the
cursor is on the top command line. Because it was designed for the console with full
PC keyboard capabilities, its use is more limited on terminals and many terminfo
entries don’t describe the capabilities it requires for such basic things as getting back
to its command line.
For more information on qed, you’ll find a complete HTML manual online.
This editor is provided “as is” and we don’t encourage you to use it.
Examples:
Edit the file myfile.c:
qed myfile.c
Edit the file myfile.c, moving to line 320 on startup:
qed myfile.c 320
Files:
/usr/lib/ed.macros
The qed utility uses internal macros for most of its operations. These macros
are defined in this file.
/usr/lib/box.macros
This file contains a set of macros for box-drawing within qed using the PC
character set line-drawing characters. This file is optional and might not be
found on your system.
Exit status:
0 Success
See also:
ed, elvis, ped, vi
Using Editors in the Neutrino User’s Guide
Syntax:
qtalk [options] [system]
Runs on:
Neutrino
Options:
-b [baud|data|parity|stop][,...]
Change the serial port to this baud, parity, stop bits, and/or data
bits. Values of 1-2 are interpreted as stop bits, 7-8 as data bits,
none, even, odd, mark and space as parity, all other numbers
as baud. Order isn’t significant e.g. -b 9600,8,n,1
-D delay Wait this many 1/20th sec periods before running the command
specified by the -x option.
The qtalk utility reads any data emitted by the modem during
this delay period and displays the data on your screen before the
command is started.
If you use -x without this option, qtalk doesn’t wait to start the
command. As a result, if the modem emits any information once
qtalk has emitted the dialing string, you have no way of
predicting whether qtalk or the command sees that
information.
-m modem[,init_string]
The name of the device to use. If you specify multiple -m
options, qtalk tries them, in order, until it finds a device that
isn’t in use.
If you specify an init_string, it’s emitted to the modem before
anything else.
-o protocol=command
Redefine transfer-protocol options, where protocol is one of the
following:
system The name of the system you want qtalk to call. The system
must be defined either in $HOME/.qtalk (or the file named
by -s) or in the system-wide dialing directory,
/etc/config/qtalk. For more information, see the
description of the d (dial system) command.
Description:
The qtalk utility lets QNX Neutrino users communicate with other computers via a
serial line that’s usually connected to a modem. The destination may be another host
computer, in which case qtalk lets you use your computer as a terminal. The qtalk
utility also lets two QNX Neutrino users communicate and transfer files.
The qtalk utility sends any characters you type on the keyboard to the other system
via the modem. Any characters received by the modem are displayed. In local echo
mode, typed characters are echoed on the display as well as being sent over the
modem.
The -s command-line option doesn’t change how qtalk searches for the defaults
system.
Logging a session
You can log a recording of a qtalk session with the -l option:
qtalk -l /dev/par
qtalk -l /tmp/logfile
qtalk -d 08
Transferring files
The qtalk utility lets you transfer files through either of two methods:
• You invoke the simpler method with the w (write) and l (log) commands to transfer
text files to or from another system. No error checking is performed, however, so
you should use this method only when communication lines are good (i.e. direct
connect lines or reliable modem connections), or when the other system doesn’t
support any of the file transfer methods available from qtalk.
To send a file to a host using write, you should first make the host capable of
receiving a stream of text. You could do this with an editor or the cat utility. You
can then use the write command to send the file.
To receive a file from a remote host using the l (log) command, first turn on logging
to the desired file (with the l command), then enter a command into the remote
system to make it display the file (e.g. cat filename on a UNIX-type system.)
• The second method, involves the s (send) and r (receive) commands, providing
access to more sophisticated protocols that include error checking and
retransmission when transferring files to other systems.
You can’t automatically enable the other_re protocol. To invoke other_re or other_se,
choose send or receive from the command menu when the current file transfer
protocol has been set to other.
Interactive commands:
To specify any of the following commands, first press the command character (usually
Ctrl-A).
b (break) Send a break over the modem. You may also send breaks by
pressing the break key (Ctrl-Break on the console keyboard).
C (command character)
Change the command character. You’re prompted to enter the new
command character in hex (e.g. 0x02) or as ˆchar (e.g. ˆb).
c (change directory)
If you specify the c command, qtalk prompts you for a new
directory name, and attempts to move to that directory. If qtalk
moves successfully to the directory you specify, the directory
becomes the current working directory (see the pwd utility) for the
duration of qtalk, or until you change directory again. When
qtalk terminates, your current working directory reverts to the
directory you were in when qtalk was invoked.
d (dial system) If you specify the d command, qtalk prompts you to enter a
system name. It first looks for that name in your own dialing
directory ($HOME/.qtalk) and if it doesn’t find it there, it looks
in the system-wide dialing directory, /etc/config/qtalk.
If you enter a question mark (?) for the system name, the contents
of both dialing directories (if they exist) are displayed and you’re
prompted again for a system name. To abort the dialing command
and return to normal communications mode, press Enter without
entering a name.
Dialing is implemented by looking up the system name — which
can also be specified on the command line when qtalk is invoked
— first in your $HOME/.qtalk file, then in the
/etc/config/qtalk file. These files share the same format:
system_name [dialing_string]
[ <whitespace> command-line_options]
.
.
.
In these files, you must specify the system name at the very left of
the line with no whitespace before it. The dialing string is optional
(this string contains commands to be sent to the modem before
you’re given interactive control). If you specify a dialing string,
you must separate it from the system name by spaces or tabs, or
both.
In dialing strings, you can specify any of the following characters;
qtalk acts on these characters instead of sending them straight to
the modem:
Additional lines beneath the line that defines the system name and
dialing string may contain additional qtalk command-line
options to apply when talking to this system.
If you specify these additional lines, begin each one with at least
one tab or space character. Note that a single command-line option
can’t span multiple lines. You can, however, place just one option
per line.
D (delete character)
Change the delete character. You’re prompted to enter the new
delete character in hex (e.g. 0x08) or as ˆchar (e.g. ˆh).
e (echo) If you specify the e command, the local echo feature is toggled.
Some systems expect the “terminal” to perform local echoing (half
duplex).
h (hang up) If you specify the h command, the CTS/RTS lines are lowered for
approximately 1/2 a second. This permits modems that support
hardware hangup to do so.
l (log) Begin or end logging of this session. If no log file is open, qtalk
asks for the name of a file to log into. If logging is already in
progress, it’s terminated and the log file is closed. The l command
records every character that is sent or received in the log file.
You can use l to take “snapshots” of data from a host computer at
slow speed.
o (modify protocol options)
Prompts you for the protocol whose command string you wish to
change (qcp, ZMODEM, other). The current send and receive
command strings are displayed and you’re then prompted to enter
a new command string. To set a string to null, use "". If you don’t
want to make any changes, press Enter.
r (invoke a receive)
Invoke the currently selected file transfer protocol to receive a file.
Note that qtalk automatically invokes qcp and ZMODEM if it
recognizes a received startup sequence of one of these protocols.
s (send a file) Send a file, using the currently selected file transfer protocol. This
sends a file to another system running the same protocol, which is
more secure than simply writing the file to the modem.
When the currently selected protocol is qcp, you can send more
than one file by specifying the x=index_file option when qtalk
asks for the file to send. This file contains a list of files to send, one
per line. You can also specify more than one filename, separated
by spaces.
The qcp utility lets you follow the name of the file to send with the
name of the destination file. Separate the two filenames with a
comma. This is also true for filenames within an index file (option
x=). For example:
sends the file file1 as file1 and the file main.c with the name
new_main.c. If you don’t specify a new name, qtalk creates a
file with the same name as the file that is sent.
Files received by qtalk using the qcp protocol have the same
attributes and date as the file on the sending machine.
Most transfer protocols require that the modem port be configured
for 8-bit data (Use the -b option to set the serial port to 8 data bits;
also see the stty command).
t (select transfer protocol)
Shows you which protocol is being used (e.g. qcp, ZMODEM)
and asks you to select a new one. If you press Enter, no changes
are made. This command controls the protocol used when you use
the send and receive commands from the command menu.
x (exit) Exit from qtalk without performing a hangup. It’s good practice
to use the q (quit with hangup) command for leaving qtalk,
unless you really don’t want to perform a hangup.
Examples:
Call the system named home:
qtalk home
Communicate with a machine that doesn’t echo (half duplex) and expects an ASCII
backspace (08 hex) to delete characters:
qtalk -e -d 08
qtalk -l /dev/par
Use the qcp -n option for qcp receives (i.e. receive only files that are newer than
existing files):
See also:
devc-con, qcp, stty
Syntax:
QWinCfg
Runs on:
Microsoft Windows
Options:
None.
Description:
QWinCfg is a graphical application that you can use in Microsoft Windows to set or
query the QNX configuration files. It supports the coexistence of multiple versions of
Neutrino on one machine.
QWinCfg is a graphical front end for qconfig that exists only on Windows. On other
hosts, use qconfig.
Click the Show Packages.. button to display a list of the QNX packages that you’ve
installed on your system.
Environment variables:
QNX_CONFIGURATION
The name of the directory that stores the configuration files.
See also:
qbinaudit, qconfig, showlicense, sysinfo
Controlling How Neutrino Starts and Configuring Your Environment in the Neutrino
User’s Guide
Syntax:
racoon [-BdFv46] [-f configfile] [-l logfile] [-p isakmp-port]
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
-4 or -6 Specifies the default address family for the sockets.
-f configfile Use configfile as the configuration file instead of the default. The
default configuration file is /etc/racoon/racoon.conf.
Description:
The racoon daemon speaks IKE (ISAKMP/Oakley) key management protocol, to
establish security association with other hosts. The SPD (Security Policy Database) in
the kernel usually triggers to start racoon.
Examples:
For examples showing how to configure racoon directives and statements, see
/etc/racoon.conf.
Files:
/etc/racoon/racoon.conf
Default configuration file for racoon
Exit status:
0 Success.
Contributing author:
OpenSSL Project
License:
This utility is based on OpenSSL Project software; for licensing information, see the
Third Party License Terms List at
http://licensing.qnx.com/third-party-terms/.
See also:
/etc/racoon.conf, setkey, syslogd, /etc/syslog.conf
IPsec protocol in the Library Reference
Name:
/etc/racoon.conf
Description:
This file is the configuration file for the racoon ISAKMP daemon. This daemon
negotiates security associations for itself (ISAKMP SA, or phase 1 SA) and for kernel
IPsec (IPsec SA, or phase 2 SA). The file consists of a sequence of directives and
statements. Statements are enclosed by braces ({}). Lines beginning with # are
comments.
The major parameters are listed below.
string, path, file Any string enclosed in double quotes (e.g. "string").
Path Specification
The following path specfications are allowed:
Make sure you remove redundant data from this file to keep it to a reasonable size
because racoon simply adds SAs (you have to do this manually).
File Inclusion
include file Other configuration files can be included.
Identifier Specification
This is obsolete; it must be defined at each remote directive.
Timer Specification
timer {statements...}
Specifies various timer values, you can use statements such as:
Policy Specifications
The policy directive is obsolete, policies are now in the SPD. The racoon daemon
will obey the policy configured into the kernel by setkey, and will construct phase 2
proposals by combining sainfo specifications in /etc/racoon.conf, and policies
in the kernel.
Sainfo Specifications
sainfo (source_id destination_id | anonymous) { statements }
Defines the parameters of the IKE phase 2 (IPSec-SA establishment). The
source_id and destination_id variables are constructed like this:
The kernel may not support the algorithm you have specified.
encryption_algorithm algorithms
Where algorithms may be:
• des
• 3des
• des_iv64
• des_iv32
• cast128
• blowfish
• null_enc
• rijndael (used with ESP)
authentication_algorithm algorithms
Where algorithms may be:
• des
• 3des
• des_iv64
• des_iv32
• hmac_md5
• hmac_sha1
• non_auth(used with ESP authentication and AH)
compression_algorithm algorithms
Where algorithms may be:
• deflate (used with IPComp)
Logging level
log level Define logging level. The level variable is one of the following:
• notify (default)
• debug
• debug2
If you put too high a logging level on slower machines, IKE negotiation
can fail due to timing constraint changes.
Special directives
complex_bundle (on | off)
Defines the interpretation of proposal in the case of SA bundle. Normally “IP
AH ESP IP payload” is proposed as “AH tunnel and ESP tunnel”. The
interpretation is more common to other IKE implementations, however, it allows
a very limited set of combinations for proposals. With the option enabled, it will
be proposed as “AH transport and ESP tunnel”. The default value is off.
The file must be owned by the user ID running racoon (usually the privileged user),
and must not be accessible by others.
Examples:
The following example shows how the remote directive should be configured:
sainfo anonymous
{
pfs_group 2;
lifetime time 12 hour ;
encryption_algorithm 3des, blowfish 448, rijndael ;
authentication_algorithm hmac_sha1, hmac_md5 ;
compression_algorithm deflate ;
}
10.160.94.3 mekmitasdigoat
172.16.1.133 0x12345678
194.100.55.1 whatcertificatereally
3ffe:501:410:ffff:200:86ff:fe05:80fa mekmitasdigoat
3ffe:501:410:ffff:210:4bff:fea2:8baa mekmitasdigoat
foo@kame.net mekmitasdigoat
foo.kame.net hoge
Caveats:
The racoon daemon may not yet be able to handle some of the statements described
in this document.
See also:
racoon, setkey
Syntax:
random [options]
Runs on:
Neutrino
Options:
-h Show the usage message.
-i# Use interrupt number # as a source for collecting random data. You may
specify more than one interrupt, to a maximum of 32.
Description:
The random service runs in the background providing a source of secure, random data
suitable for encryption and security. The service builds its internal pool of random
data from sources specified when it is started. These sources may include timers,
interrupts, and detailed system runtime information. The service makes this random
data available by providing device entries that any application can read:
The user controls all of the sources to be used to collect random data by specifying
source options on the command line.
Examples:
Start the random service using three PC interrupts as sources:
int data;
int fd;
close( fd );
Exit status:
0 The random data is available from /dev/random and
/dev/urandom.
Errors:
If an error occurs, random sends a description of the error to slogger and doesn’t
create /dev/random or /dev/urandom.
Contributing author:
The random service uses the core algorithm from the copyright-free Yarrow
pseudo-random number generator (PRNG) from Counterpane Security
(http://www.counterpane.com/yarrow.html). Bruce Schneier and John
Kelsey designed the Yarrow PRNG.
Caveats:
The random service will not work unless you specify at least one source of random
data (options -p, -t, or -i).
Syntax:
ranlib_variant [-t] [-v|-V|--version] archive
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
The ranlib_variant depends on the target platform, as follows:
Description:
The ranlib utility generates an index to the contents of an archive and stores it in the
archive. The index lists each symbol defined by a member of an archive that is a
relocatable object file.
For detailed documentation, see the GNU website at http://www.gnu.org/.
Contributing author:
GNU
See also:
ar, nm
Syntax:
rcp [-p] source_file target_file
Runs on:
Neutrino
Options:
-p Attempt to preserve (duplicate) the modification time and file mode of
each source file in its corresponding target file, ignoring the umask.
By default, the mode and owner of the target file are preserved if the
target file already exists; otherwise the mode of the source file
modified by the umask on the destination host is used.
-r If any of the source files are directories, copy each subtree rooted at
that name; in this case, the destination must be a directory.
Description:
The rcp utility copies files between machines. Each file or directory argument is
either of the following:
• a local filename that has no “:” characters, or that has a “/” before any “:”
If the specified path isn’t a full pathname, it’s interpreted relative to the login directory
of the specified user ruser on rhost, or of your current username if no other remote
username (rname) is specified. A path on a remote host may be quoted (using \, ", or
’) so that the metacharacters are interpreted remotely.
The rcp utility doesn’t prompt for passwords; it performs remote execution via rsh,
and requires the same authorization.
The rcp utility handles third-party copies, where neither source nor target files are on
the current machine.
This utility needs to have the setuid (“set user ID”) bit set in its permissions. If you use
mkefs, mketfs, or mkifs on a Windows host to include this utility in an image, use
the perms attribute to specify its permissions explicitly, and the uid and gid
attributes to set the ownership correctly.
Files:
The rcp utility requires the libsocket.so shared library.
Caveats:
The rcp utility doesn’t always detect that the target of a copy is a file in cases where
only a directory should be legal. It’s also confused by any output generated by
commands in a .login or .profile file on the remote host.
See also:
cp, ftp, /etc/hosts.equiv, ˜/.rhosts, rlogin, rlogind, rsh
Syntax:
readelf [options] elffile...
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
See the GNU website at http://www.gnu.org/.
Description:
The readelf utility displays information about one or more ELF format object files.
For detailed documentation, see the GNU website at http://www.gnu.org/.
Contributing author:
GNU
See also:
objdump
Syntax:
renice prioritylevel [-g pgrp...]
[-p pid...] [-u user...]
Runs on:
Neutrino
Options:
-g pgrp Renice processes in this process group.
prioritylevel The amount to adjust the priority by. Positive numbers lower the
priority by that many full priority levels, while negative numbers
raise the priority.
Description:
The renice utility adjusts the priority of all the threads in one or more running
processes. The specified prioritylevel is subtracted from the current priority of each
selected process.
If you don’t have the appropriate privileges, you can renice only the processes you
own. You can change the range of privileged priorities with the -P option for
procnto.
Examples:
Lower the priority of process 768 by 2:
renice 2 -p 768
Exit status:
0 Successful completion.
See also:
nice, slay
Name:
/etc/resolv.conf
Description:
The resolver library routines provide access to the Internet Domain Name System
(DNS). When these routines are first invoked by a process, they read information
contained in the resolver configuration file. This file contains a list of keywords with
user-specified values that provide various types of resolver information.
This file is optional. If it isn’t present:
• the resolver library routines look in /etc/hosts only to resolve the hostname
Overriding /etc/resolv.conf
You can use the following confstr() configuration strings to override the data contained
in /etc/resolv.conf:
The socket library uses the following search order to locate the resolver data:
2 resolv.conf.hostname
3 resolv.conf
Utilities such as dhcp.client and pppd can optionally set the configuration strings.
Keywords
The keyword and its associated value must appear on a single line. The line must start
with the keyword (e.g. nameserver) followed by whitespace and the value.
The domain and search keywords are mutually exclusive. If more than one instance
of these keywords is present, the last instance overrides any others.
nameserver
The Internet address (in dot notation) of a name server that the resolver should query.
Up to MAXNS (currently 3) name servers may be listed, one per keyword. If multiple
server entries are present, the resolver library queries them in the order listed. If no
server entries are present, the default is to use the name server on the local machine.
(The algorithm used is to try a name server, and if the query times out, try the next,
until out of name servers, then repeat trying all the name servers until a maximum
number of retries are made).
domain
The local domain. Most queries for names within this domain can use short names
relative to the local domain. If no domain entry is present, the domain is determined
from the local hostname returned by gethostname(); the domain part is taken to be
everything after the first dot. If the hostname doesn’t contain a domain part, the root
domain is assumed.
search
The search list used for looking up hostnames. The search list is normally determined
from the local domain name. By default, it begins with the local domain name, then
with successive parent domains that have at least two components in their names.
You can override the default list by specifying the desired domain search path and by
following the search keyword with the names. Most resolver queries are attempted
using each component of the search path in turn until a match is found.
This process may be slow and generates a lot of network traffic if the servers for the
listed domains aren’t local. Queries time out if no server is available for one of the
domains.
The search list is currently limited to six domains with a total of 256 characters.
nocache
By default, the resolv.conf data is parsed at application startup only. It is not
checked again. Specifying “nocache on” will cause the resolv.conf data to be
parsed at every lookup. If you wish to invalidate the cache at a specific time, it would
be better to call res_init() directly, or turn off the _res.options flag RES_INIT.
See also:
/etc/hosts, netmanager, /etc/nsswitch.conf
dn_comp(), dn_expand(), gethostname(), res_init(), res_mkquery(), res_query(),
res_search(), res_send() in the Library Reference
TCP/IP Network Administration
DNS and BIND by Paul Albitz and Cricket Liu, O’Reilly & Associates (ISBN
1-56592-010-4)
Name:
˜/.rhosts
Description:
The ˜/.rhosts and /etc/hosts.equiv files provide the “remote authentication”
database for the rcp, rlogin, and rsh commands and the rcmd() function. These
files bypass the standard password-based user authentication mechanism. They
specify remote hosts and users that are considered trusted (i.e. are allowed to access
the local system without supplying a password):
The file permissions for the ˜/.rhosts file must be as follows or its contents will be
ignored:
The ruserok() function sets the effective userid to that of the remote user, but doesn’t
change the effective group ID. The user must have search permissions for the
directories contained in the pathname of an .rhosts file (i.e. if the file resides in
/home/user/.rhosts, the user must have search permissions for /home/user/).
The library routine ruserok() (see also rcmd()) performs the remote authentication. It
determines whether a particular remote user from a particular remote host is allowed
to access the local system as a (possibly different) particular local user:
• For non-root users, this routine checks /etc/hosts.equiv, and then the
.rhosts file in the home directory of the local user attempting access.
• For root, access is handled as a special case to help maintain system security; only
root’s .rhosts file is checked.
The rlogind daemon doesn’t allow root to log in without a password. When rsh is
specified without command options, rlogind (not rshd) is invoked on the remote
side.
If the remote authentication fails, rcp and rsh fail, but rlogin falls back to the
standard password-based login procedure.
Both files are formatted as a list of one-line entries of the form:
hostname [username]
where hostname must be the fully qualified domain name (FQDN) of the host, not one
of its aliases.
The entries in these files are either positive, to explicitly allow access without a
password, or negative, to deny it. Authentication succeeds as soon as a matching
positive entry is found, but fails when a matching negative entry is found, or if no
matching entries are found in either file. Therefore, the order of entries is important: if
the files contain both matching positive and negative entries, the entry that appears
first prevails.
Positive entries
Positive entries take these forms:
hostname All users from the named host are trusted and may access the system
with the same user name as they have on the remote system. You can
use this form in both /etc/hosts.equiv and individual users’
.rhosts files.
hostname username
The meaning of this form depends on which file it’s in:
• .rhosts file in a local user’s home directory — the named user
from the named host can access the system as that local user.
• /etc/hosts.equiv — the named remote user can access the
system as any local user.
You can use the special character “+” as a wild card in place of either hostname or
username to match any host or user:
+ Any user from any remote host can access the system, with the same
username.
+ username The named user from any remote host can access the system.
hostname + Any user from the named host can access the system as the local user.
Negative entries
Negative entries have a “-” character preceding either the hostname or username field.
For example:
hostname -username
Deny access to the named user if they attempt to access your system from the
named host without providing a password.
Caveats:
Use extreme caution in /etc/hosts.equiv with positive entries that include a
username field (either an individual named user, a netgroup, or “+” sign). Because
/etc/hosts.equiv applies system-wide, these entries allow one or a group of
remote users to access the system as any local user without providing a password. This
can be a security hole.
The file permissions for the ˜/.rhosts file must be as follows or its contents will be
ignored:
See also:
/etc/hosts, /etc/hosts.equiv, rcp, rlogin, rlogind, rsh
rcmd() in the Library Reference
Syntax:
rlogin [-8dE] [-e char] [-l username] host
Runs on:
Neutrino
Options:
-8 Allow an eight-bit input data path at all times. Without this option,
parity bits are stripped whenever the remote side’s stop and start
characters are ˆS and ˆQ.
-e char Use the specified character as the escape character (default is ˜).
You can specify this as a literal character or as an octal value in the
form \nnn.
host The official name, an alias, or the Internet address of a remote host.
Description:
The rlogin utility starts a terminal session on the specified remote host. To validate
the login ID, rlogin uses the standard Berkeley rhosts authorization mechanism.
Once you’re connected, typing:
escape_char .
disconnects you from the remote host. By default, the tilde (˜) character is the escape
character.
All echoing takes place at the remote site, so that (except for delays) the rlogin is
transparent. Flow control via ˆS and ˆQ and flushing of input and output on interrupts
are handled properly.
This utility needs to have the setuid (“set user ID”) bit set in its permissions. If you use
mkefs, mketfs, or mkifs on a Windows host to include this utility in an image, use
the perms attribute to specify its permissions explicitly, and the uid and gid
attributes to set the ownership correctly.
Files:
The rlogin utility requires the libsocket.so shared library.
Environment variables:
TERM Determines the user’s terminal type.
See also:
/etc/hosts.equiv, rcp, ˜/.rhosts, rlogind, rsh
Syntax:
rlogind [-aln]
Runs on:
Neutrino
Options:
-a Ask hostname for verification.
-l Prevent any authentication based on the user’s .rhosts file, unless the user is
logging in as the superuser.
Description:
The rlogind daemon is the server for the rlogin utility. The daemon provides a
remote login facility with authentication based on privileged port numbers from
trusted hosts.
The rlogind daemon is started when inetd receives a service request at the port
indicated by the login entry (inetd listens for service requests specified in the
inetd.conf file at a port defined in the services file). The following protocol is
initiated:
1 The server checks the client’s source port. If the port isn’t in the range
512-1023, the server aborts the connection.
2 The server checks the client’s source address and requests the corresponding
hostname (see gethostbyaddr(), the /etc/hosts file, and named). If the
hostname can’t be determined, the dot-notation representation of the host
address is used. If the hostname is in the same domain as the server (according
to the last two components of the domain name), or if the -a option is given,
rlogind requests the addresses for the hostname and verifies that the name and
address correspond. Normal authentication is bypassed if the address
verification fails.
Once the source port and address have been checked, rlogind proceeds with the
authentication process described in rshd. It then allocates a pseudo terminal, and
manipulates file descriptors so that the slave half of the pseudo terminal becomes the
standard input, standard output, and standard error for a login process.
The parent of the login process manipulates the master side of the pseudo terminal,
operating as an intermediary between the login process and the client instance of
rlogin. In most cases, “ˆS/ˆQ” facilities are provided to propagate interrupt signals
to the remote programs. The login process propagates the client terminal’s baud rate
and terminal type, as found in the TERM environment variable. The screen or
window size of the terminal is requested from the client, and window size changes
from the client are propagated to the pseudo terminal.
Transport-level keepalive messages, which are enabled unless -n is given, allow
sessions to be timed out if the client crashes or becomes unreachable.
Diagnostics
All initial diagnostic messages are indicated by a leading byte with a value of 1, after
which any network connections are closed. If there are no errors before login is
invoked, a NULL byte is returned as an indication of success.
Caveats:
The authentication procedure used here assumes the integrity of each client machine
and the connecting medium. This is insecure, but useful in an “open” environment.
See also:
devc-pty, /etc/hosts, /etc/hosts.equiv, inetd, login, named, rcp,
˜/.rhosts, rlogin, rsh, rshd, /etc/services
gethostbyaddr(), ruserok() in the Library Reference
TCP/IP Networking in the Neutrino User’s Guide
Syntax:
rm [-Rfir] [-d] [-l n] [-v] file...
Runs on:
QNX Neutrino, Microsoft Windows
Options:
-d (QNX Neutrino extension) If the -R option is specified, remove the files but
leave the directory tree intact (i.e. no rmdir is performed).
-f Force each specified file to be removed without prompting for confirmation.
-i Be interactive; request confirmation before removing each existing file.
-l n (“el”) (QNX Neutrino extension) If the -R option is specified, recurse only n
levels down a directory tree.
-r Equivalent to the -R option (below).
-R Recursively remove files and subdirectories under directories given as
arguments. This process removes the directory and the entire file tree under
it.
CAUTION: Use the -R option with care, as it removes directories, subdirectories, and
! files. Using the -i option with -R adds a measure of safety by turning on interactive
prompting before each file or directory is removed.
-v (QNX Neutrino extension) Be verbose; print files and directories as they’re
removed.
file The pathname of a file to be removed.
Description:
The rm utility removes each specified file from a directory.
By default, rm refuses to remove any file that names a directory. This may be
overridden with the -R or -r options. In any case, rm always refuses to remove the
current working directory.
If a file operand has been specified but doesn’t exist and the -f option hasn’t been
given, a message is written to the standard error output. If -f has been given, the error
message isn’t written. In either case, rm goes on to any remaining files specified on the
command line.
The rm utility doesn’t necessarily remove the file itself. A file may have more than one
link; that is, it may be known by more than one name in the filesystem (see the ln
utility for information on creating links). The rm utility breaks one such link; it
dissociates the file from one name. If this is the only link, the file data becomes
inaccessible and the file space is returned to the system for reuse. Otherwise, the data
remains accessible via other names.
Examples:
Remove the a.out and core files:
rm a.out core
Remove the directory junk and all its contents, without prompting:
rm -Rf junk
Exit status:
0 All the named files were removed.
See also:
rmdir, find
Syntax:
rmdir [-p] dir...
Runs on:
QNX Neutrino, Microsoft Windows
Options:
-p Remove the entire directory path (consisting only of directories that are empty
except for the named pathname components) of the directories specified on the
command line. (See example.)
Description:
The rmdir utility removes the directory specified by each dir operand, provided the
directory is empty.
The rmdir utility processes directories in the order they’re specified on the command
line. If you specify a parent directory, you should specify its subdirectory before the
parent directory. That way, the parent directory will be empty when the rmdir utility
tries to remove it.
Examples:
Remove the subdirectory oldfiles from the /home/fred directory:
rmdir /home/fred/oldfiles
rmdir -p dir1/dir2/dir3
Exit status:
0 Each directory specified by a dir operand referred to an empty directory and
was removed successfully.
See also:
rm, find
Syntax:
rndc [-b source-address] [-c config-file] [-k key-file] [-s server]
[-p port] [-V] [-y key_id] {command}
Runs on:
Neutrino
Options:
See http://netbsd.gw.com/cgi-bin/man-cgi?rndc++NetBSD-5.0 in the
NetBSD documentation.
Description:
The rndc utility controls the operation of a name server. Itcommunicates with the
name server over a TCP connection, sending commands authenticated with digital
signatures. For more information, see
http://netbsd.gw.com/cgi-bin/man-cgi?rndc++NetBSD-5.0 in the
NetBSD documentation.
See also:
rndc.conf, rndc-confgen, named, named.conf in the NetBSD documentation
Syntax:
rndc-confgen [-a] [-b keysize] [-c keyfile] [-h] [-k keyname]
[-p port] [-r randomfile] [-s address]
[-t chrootdir] [-u user]
Runs on:
Neutrino
Options:
See http://netbsd.gw.com/cgi-bin/man-cgi?rndc-confgen+8+NetBSD-5.0 in the
NetBSD documentation.
Description:
The rndc-confgen utility generates configuration files for rndc. You can use it as a
convenient alternative to writing the rndc.conf file and its controls and key
statements by hand. For more information, see
http://netbsd.gw.com/cgi-bin/man-cgi?rndc-confgen+8+NetBSD-5.0 in the NetBSD
documentation.
See also:
rndc, rndc.conf, named in the NetBSD documentation
Name:
rndc.conf
Description:
The rndc.conf file is the configuration file for rndc. For more information, see
http://netbsd.gw.com/cgi-bin/man-cgi?rndc.conf+5+NetBSD-5.0 in the
NetBSD documentation.
See also:
rndc, rndc-confgen in the NetBSD documentation
Syntax:
route [-f] [-n] [-q] [-v] command { [[modifiers] args] }
Runs on:
Neutrino
Options:
-f Remove all routes (as per flush). If used in conjunction with the add,
change, delete, or get commands, route removes the routes before
performing the command.
-n Don’t print host and network names symbolically when reporting actions.
(The process of translating between symbolic names and numerical
equivalents can be quite time consuming, and may require correct operation of
the network; thus it may be expedient to forgo this, especially when
attempting to repair networking operations.)
Description:
You use the route utility to manually manipulate the network routing tables. Because
the routing tables are usually taken care of by the routed daemon, you rarely need to
use this utility.
command options
The route utility accepts the following commands: add, change, delete, flush,
get, monitor, and show.
Here’s the syntax and the description for each command:
If the keyword, default, or the network address, 0.0.0.0, is specified, then all
packets sent to a remote network that’s not defined in the routing tables, are sent to the
specified gateway.
If you have an Internet Service Provider (ISP), packets sent to hosts on the Internet are
sent to a gateway provided by the ISP. See the defaultroute option in pppd.
If the route is via an interface rather than via a gateway, you should specify the
-interface modifier; the gateway given is the address of this host on the common
network, indicating the interface to be used for transmission.
You can use the optional -netmask modifier to specify an additional address
parameter that’s interpreted as a network mask. You can use this like an OSI ESIS
redirect with the netmask option, or to manually add subnet routes with netmasks
different from that of the implied network interface (as would otherwise be
communicated using the OSPF or ISIS routing protocols). After -netmask, enter the
address parameter you want interpreted as the network mask.
You can override the implicit network mask generated in the INET case by placing this
option after the destination parameter.
Similarly, you can use the -prefixlen modifier for IPv6.
Routes have associated flags which influence operation of the protocols when sending
to destinations matched by the routes. These flags may be set (or sometimes cleared)
by indicating the following corresponding modifiers:
-expire
-hopcount
-mtu
-recvpipe
-rtt
-rttvar
-sendpipe
-ssthresh
provide initial values to metrics maintained in the routing entry. To lock any of these
modifiers, precede the modifier with the -lock meta-modifier; you can also specify
the -lockrest meta-modifier to lock all ensuing metrics.
All symbolic names specified for a destination or gateway are looked up first as a
hostname using gethostname(). If this lookup fails, getnetbyname() is then used to
interpret the name as that of a network.
The route utility uses a routing socket and the new message types RTM_ADD,
RTM_DELETE, and RTM_CHANGE. As such, only the superuser may modify the
routing tables.
Diagnostics
add [host | network ] %s: gateway %s flags %x
The specified route is being added to the tables. The values
printed are from the routing table entry supplied in the ioctl() call.
If the gateway address used isn’t the primary address of the
gateway—the first one returned by gethostname() — the gateway
address is printed numerically as well as symbolically.
Network is unreachable
An attempt to add a route failed because the gateway listed wasn’t
on a directly connected network. The next-hop gateway must be
given.
not in table A delete operation was attempted for an entry not present in the
tables.
routing table overflow
An add operation was attempted, but the system was low on
resources and couldn’t allocate memory to create the new entry.
Permission denied
The attempted operation is privileged. Only root may modify the
routing tables. These privileges are enforced by the kernel.
License:
This utility is based on copyright software of the Regents of the University of
California and of Christos Zoulas; for licensing information, see the Third Party
License Terms List at http://licensing.qnx.com/third-party-terms/.
See also:
/etc/autoconnect, netmanager, phlip, pppd, routed
Syntax:
route6d [-aDdhlqSs] [-A prefix/preflen,if1[,if2...]]
[-L prefix/preflen,if1[,if2...]]
[-N if1[,if2...]] [-O prefix/preflen,if1[,if2...]]
[-R routelog] [-T if1[,if2...]] [-t tag]
Runs on:
Neutrino
Options:
-A prefix/preflen,if1[,if2...]
Allow routes to be aggregated, where prefix specifies the prefix, and
preflen the prefix length, of the aggregated route. When advertising
routes, route6d filters specific routes covered by the aggregate, and
advertises the aggregated route (prefix/preflen) to the interfaces
specified in the comma-separated interface list, if1[,if2...]. route6d
creates A static route to prefix/preflen with the RTF_REJECT flag is
created in the kernel routing table.
-L prefix/preflen,if1[,if2...]
Filter incoming routes from interfaces if1,[if2...] and accept
incoming routes that are in prefix/preflen. If you’d like to accept any
route, don’t specify this option.
If multiple -L options are specified, any routes that match one of the
options is accepted. If ::/0 is specified, it’s treated as the default
route, not “any route that has longer prefix length than, or equal to 0.”
For example, route6d accepts the default route and routes in the
6bone test address, but in no others, if you specify:
-L 3ffe::/16,if1 -L ::/0,if1
space is rather vague (the specification is still being worked on), and
there’s no good way to define site-local boundaries. It must not be
used on site-boundary routers, since this option assumes that all
interfaces are in the same site.
-s Advertise the statically defined routes that exist in the kernel routing
table when route6d invoked. Announcements obey the regular
split-horizon rule.
-t tag Attach this route tag to originated route entries. You can specify tag
in decimal, octal (prefixed by 0), or hexadecimal (prefixed by 0x).
Description:
The route6d utility is a routing daemon which supports Routing Information
Procotol (RIP) over IPv6.
When a SIGINT or SIGUSR1 signal is received, route6d dumps the current internal
state into /var/run/route6d_dump.
The route6d utility uses IPv6 advanced API, defined in RFC2292, for
communicating with peers using link-local addresses.
Internally route6d embeds the interface identifier into bits 32 to 63 of link-local
addresses (fe80::xx and ff02::xx) so they’ll be visible on the internal state dump file
(/var/run/route6d_dump).
The routing table manipulation differs from IPv6 implementation to implementation.
Currently route6d obeys WIDE Hydrangea/KAME IPv6 kernel. Currently, route6d
doesn’t reduce the rate of the triggered updates when consecutive updates arrive.
Files:
/var/run/route6d_dump
Dump internal state on SIGINT or SIGUSR1.
See also:
route
G. Malkin, and R. Minnear, RIPng for IPv6, RFC2080, January 1997.
Syntax:
routed [-Adghmqstv] [-F net [/mask[,metric]]]
[-P parms] [-T tracefile]
Runs on:
Neutrino
Options:
-A Don’t ignore RIPv2 authentication if we don’t care about RIPv2
authentication. This option is required for conformance with RFC
1723. However, it makes no sense and breaks using RIP as a
discovery protocol to ignore all RIPv2 packets that carry
authentication when this machine doesn’t care about authentication.
-d Don’t run in the background (for interactive use only).
-F net[/mask][,metric]
Minimize routes in transmissions via interfaces with addresses that
match net/mask, and synthesizes a default route to this machine with
the metric. The intent is to reduce RIP traffic on slow, point-to-point
links such as PPP links by replacing many large UDP packets of RIP
information with a single, small packet containing a “fake” default
route. If metric is absent, a value of 14 is assumed to limit the spread
of the “fake” default route. This is a dangerous feature that when
used carelessly can cause routing loops. Notice also that more than
one interface can match the specified network number and mask. See
also -g.
-g This option, which is used on internetwork routers to offer a route to
the “default” destination, is typically used on a gateway:
• to the Internet
• that uses another routing protocol whose routes aren’t reported to
other local routers.
It’s equivalent to -F 0/0,1 and exists for historical reasons. Because
a metric of 1 is used, it’s very likely that you’ll create chaos with a
routing loop rather than solve your problem. We recommend that you
use -P pm_rdisc on the command line, or add pm_rdisc to your
/etc/gateways file. Because a larger metric is used, the likelihood
of spreading a potentially dangerous default route is reduced.
-h Don’t advertise host or point-to-point routes, provided there’s a
network route going in the same direction. This option is a limited
kind of aggregation, and is useful on gateways to Ethernets that have
other gateway machines connected with point-to-point links.
logfile The name of file in which routed’s actions are to be logged. This
log contains information about any changes to the routing tables; if
-t isn’t specified to trace all packets, the log also maintains a history
of recent messages sent and received that are related to the changed
route.
Any other argument supplied is interpreted as the name of a file in which the actions of
routed should be logged. It’s better to use -T instead of appending the name of the
trace file to the command.
Description:
The routed daemon is invoked at boot time to manage the network routing tables. It
uses Routing Information Protocol (RIP), RIPv1 (RFC 1058), RIPv2 (RFC 1723), and
Internet Router Discovery Protocol (RFC 1256) to maintain the kernel routing table.
The RIPv1 protocol is based on the reference 4.3BSD daemon.
It listens on the UDP socket for the route service for Routing Information Protocol
packets. It also sends and receives multicast Router Discovery ICMP messages. If the
host is a router, routed periodically supplies copies of its routing tables to any
directly connected hosts and networks. It also advertise or solicits default routes using
Router Discovery ICMP messages.
When started (or when a network interface is later turned on), routed uses an
AF_ROUTE address family facility to find those directly connected interfaces
configured into the system and marked “up.” It adds necessary routes for the interfaces
to the kernel routing table. Soon after being first started, and provided there is at least
one interface on which RIP hasn’t been disabled, routed deletes all pre-existing
non-static routes in kernel table. Static routes in the kernel table are preserved and
included in RIP responses if they have a valid RIP metric.
If more than one interface is present (not counting the loopback interface), it is
assumed that the host should forward packets among the connected networks. After
transmitting a RIP request and Router Discovery Advertisements or Solicitations on
a new interface, the daemon enters a loop, listening for RIP request and response and
Router Discovery packets from other hosts.
When a request packet is received, routed formulates a reply based on the
information maintained in its internal tables. The response packet generated
contains a list of known routes, each marked with a “hop count” metric (a count of 16
or greater is considered “infinite”). Advertised metrics reflect the metric associated
with interface (see ifconfig), so setting the metric on an interface is an effective way
to steer traffic.
Responses don’t include routes with a first hop on the requesting network to
implement in part split-horizon. Requests from query programs such as rtquery are
answered with the complete table.
The routing table maintained by the daemon includes space for several gateways for
each destination to speed recovery from a failing router. RIP response packets
received are used to update the routing tables provided they are from one of the several
currently recognized gateways or advertise a better metric than at least one of the
existing gateways.
When an update is applied, routed records the change in its own tables and updates
the kernel routing table if the best route to the destination changes. The change in the
kernel routing table is reflected in the next batch of response packets sent. If the next
response isn’t scheduled for a while, a flash update response containing only recently
changed routes is sent.
In addition to processing incoming packets, routed also periodically checks the
routing table entries. If an entry hasn’t been updated for 3 minutes, the entry’s metric
is set to infinity and marked for deletion. Deletions are delayed until the route has been
advertised with an infinite metric to insure the invalidation is propagated throughout
the local internet. This is a form of poison reverse. Routes in the kernel table, that are
added or changed as a result of ICMP redirect messages, are deleted after a while to
minimize black-holes. When a TCP connection suffers a timeout, the kernel tells
routed, which deletes all redirected routes through the gateway involved, advances
the age of all RIP routes through the gateway to allow an alternate to be chosen, and
advances of the age of any relevant Router Discovery Protocol default routes.
Hosts acting as internetwork routers gratuitously supply their routing tables every 30
seconds to all directly connected hosts and networks. These RIP responses are sent to
the broadcast address on nets that support broadcasting, to the destination address on
point-to-point links, and to the router’s own address on other networks. If RIPv2 is
enabled, multicast packets are sent on interfaces that support multicasting.
If no response is received on a remote interface, if there are errors while sending
responses, or if there are more errors than input or output (see netstat), then the
cable or some other part of the interface is assumed to be disconnected or broken, and
routes are adjusted appropriately.
The Internet Router Discovery Protocol is handled similarly. When the daemon is
supplying RIP routes, it also listens for Router Discovery Solicitations and sends
Advertisements. When it is quiet and listening to other RIP routers, it sends
Solicitations and listens for Advertisements. If it receives a good Advertisement and
it’s not multihomed, it stops listening for broadcast or multicast RIP responses. It
tracks several advertising routers to speed recovery when the currently chosen router
dies. If all discovered routers disappear, the daemon resumes listening to RIP
responses. It continues listening to RIP while using Router Discovery if multihomed
to ensure all interfaces are used.
The Router Discovery standard requires that advertisements have a default “lifetime”
of 30 minutes. That means should something happen, a client can be without a good
route for 30 minutes. It is a good idea to reduce the default to 45 seconds using
-P rdisc_interval=45
on the command line, or
rdisc_interval=45
in the /etc/gateways file.
While using Router Discovery (which happens by default when the system has a
single network interface and a Router Discover Advertisement is received), there is a
single default route and a variable number of redirected host routes in the kernel table.
On a host with more than one network interface, this default route will be via only one
of the interfaces. Thus, multi-homed hosts running with -q might need no_rdisc
described below.
See the pm_rdisc facility described below to support “legacy” systems that can
handle neither RIPv2 nor Router Discovery.
By default, neither Router Discovery advertisements nor solicitations are sent over
point to point links (e.g. PPP). The netmask associated with point-to-point links (such
as PPP with the IFF_POINTOPOINT flag) is used by routed to infer the netmask used
by the remote system when RIPv1 is used.
The routed daemon supports the notion of “distant” passive or active gateways.
When routed is started, it reads /etc/gateways to:
• find distant gateways which may not be located using only the information from a
routing socket
Files:
/etc/gateways List of the distant gateways which may not be located using
only the information from a routing socket.
See also:
ICMP and UDP protocols
gated (an unsupported version is available on the QDN), /etc/gateways file,
rtquery
Internet Transport Protocols, XSIS 028112, Xerox System Integration Standard.
Name:
/etc/rpc
Description:
The rpc file contains user-readable names that can be used in place of rpc program
numbers. Each line has the following information:
Items are separated by any number of blanks or tabs, or both. A pound sign (#) in a
line indicates the beginning of a comment — any characters after a #, up to the end of
the line, aren’t interpreted by routines that search the file.
Syntax:
rpcbind [-dilLs]
Runs on:
Neutrino
Options:
-d Run in debug mode. In this mode, it doesn’t fork when it starts. Also, it prints
additional information during operation, or aborts on certain errors.
Name-to-address translation consistency checks are also shown in detail.
-i Make rpcbind insecure. You need this option to switch to nonsecure mode.
This option allows SET and UNSET from any host. Normally rpcbind
accepts these requests only from the loopback interface for security reasons.
This change is necessary for programs that were compiled with earlier versions
of the RPC library and don’t make those requests using the loopback interface.
-L Allow old-style local connections over the loopback interface. Without this
option, local connections are only allowed over a local socket
/var/run/rpcbind.sock.
-s Cause rpcbind to change to the user daemon as soon as possible. Using the
rpcbind utility, you use nonprivileged ports for outgoing connections, and
prevent nonprivileged clients to connect to services from a privileged port.
Description:
The rpcbind server converts RPC program numbers into universal addresses. You
must run this utility on the host to make RPC calls on a server.
When an RPC service is started, it tells rpcbind the address at which it is listening
and the RPC program numbers it is prepared to serve. When a client wishes to make
an RPC call to a given program number, it first contacts rpcbind on the server
machine to determine the address where RPC requests should be sent.
The rpcbind utility should be started before any other RPC service. Normally,
standard RPC servers are started by port monitors, so rpcbind must be started before
port monitors are invoked.
When rpcbind is started, it checks that certain name-to-address translation calls
function correctly. If they fail, the network configuration databases may be corrupt.
Since RPC services cannot function correctly in this situation, rpcbind reports the
condition and terminates.
The rpcbind utility is secure by default, and can be started only by the superuser.
Standard RPC servers can be run by inetd, so you must start rpcbind before inetd
is invoked.
Files:
The rpcbind utility needs /etc/netconfig, as well as the following entries in
/etc/services:
Caveats:
If you restart rpcbind, you must restart all RPC servers.
See also:
rpcgen, rpcinfo
Syntax:
rpcgen infile
Runs on:
Neutrino
Options:
-a Generate all the files including sample code for client and
server side.
-C Generate ANSI C code. This option also generates code that
could be compiled with the C++ compiler.
-c Compile into XDR routines.
-D macro[=value] Define a macro. It is equivalent to the #define directive in the
source. If no value is given, value defaults to 1. This option
may be specified more than once.
-h Compile into C data definitions (a header file).
-K secs Terminate after secs seconds of idleness. The default is 120
seconds. -K 0 means exit immediately upon servicing a
request (useful if the server is started by inetd). -K -1
disables the idle timer, so the server never exits.
-L Use syslog() for error reporting. In order to capture the log
messages, you need to have syslogd running.
-l (“el”) Compile into client-side stubs.
-m Compile into server-side stubs, but don’t generate a main
routine. You should find this useful for doing callback routines
or for when you need to write your own main routine to do
initialization.
-o outfile Use this output file. If you don’t specify a file, rpcgen uses
the standard output (-c, -h, -l, -m, -Sc, -Ss, and -s modes
only).
-s transport Compile into server-side stubs, using this transport. The
compiler supports the transports udp and tcp (default is udp).
You can invoke this option more than once to compile a server
that serves multiple transports. The transports are chosen at
run time and not at compile time.
-Ss Generate skeleton code for the remote procedure on the server
side. You need to fill in the actual code for the remote
procedures.
infile Use this input file. If you don’t specify an input file in the -c,
-h, -l, -m, and -s modes, rpcgen uses the standard input.
Description:
The rpcgen compiler generates C code to implement an RPC protocol. The input
rpcgen takes is a C-like language known as Remote Procedure Call Language. For
more information about this language, we recommend Power Programming with RPC
by John Bloomer, O’Reilly & Associates, 1992. ISBN: 0937175773.
You normally use rpcgen in its first form, where it takes an input file and generates
four output files. For example, if you specify an infile called proto.x, then rpcgen
generates:
When you use the -Sc option, it generates sample code to illustrate how to use remote
procedures on the client side. This code is created in proto_client.c. When you
use the -Ss option, it generates sample server code to illustrate how to write remote
procedures. This code is created in proto_server.c.
You use the other syntax forms when you want to generate only one of these output
files.
Once you create a server, it can be started by the port monitors (for example, inetd or
listen) or by itself. When it is started by a port monitor, it creates servers only for
the transport for which the file descriptor 0 was passed. The name of the transport
must be specified by setting up the environmental variable PM_TRANSPORT. When
the server, generated by rpcgen, is executed, it creates server handles for all the
transports specified in the NETPATH environment variable, or if it is unset, it creates
server handles for all the visible transports from the /etc/netconfig file.
You use the other syntax forms when you want to generate only one of these output
files. When rpcgen is executed with the -s option, it creates servers for that
particular class of transports. When executed with the -n option, it creates a server for
the transport specified by netid. If infile is not specified, rpcgen accepts the
standard input.
The C compiler is used to preprocess all input files before they’re actually interpreted
by rpcgen, so all the preprocessor directives are legal within an rpcgen input file.
For each type of output file, rpcgen defines a special symbol for your use:
In addition, rpcgen does some preprocessing of its own. It leaves any line beginning
with a % uninterpreted and passes the line directly into the output file.
You can customize some of your XDR routines by leaving associated data types
undefined. For every data type you leave undefined, rpcgen assumes a routine exists
whose name starts with xdr_ and ends with the name of the undefined type.
Caveats:
The compiler doesn’t support nesting. You can achieve the same effect, however, by
declaring structures at the top level and using their names inside other structures.
When you use program definitions, name clashes can occur since the apparent scoping
doesn’t apply. You can avoid most of these clashes by assigning unique names to
programs, versions, procedures, and types.
The server code generated with the -n option refers to the transport indicated by
netid, and hence is very site specific.
See also:
rpcbind, rpcinfo, syslogd
syslog() in the Library Reference
Syntax:
rpcinfo -p [host]
Runs on:
Neutrino
Options:
-b program version
Using UDP, make an RPC broadcast to procedure 0 of the
specified program and version, and report all hosts that respond.
-d program version
Delete the registration for the RPC service of the specified
program and version. Only the superuser can use this option.
-n portnum Use portnum as the port number for the -t and -u options
instead of the port number given by the portmapper.
-p [host] Probe the portmapper on host and print a list of all registered
RPC programs. If a host isn’t specified, use the standard
hostname for the current processor.
-t host program Using TCP, make an RPC call to procedure 0 of program on the
specified host and report whether a response was received.
-u host program Using UDP, make an RPC call to procedure 0 of program on the
specified host and report whether a response was received.
Description:
The rpcinfo utility makes an RPC call to an RPC server and reports what it finds.
Examples:
Show all the RPC services registered on the local machine:
rpcinfo -p
Show all the RPC services registered on the machine named klaxon:
rpcinfo -p klaxon
rpcinfo -d walld 1
Files:
/etc/rpc RPC program number database.
See also:
/etc/rpc, rpcbind
Syntax:
rsh [-dn] [-l username] host [command]
Runs on:
Neutrino
Options:
-d Using setsockopt(), turn on socket debugging on the TCP sockets
used for communication with the remote host.
-l username Use the specified remote name (the default remote name is the same
as the local username). Authorization is determined as in rlogin.
Description:
The rsh utility executes command on host. The standard input of rsh is copied to the
remote command, and the standard output and standard error of the remote command
are copied to rsh’s standard output and standard error. Interrupt, quit, and terminate
signals are propagated to the remote command; rsh normally terminates when the
remote command does.
If you don’t specify a command, you’re logged in on the remote host via rlogin.
Shell metacharacters that aren’t quoted are interpreted on the local machine; quoted
metacharacters are interpreted on the remote machine. For example, the command:
This utility needs to have the setuid (“set user ID”) bit set in its permissions. If you use
mkefs, mketfs, or mkifs on a Windows host to include this utility in an image, use
the perms attribute to specify its permissions explicitly, and the uid and gid
attributes to set the ownership correctly.
Files:
/etc/hosts Hostname database.
Caveats:
You can’t use rsh to run an interactive command such as vi; use rlogin instead.
See also:
esh, fesh, /etc/hosts.equiv, ksh, rcp, ˜/.rhosts, rlogin, rlogind, rshd,
sh, uesh
Syntax:
rshd [-aln]
Runs on:
Neutrino
Options:
-a Request the address for the hostname, and verify whether the address and name
correspond.
-l Unless the user is the superuser, prevent any validation based on the user’s
.rhosts file.
Description:
The rshd daemon is the server for the rcmd() function and, consequently, for the rsh
utility. The daemon provides remote execution facilities with authentication based on
privileged port numbers from trusted hosts.
The rshd daemon is started when inetd receives a service request at the port
indicated by the cmd entry (inetd listens for service requests specified in the
inetd.conf file at a port defined in the services file). The following protocol is
initiated:
1 The server checks the client’s source port. If the port isn’t in the range
512-1023, the server aborts the connection.
2 The server reads characters from the socket up to a NULL (\0) byte. The
resultant string is interpreted as an ASCII number, base 10.
3 If the number received in step 2 is nonzero, it’s interpreted as the port number of
a secondary stream to be used for standard error. A second connection is then
created to the specified port on the client’s machine. The source port of this
second connection is also in the range 512-1023.
4 The server checks the client’s source address and requests the corresponding
hostname (see gethostbyaddr(), the /etc/hosts file, and named). If the
hostname cannot be determined, the dot-notation representation of the host
address is used. If the hostname is in the same domain as the server (according
to the last two components of the domain name), or if the -a option is given, the
address for the hostname is requested, and the server verifies whether the
8 The rshd server then validates the user by means of ruserok(), which uses the
file /etc/hosts.equiv and the file .rhosts found in the user’s home
directory. The -l option prevents ruserok() from doing any validation based on
the user’s .rhosts file unless the user is the superuser.
9 A NULL byte is returned on the initial socket and the command line is passed to
the normal login shell of the user. The shell inherits the network connections
established by rshd.
Transport-level keepalive messages, which allow sessions to be timed out if the
client crashes or becomes unreachable, are enabled unless the -n option is given.
Diagnostics
Except for the last one listed below, all diagnostic messages are returned on the initial
socket, after which any network connections are closed. An error is indicated by a
leading byte with a value of 1 (0 is returned in step 9 above upon successful
completion of all the steps prior to the execution of the login shell).
Remote directory.
The chdir command to the home directory failed.
Caveats:
The authentication procedure used here assumes the integrity of each client machine
and the connecting medium. Though insecure, this procedure is useful in an “open”
environment.
See also:
/etc/hosts, inetd, named, rsh
gethostbyaddr(), rcmd(), ruserok() in the Library Reference
TCP/IP Networking in the Neutrino User’s Guide
Syntax:
rtadvd [-c configfile] [-dDfRs] interface ...
Runs on:
Neutrino
Options:
-c configfile Specify an alternate location, configfile, for the configuration file. By
default, /etc/rtadvd.conf is used.
Description:
The rtadvd daemon advertises router advertisement packet to the specified interfaces.
The program will daemonize itself on invocation. It will then periodically send router
advertisement packets, as well as in response to router solicitation messages sent by
end hosts.
Router advertisements can be configured on a per-interface basis, as described in
rtadvd.conf.
If there is no configuration file or the interface doesn’t have a configuration file entry,
rtadvd sets all the parameters to their default values. In particular, rtadvd reads all
the interface routes from the routing table and advertises them as on-link prefixes.
The daemon also watches the routing table. By default, if an interface direct route is
added on an advertising interface and no static prefixes are specified by the
configuration file, rtadvd adds the corresponding prefix to its advertising list.
Similarly, if such a route is deleted, rtadvd deletes the corresponding prefix from the
list. The -s option disables this behavior. Moreover, if the status of an advertising
interface changes, rtadvd will start or stop sending router advertisements according
to the latest status.
Upon receipt of signal SIGUSR1, rtadvd will dump the current internal state into
/var/run/rtadvd.dump.
Use SIGTERM to kill rtadvd gracefully. In this case, rtadvd will transmit router
advertisement with router lifetime 0 to all the interfaces (according to RFC2461 6.2.5).
Examples:
Start the router advertisement daemon:
rtadvd
Files:
/etc/rtadvd.conf
Default configuration file.
/var/run/rtadvd.pid
Contains the PID of the currently running rtadvd.
/var/run/rtadvd.dump
The file in which rtadvd dumps its internal state.
Exit status:
0 Success.
>0 An error occurred.
Contributing author:
Andrey A. Chernov
License:
This utility is based on copyright software of the Regents of the University of
California; for licensing information, see the Third Party License Terms List at
http://licensing.qnx.com/third-party-terms/.
Caveats:
Router advertisements should only be performed downstream. Erroneous upstream
advertisements will cause ICMPv6 redirect packet storms in the subnet, as (per the
specification) the advertising router is assumed to become the default router for end
hosts in the subnet.
See also:
rtadvd.conf, rtsold
Based on Thomas Narten, Erik Nordmark and W. A. Simpson, Neighbor Discovery for
IP version 6 (IPv6), RFC 2461.
Name:
/etc/rtadvd.conf
Description:
This file describes how the router advertisement packet must be constructed for each
of the interfaces.
Each line in the file describes a network interface. Fields are separated by a colon (:),
and each field contains one capability description. Lines may be concatenated by
using the backslash (\) character. The comment marker is the pound sign (#).
Capabilities
Capabilities describe the value to be filled into ICMPv6 router advertisement messages
and to control rtadvd behavior. Therefore, you are encouraged to read IETF neighbor
discovery documents if you would like to modify the sample configuration file.
Almost all items have default values. If you omit an item, the default value of the item
will be used.
The following two items control the interval of sending router advertisements:
maxinterval
This is the maximum time (in seconds) allowed between sending unsolicited multicast
router advertisements. The value must be be no less than 4 seconds and no greater than
1800 seconds. The default value is 600.
mininterval
The minimum time (in seconds) allowed between sending unsolicited multicast router
advertisements. Its value must be no less than 3 seconds and no greater than .75 * the
value of maxinterval. The default value is one third of the value of maxinterval.
The following items are for ICMPv6 router advertisement message header.
chlim
The number value for Cur Hop Limit field. The default value is 64.
raflags
A number specifying the Flags field in router advertisement message header. Bit 7
(0x80) means Managed address configuration flag bit, and Bit 6 (0x40) means Other
stateful configuration flag bit. The default value is 0.
rltime
The number of seconds specifying the Router lifetime field. Its value must be no
greater than 3600000. The default value is 1800.
rtime
The number of milliseconds specifying the Reachable time field. The default value is
0, which means unspecified by this router.
retrans
The number of milliseconds specifying the Retrans Timer field. The default value is 0,
which means unspecified by this router.
The following items are for ICMPv6 prefix information option, which will be attached
to router advertisement header.
addrs
The number of prefixes. Its default is 0, so it must explicitly be set to positive values if
you want to specify any prefix information option. If its value is 0, rtadvd looks up
the system routing table and advertise the prefixes corresponding to interface routes on
the interface. If its value is more than 1, you must specify the index of the prefix for
each item below. Indices vary from 0 to N-1, where N is the value of addrs. Each
index shall follow the name of each item, e.g. prefixlen2.
prefixlen
A number specifying the Prefix length field. The default value is 64.
pinfoflags
A number specifying the Flags field in prefix information option. Bit 7 (0x80) means
On-link flag bit, and Bit 6 (0x40) means Autonomous address-configuration flag bit.
The default value is 0xc0, i.e. both bits are set.
addr
A string specifying the address filled into Prefix field. Since the colon character (:) is
used for IPv6 numeric address, the field must be quoted by the double-quote character
“ ”. This field cannot be omitted if the value of addrs is more than 0.
vltime
The number of seconds specifying the Valid lifetime field. The default value is
2592000 (30 days).
pltime
The number of seconds specifying the Preferred lifetime field. The default value is
604800 (7 days).
The following items are for ICMPv6 MTU option, which will be attached to router
advertisement header.
mtu
A number or string that specifies the MTU (maximum transmission unit) field. If 0 is
specified, it means that the option will not be included. The default value is 0. If the
special string “auto” is specified for this item, MTU option will be included and its
value will be set to the interface MTU automatically.
The following item controls ICMPv6 source link-layer address option, which will be
attached to router advertisement header.
nolladdr
A boolean expression. By default (if nolladdr is not specified), rtadvd will try to
get link-layer address for the interface from the kernel, and attach that in source
link-layer address option. If this capability exists, rtadvd(8) will not attach source
link-layer address option to router advertisement packets.
Examples:
#
# common definitions.
#
default:\
:raflags#0:rltime#3600:\
:pinfoflags#64:vltime#360000:pltime#360000:mtu#1500:
ether:\
:mtu#1280:tc=default:
#
# interfaces.
#
ef0:\
:addrs#1:\
:addr="3ffe:501:4819:1000::":tc=ether:
ef1:\
:addrs#2:addr0="3ffe:501:4819:2000::":\
:addr1="3ffe:501:4819:3000::":tc=ether:
See also:
rtadvd, rtsold
Based on Thomas Narten, Erik Nordmark and W. A. Simpson, Neighbor Discovery for
IP version 6 (IPv6), RFC 2461.
Syntax:
Update the current time based on the time from the specified clock:
rtc [-b [base][,[reg_shift][,[mem_map][,c_offset]]]]
[-l] [-r rate] [-S seconds] clock_type
Set the time of the specified clock to the current time:
rtc [-b [base][,[reg_shift][,[mem_map][,c_offset]]]]
-s [-l] clock_type
Runs on:
Neutrino
Options:
-b [base][,[reg_shift][,[mem_map][,c_offset]]]
The location of the RTC chip:
• base — the base address of the chip.
• reg_shift — spacing of the device registers as a power of 2. For
example:
0 Registers are 1 byte apart.
1 Registers are 2 bytes apart.
2 Registers are 4 bytes apart.
...
n Registers are 2n bytes apart.
The default reg_shift is 0.
• mem_map — memory or I/O space.
• c_offset — offset to the century byte in NVRAM.
-l (“el”) Set hardware time to local time, not Coordinated Universal
Time (UTC). UTC is the standard term for Greenwich Mean Time
(GMT). The -l option has no effect if the clock_type is net.
-r rate Rate at which to adjust the OS time if it’s currently within 60 seconds
(or value set by -S) of the time from the source specified by
clock_type. The rate is turned into a percentage 1/rate. The default
rate is 100 (1%).
-S seconds Specify the maximum number of seconds difference between current
time and new time before jam loading rather than slowly adjusting.
(see -r for the convergence speed). Default: 60.
Description:
The rtc command gets or sets the date and time from a battery backed-up hardware
clock.
If your machine has a builtin clock/calendar, you should include the following
command in your startup script so QNX Neutrino automatically reads the time when
the system starts:
rtc hw
If the RTC chip has been set to the UTC timezone, startup sets the correct time of day
automatically on booting. If the RTC chip is set to local time, or for some reason
startup doesn’t know where the RTC chip is, you’ll need to include the appropriate
rtc command in the startup script specified in your mkifs buildfile.
You can use clock type net [node] to get the date from a specified node, or to set the
date on a specified node. If node isn’t specified, the default is the local machine. When
clock type net [node] is used, the -l option has no effect.
Be careful if you set the date during the period that a time zone is switching to
daylight saving time (DST). When a time zone changes to DST, the local time goes
back one hour (for example, 2:00 a.m. becomes 1:00 a.m.). The local time during this
hour is ambiguous (e.g. 1:14 a.m. occurs twice in the morning that the time zone
switches to DST). To avoid problems, use UTC time to set the date in this period.
Examples:
Update the current date and time from the hardware clock:
rtc hw
rtc -s hw
Exit status:
0 Successful.
See also:
date, mkifs, phlocale
Syntax:
rtquery [-1np] [-a secret] [-r addr] [-w timeout] host ...
[-t op] host ...
Runs on:
Neutrino
Options:
-1 Query using RIP version 1 instead of RIP version 2.
-a passwd=XXX
-a md5_passwd=XXX|KeyID
Send the query with the specified RIPv2 cleartext or RIPv2 MD5
password.
-n Display only the numeric network and host numbers instead of both
the numeric and symbolic values.
-w timeout Change the delay for an answer from each host. By default, each host
has 15 seconds to respond.
Description:
The rtquery utility is used to query a RIP network routing daemon, routed or
gated, for its routing table by sending a request or poll command. The routing
information in any routing response packets returned is displayed numerically and
symbolically.
By default, it uses the request command. When -p is specified, rtquery uses the
poll command, an undocumented extension to the RIP protocol supported by gated.
When querying gated, the poll command is preferred over the request command
because the response is not subject to split-horizon and/or Poisoned Reverse, and
because some versions of gated do not answer the request command. Although
routed doesn’t answer the poll command, it recognizes requests coming from
rtquery and answers them completely.
The utility is also used to turn tracing on or off in routed.
See also:
gated (an unsupported version is available on the QDN), /etc/gateways, routed
Based on:
Syntax:
rtsold [-1Ddfm] -a
rtsold [-1Ddfm] interface ...
rtsol [-Dd] -a
rtsol [-Dd] interface ...
Runs on:
Neutrino
Options:
-1 Perform only one probe. Send Router Solicitation packets until valid
Router Advertisement packets arrive from all the interfaces, then exit.
-d Enable debugging.
-m Enable mobility support; send probing packets to the default routers that
advertised Router Advertisements when the node (re)attached to an
interface. Periodically send Router Solicitation on an interface that
doesn’t support SIOCGIFMEDIA ioctl.
Description:
The rtsold daemon sends ICMPv6 Router Solicitation messages on the specified
interfaces. If a node (re)attaches to a link, rtsold sends some Router Solicitations on
the link destined to the link-local scope all-routers multicast address to discover new
routers and to get non link-local addresses.
If you use rtsol, probes are transmitted from the interface specified, without
becoming a daemon. It behaves the same as:
The rtsold daemon sends at most three Router Solicitations on an interface after one
of the following events:
• Every 60 seconds, if -m is specified and rtsold can’t get the interface status. This
feature doesn’t conform to IPv6 neighbor discovery specification, but is provided
for mobile stations. The default interval for router advertisements, which is on the
order of 10 minutes, is slightly long for mobile stations. This feature is provided
for such stations so that they can find new routers as soon as possible when they
attach to another link.
Once rtsold sends a Router Solicitation, and receives a valid Router Advertisement,
it refrains from sending additional solicitations on that interface, until the next time
one of the above events occurs.
When sending a Router Solicitation on an interface, rtsold includes a Source
Link-layer address option if the interface has its link-layer address.
When a SIGUSR1 signal is received, rtsold dumps the current internal state into
/var/run/rtsold.dump.
Files:
/var/run/rtsold.pid
The pid of the currently running rtsold.
/var/run/rtsold.dump
Dump of the current internal state.
Exit status:
0 Successful completion.
Caveats:
Before this utility will work, you need to enable the TCP/IP stack to accept route
advertisements, like this:
sysctl -w net.inet6.ip6.accept_rtadv=1
See also:
rtadvd, sysctl
Syntax:
ruptime [-alrtu]
Runs on:
Neutrino
Options:
-a Count all users. Without -a, users who are idle for an hour or more aren’t
counted.
-t Sort by uptime.
Description:
The ruptime utility gives a status-line-like uptime for each machine on the local
network; each uptime is formed from packets that are broadcast once a minute by each
host on the network.
Machines for which no status report has been received for 11 minutes are shown as
being down.
The default listing is sorted by hostname.
Files:
/var/rwho/whod.*
Data files
Caveats:
QNX Neutrino doesn’t calculate load average, so only non-QNX Neutrino hosts can
have nonzero load averages.
See also:
rwho
Syntax:
rwho [-a]
Runs on:
Neutrino
Options:
-a Count all users. Without -a, users who are idle for an hour or more aren’t
counted.
Description:
The rwho utility produces output similar to that produced by who, but for all machines
on the local network. If no report has been received from a machine for five minutes,
rwho assumes the machine is down, and doesn’t report users last known to be logged
into that machine.
If a user hasn’t typed to the system for a minute or more, rwho reports this idle time.
A user who hasn’t typed to the system for an hour or more is omitted from the output
of rwho unless you specify the -a option.
Files:
/var/rwho/whod.*
Information about other machines.
Caveats:
This utility is unwieldy when the number of machines on the local net is large. It’s
unreliable due to protocol issues.
See also:
ruptime, rwhod, who
Syntax:
rwhod [-i interval] [-u user]
Runs on:
Neutrino
Options:
-i interval Specify the broadcast interval in seconds, or in minutes if interval has
a suffix of m. The default is 3 minutes; the maximum is 11 minutes
because higher values will cause ruptime to mark the host as being
down.
Description:
The rwhod daemon is the server that maintains the database used by the rwho and
ruptime utilities. Its operation is based on the network’s ability to transmit broadcast
messages.
The rwhod daemon operates as both a producer and a consumer of status information.
As a producer of information, it periodically queries the state of the system and
constructs status messages that are broadcast on a network. As a consumer of
information, it listens for other rwhod daemons’ status messages, validating them,
then recording them in a collection of files located in the directory /var/rwho.
The daemon transmits and receives messages at the port indicated by the rwho entry
in the /etc/services file.
Messages received by the rwhod daemon are discarded unless they originated at an
rwhod daemon’s port. In addition, if the host’s name, as specified in the message,
contains any unprintable ASCII characters, the message is discarded. Valid messages
received by rwhod are placed in files named whod.hostname in the directory
/var/rwho. These files contain only the most recent message, in the format described
above.
The rwhod daemon generates status messages about every three minutes.
Files:
The rwhod daemon requires the libsocket.so shared library.
See also:
ruptime, rwho
Syntax:
savercfg [-s server] [-x position] [-y position]
Runs on:
Neutrino
Options:
-s server_name The name of the Photon server:
Description:
The savercfg command displays a dialog for setting screensaver options, a
screensaver password, and power saver options:
Not all hardware configurations support Display Power Management System (DPMS)
power saving modes.
Files:
${HOME}/.ph/saver.cfg
Where your screensaver options are stored.
/usr/photon/config/saver.cfg
Global screensaver options. Options are copied from here if a
${HOME}/.ph/saver.cfg does not exist.
See also:
pwm, pwmopts
Using the Photon microGUI in the Neutrino User’s Guide
Syntax:
scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
[-l limit] [-o ssh_option] [-P port] [-S program]
[[user@]host1:]file1 ... [[user@]host2:]file2
Runs on:
QNX Neutrino
Options:
See scp in the NetBSD documentation.
Description:
The scp utility copies files between hosts on a network. It uses ssh for data transfer,
and uses the same authentication and provides the same security as ssh. For more
information, see scp in the NetBSD documentation.
Contributing author:
NetBSD
See also:
/etc/moduli, sftp, sftp-server, ssh, ssh-add, ssh-agent, ssh-keygen,
ssh-keyscan, ssh-keysign, ˜/.ssh/ssh_config, /etc/ssh/ssh_config,
sshd, /etc/ssh/sshd_config in the NetBSD documentation
Syntax:
script [-a] [file]
Runs on:
Neutrino
Options:
-a Append the output to file or to the typescript file, retaining the prior
contents.
file Name of the file script will use to save the session output. If you don’t
specify a file, output is saved in the file typescript.
Description:
The script utility records everything printed to the terminal during a session. This is
useful, for example, if you want to record an interactive session and then save the
typescript file for later analysis, tech support, etc.
The script ends when the forked shell exits (via Ctrl-D).
Certain interactive utilities (e.g. vi) can create garbage in the typescript file. The
script command works best with utilities that don’t manipulate the screen; the
results are meant to emulate a hardcopy terminal.
Note also that script records all transactions, including linefeeds and backspaces.
See also:
ksh (for the history feature)
Syntax:
sed [[-n] script [file...]
Runs on:
QNX Neutrino, Microsoft Windows
Options:
-e script
--expression=script
Use the command-line script for editing files. If you specify
multiple -e options, the scripts are applied in the order specified
to each line of the input files. If a -f option is specified in
addition to -e, lines are acted upon by scripts first.
-f script_file
--file=script-file
Use the file script_file as the script of editing instructions. If
multiple -f options are specified, the scripts are applied in the
order specified to each line of the input files. If a -e option is
specified in addition to -f, lines are acted upon by scripts first.
-i[suffix]
--in-place[=suffix]
Edit files in place (making a backup if you specify the suffix).
-l N
--line-length=N
(“el”) Specify the desired line-wrap length for the l command.
-n
--quiet
--silent Suppress the default output, which passes each line to standard
output after it’s examined for editing. Only lines explicitly
selected for output are written.
-r
--regexp-extended
Use extended regular expressions in the script.
-s
--separate Consider files as separate rather than as a single continuous long
stream.
-u
--unbuffered Load minimal amounts of data from the input files and flush the
output buffers more often.
--version Display the version number, and then exit.
file The pathname of a text file whose contents are read and edited. If
you specify multiple files, the files are read in the order specified
and the concatenation is edited. If no files are specified, the
standard input is used.
script A script consists of one or more editing instructions that you
enter on the command line.
If you don’t specify any -e, --expression, -f, or --file options, then the first
non-option argument is taken as the sed script to interpret. All remaining arguments
are names of input files; if you don’t specify any input files, then the standard input is
read.
Description:
The sed utility is a stream editor that reads one or more text files, makes editing
changes according to editing commands that you specify, and writes the results to
standard output.
This utility is subject to the GNU Public License (GPL). We’ve included it for use on
development systems.
The sed commands are usually stored in a program file (script_file), although you
may give simple sed commands from the command line. By default, sed copies files
from the file list to its standard output, editing the lines in the process. Conceptually,
there is one input file, which is the concatenation of all input files specified.
Lines are selected for editing based on their position within the input file, or by pattern
matching. If no files are listed, input is taken from standard input (this is the only time
standard input is used). The sed utility initially reads all the editing commands from
all specified sources and places them in an internal table in the order specified. The
utility then processes the (concatenated) input file as follows:
1 Read one line from the input file and copy to the pattern space (a work area).
2 For each command that selects the line, act on the pattern space as the edit
command specifies, cyclically placing the result into the pattern space.
3 After all commands have been checked against the pattern space, write the
pattern space to the standard output, provided -n was not specified. The pattern
space may contain zero, one, or several lines at this time.
5 Repeat from step 1 until all of the (concatenated) input file has been read and
processed.
Scripts
A script consists of editing commands, one per line, of the following form:
[address[,address]]function[arguments]
You can specify the script of editing commands in the command line, or it can be
contained in the file script_file.
In default operation, sed cyclically copies a line of input into a pattern space (unless
there is something left after a D command), applies in sequence all commands whose
addresses select that pattern space, and at the end of the script copies the pattern space
to the standard output (except under -n) and deletes the pattern space.
Some of the commands use a hold space to save all or part of the pattern space for
subsequent retrieval. The pattern and hold spaces are each limited to 20 KB.
Addresses
An address is one of the following:
• a context address
• a regular expression
A command line with no address selects every pattern space. A command line with
one address selects each pattern space that matches the address.
A command line with two addresses selects the inclusive range from the first pattern
space that matches the first address through the next pattern space that matches the
second address. (If the line number of the second address is less than or equal to the
line number first selected, then only the first line is selected.) Starting at the first line
following the selected range, sed looks again for the first address. Thereafter the
process is repeated.
You can use the negation character (!) to apply editing commands to non-selected
pattern spaces. For more information, see “Editing commands,” below.
Regular expressions
The sed utility uses basic regular expressions (REs), with the following additions:
• A period (.) matches any character except the last newline of the pattern space.
Editing commands
In the following list of functions, the maximum number of permissible addresses for
each function is indicated by one of [0addr], [1addr] or [2addr] representing a
maximum of zero addresses, one address or two addresses respectively. The argument
text consists of one or more lines. Each embedded newline in the text must be
preceded by a backslash. Other backslashes in text are treated like the backslashes in
the replacement string of an s editing command; you can use them to protect initial
blanks against the stripping that’s done on every script line.
The r and w editing commands take an optional rfile (or wfile) parameter, separated
from the command letter by zero or more blanks.
The arguments rfile or wfile terminate the command line. Each wfile is created before
processing begins. There can be at most ten distinct wfile arguments in the script.
The b, r, s,t, w, y, !, and : editing commands take additional arguments. The
following synopses indicate which arguments are separated from the commands by
blanks:
[2addr] { command_list
}
Execute command_list only when the pattern space is selected.
(Note that the trailing } must be the first non-blank character in
the line.)
[1addr]a\
text Write text to the standard output after the pattern space is
written.
[2addr]b label Branch to the : (colon) command bearing the label. If label is
empty, branch to the end of the script.
[2addr]c\
text Delete the pattern space. With 0 or 1 address or at the end of a
2-address range, place text on the output.
[2addr]d Delete the pattern space and start the next cycle.
[2addr]D Delete the initial segment of the pattern space through the first
newline and start the next cycle.
[2addr]g Replace the contents of the pattern space by the contents of the
hold space.
[2addr]G Append the contents of the hold space to the pattern space.
[2addr]h Replace the contents of the hold space by the contents of the
pattern space.
[2addr]H Append the contents of the pattern space to the hold space.
[1addr]i\
text Write text to the standard output before the pattern space is
written.
Character Listed as
alert \a
backslash \\
backspace \b
carriage return \r
form-feed \f
newline \n
tab \t
vertical tab \v
[2addr]n Copy the pattern space to the standard output and replace the
pattern space with the next line of input.
[2addr]N Append the next line of input to the pattern space, using an
embedded newline to separate the appended material from the
original material. Note that the current line number changes.
[2addr]P Copy (print) the pattern space, up to the first newline, to the
standard output.
[1addr]q Branch to the end of the script and quit without starting a new
cycle.
[1addr]r rfile Read the contents of the rfile file. The contents are placed on
the output before reading the next input line.
[2addr]t label Test; branch to the : (colon) command bearing the label if any
substitutions have been made since the most recent reading of
an input line or execution of a t. If label is empty, branch to the
end of the script.
[2addr]y/string1/string2/
Replace all occurrences of collating elements in string1 with
the corresponding collating element in string2. The lengths of
string1 and string2 should be equal.
[2addr]! function Apply the function (or command list, if function is {) only to
the lines that aren’t selected by the addresses.
[0addr]:label This command does nothing; it bears a label for the b and t
commands to branch to.
[1addr]= Place the current line number on the standard output as a line
with its own line number.
Examples:
In the file myfile, find and output only those lines containing the string “tom”:
In the file myfile, replace all occurrences of the string beneath with the string
below, and output to the file newfile:
Files:
All files are text files. The script_files named by the -f option consist of editing
commands, one per line. Any number of additional text input files may be specified by
the r command for insertion of unedited data to the standard output at points
predetermined by editing rules. A maximum of 10 additional output files may be
specified through the use of the w command in the script.
Exit status:
0 Successful completion.
Errors:
If one or more of the input files (this doesn’t include script files) can’t be opened for
reading, sed continues to process the remaining files.
Contributing author:
GNU
See also:
gawk, python
Dale Dougherty, sed & awk, O’Reilly and Associates, 1990.
Brian W. Kernighan and Rob Pike, The UNIX Programming Environment,
Prentice-Hall, 1984.
Syntax:
seedres
Runs on:
Neutrino
Options:
None.
Description:
The seedres utility reads the PnP BIOS and assigns resources, such as I/O ports and
IRQs, to procnto’s resource database. You need it if you want drivers to assign
nonconflicting resources.
This utility is for x86 platforms; on other platforms, the startup code seeds the system
resources.
For more information about the resource database, see rsrcdbmr_attach() in the
Neutrino Library Reference.
Examples:
The following lines from a buildfile show how to start seedres and pci-bios on an
x86 platform:
...
seedres
pci-bios
...
See also:
pci-bios, procnto
rsrcdbmr_attach() in the Neutrino Library Reference
Controlling How Neutrino Starts in the Neutrino User’s Guide
Syntax:
sendnto -d device [-b baud] [-l speed] [-eqv] filename
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
-b baud Set the serial port transfer speed to baud.
-d device Send the image over this device. You must specify this option. The form
of the device name depends on the host OS:
• Linux: /dev/ttySX
• Neutrino: /dev/serX
• Windows: comX
-e Request an echo from the target for every data record (off by default).
An echo may be needed for serial downloads at very high baud rates
(>57600 baud) to very slow machines.
-l speed (“el”) Output is to a parallel port with a LAPLINK cable. The speed
may be 1...3, with 1 being the fastest.
Description:
The sendnto utility takes an OS image built with mkifs and sends it to a target
device using a fast binary protocol. The target computer needs a loader built into its
startup code in ROM or FLASH that understands this protocol. The protocol is very
simple and is designed to be implemented with minimal code in the target.
The Board Support Packages generally contain IPL source for serial targets.
The sendnto utility assumes the target has been reset and is in a state where it is
waiting for data. It sends the following sequence of records:
START
DATA DATA ...
GO
Each record has a sequence number and checksum to ensure data integrity. The GO
record transfers control to the downloaded image. The details of this protocol may be
determined by examining the source to sendnto, which is also made available for
porting to other development environments.
Examples:
Send the file image to the target machine through the first serial port on host machine:
Send the file image to the target machine through the second serial port on the node
named server:
Send the file image to the target machine through the parallel port on the host
machine using a regular parallel cable:
Send the file image to the target machine through the parallel port using a LAP-LINK
cable. This cable arrangement may also be used by the wd source-level debugger for
parallel-port debugging:
Exit status:
0 Successful completion.
See also:
mkifs
Name:
/etc/services
Description:
The /etc/services file contains information regarding the known services available
in the DARPA Internet. For each service, a single line should be present with the
following information:
For example:
ftp 21/tcp
21 Port number.
See also:
inetd
getservent() in the Library Reference
Syntax:
setconf variable_name string ...
Runs on:
Neutrino
Options:
variable_name The variable to set; see <pathconf.h>. The most useful
variables are:
• _CS_ARCHITECTURE
• _CS_DOMAIN
• _CS_HOSTNAME
A hostname can consist only of letters, numbers, and hyphens, and must not start or
end with a hyphen. For more information, see RFC 952.
If you change this configuration string, be sure you also change the HOSTNAME
environment variable. The hostname utility always gives the value of the
_CS_HOSTNAME configuration string.
• _CS_HW_PROVIDER
• _CS_HW_SERIAL
• _CS_LIBPATH
• _CS_LOCALE
• _CS_MACHINE
• _CS_PATH
• _CS_RELEASE
• _CS_RESOLVE
• _CS_SRPC_DOMAIN
• _CS_SYSNAME
• _CS_TIMEZONE
• _CS_VERSION
Description:
This utility sets a variable that’s used for configuration information. For more
information, see the documentation for getconf.
See also:
getconf
confstr(), pathconf(), sysconf() in the Library Reference
“Configuration strings” in the Configuring Your Environment chapter of the Neutrino
User’s Guide
Syntax:
setkey [-knrv] filename
setkey [-v] [-c]
setkey [-krv] [-f] filename
setkey [-aklPrv] -D
setkey [-Pvp] -F
setkey [-H] -x
setkey [-?V]
Runs on:
Neutrino
Options:
-a Display dead SAD (Security Association Database) entries. A SAD
entry is dead when it has expired, but it may still be referenced by
SPD (Security Policy Database) entries.
-F Flush the SAD entries. When specified with -P, also flush the SPD
entries.
-f filename A file that contains the operations to perform. For more information,
see the “Operations” section, below.
-P Dump (when specified with -D) or flush (with -F) the SPD entries.
-x Loop forever and dump all the messages transmitted to the PF_KEY
socket.
Description:
The setkey utility adds, updates, dumps, or flushes the Security Association
Database (SAD) entries and the Security Policy Database (SPD) entries in the stack.
Operations
The following operations may be specified from either standard input (using -c) or
from a file (using -f filename).
Lines that start with hash marks (#) are treated as comment lines. Operations have the
following grammar:
dump [protocol] ; Dump all SAD entries matched by this protocol (same
functionality as -D on the command line).
flush [protocol] ; Clear all SAD entries matched by this protocol (same
functionality as -F on the command line).
See the “Algorithms for protocol ” section below for a list of the valid values for
aalgo, ealgo and calgo.
dst,
src Specify the destination or source of the secure communication as an
IPv4/v6 address. The address must be in numeric form since setkey
doesn’t consult hostname-to-address for these arguments.
dst_range,
src_range Selections of the secure communication specified as an IPv4/v6
address or an IPv4/v6 address range. They may accompany TCP/UDP
port specifications. Valid forms are:
address
address/prefixlen
address[port]
address/prefixlen[port]
-P direction discard
-P direction ipsec request ...
-P direction none
See “Setting the policy” in the IPsec protocols page for detailed
descriptions of the above arguments.
spi Security Parameter Index (SPI) for the SAD and the SPD. It’s a
decimal number, or a hexadecimal number prefixed with 0x. SPI
values between the range 0 and 255 are reserved for future use.
continued. . .
Algorithm Comment
deflate RFC 2394
Examples:
add 3ffe:501:4819::1 3ffe:501:481d::1 esp 123457
-E des-cbc "ESP SA!!" ;
flush ;
dump esp ;
Exit status:
0 Success.
See also:
/etc/inetd.conf, sysctl
IPsec protocol in the Neutrino Library Reference
Syntax:
QNX Neutrino and Linux hosts:
setupbsp installation_dir archive
Windows hosts:
ksh $QNX_HOST/usr/bin/setupbsp installation_dir archive
Runs on:
All supported hosts.
Options:
installation_dir Where you’d like to install the BSP. This directory must not
already exist, and its name can’t include spaces.
Description:
The setupbsp script opens an archive of a QNX Neutrino 6.3.2 simplified-style BSP
and installs the BSP. The setupbsp script puts two copies of the BSP on your system,
in these locations:
Decide whether to use the command-line tools or the IDE, and don’t work with the
other copy.
The setupbsp script creates various Makefiles, as well as an uninstall script.
Don’t rename the directory after running setupbsp, or else you won’t be able to build
or uninstall the BSP properly.
After you’ve installed the BSP, you’ll find some or all of the following in
installation_dir (depending on what the BSP includes):
continued. . .
See also:
Working with a BSP chapter of Building Embedded Systems
For information about packaging a BSP, see our Foundry27 community website.
Syntax:
sftp [-1Cv] [-B buffer_size] [-b batchfile] [-F ssh_config]
[-o ssh_option] [-P sftp_server_path] [-R num_requests]
[-S program] [-s subsystem | sftp_server] host
sftp [[user@]host[:dir[/]]]
Runs on:
QNX Neutrino
Options:
See sftp in the NetBSD documentation.
Description:
The sftp utility is an interactive file transfer program, similar to ftp, which performs
all operations over an encrypted ssh transport. For more information, see sftp in the
NetBSD documentation.
Contributing author:
NetBSD
See also:
ftp
/etc/moduli, scp, sftp-server, ssh, ssh-add, ssh-agent, ssh-keygen,
ssh-keyscan, ssh-keysign, ˜/.ssh/ssh_config, /etc/ssh/ssh_config,
sshd, /etc/ssh/sshd_config in the NetBSD documentation
Syntax:
sftp-server [-f log_facility] [-l log_level]
Runs on:
QNX Neutrino
Options:
See sftp-server in the NetBSD documentation.
Description:
The sftp-server is a program that speaks the server side of the SFTP protocol to
stdout and expects client requests from stdin. The sftp-server program isn’t
intended to be called directly, but from sshd using the Subsystem option.
For more information, see sftp-server in the NetBSD documentation.
Contributing author:
NetBSD
See also:
/etc/moduli, scp, sftp, ssh, ssh-add, ssh-agent, ssh-keygen,
ssh-keyscan, ssh-keysign, ˜/.ssh/ssh_config, /etc/ssh/ssh_config,
sshd, /etc/ssh/sshd_config in the NetBSD documentation
Syntax:
sh [+-abCefhikmnprsuvxX] [+-o option]
[ [ -c command-string [command-name]
| -s | file ] [argument ...] ]
Runs on:
QNX Neutrino, Microsoft Windows
Options:
See ksh.
Description:
The sh shell is a public-domain version of the Korn shell. For more information, see
ksh.
See also:
esh, fesh, ksh, rsh, uesh
Using the Command Line and Writing Shell Scripts in the Neutrino User’s Guide
Syntax:
shelf [-c] [-e] [-m] [-r] [-s server]
Runs on:
Neutrino
Options:
-c Start shelf and open the setup dialog. If shelf is already running, this
just opens the setup dialog.
-s server Run shelf on the server at the specified server path or device name.
Description:
The shelf Photon desktop utility provides an easy way to launch applications, view
system information, and switch to currently running applications.
By deafult, the shelf application loads two shelves: one on the right-hand side of the
screen, and one on the bottom. You can modify the default shelf setup by running
shelf -c. For more information on configuring shelf, see the Modifying the shelf
section of the “Using Photon” chapter in the Neutrino User’s Guide.
The shelf’s Launch Menu plugin is configured separately. For more information, see
the Modifying the Launch menu section of the the “Using Photon” chapter in the
Neutrino User’s Guide.
Files:
/etc/photon/shelf/shelf.cfg
The default shelf configuration file
$HOME/.ph/shelf/shelf.cfg
When you change the default configuration, the new settings are saved in this
file, so they apply to your current user ID only.
Environment variables:
PHSHELF_DISABLE
When set to 1, the ph script doesn’t run shelf when starting Photon.
See also:
Photon
Modifying the shelf section of the “Using Photon” chapter in the Neutrino User’s
Guide.
Syntax:
showlicense
Runs on:
QNX Neutrino, Microsoft Windows, Linux
Options:
None.
Description:
The showlicense displays the type (e.g. Commercial, Evaluation) of the active
QNX license. If possible, it also displays a path to the appropriate license text.
See also:
qbinaudit, qconfig, QWinCfg, sysinfo
Syntax:
showmem [options]
Runs on:
QNX Neutrino
Options:
-D[lsh] Show detailed process information:
• l — libraries
• s — stack
• h — heap
Description:
One of the key stages of optimizing and finalizing your system design is determining
when, where, and how the total system memory is being used. The showmem utility
displays memory information to help you do a comprehensive and complete analysis
of a system and answer the question of “Where has the memory gone?”
See also:
pidin, ps
Fine-Tuning Your System in the Neutrino User’s Guide
Syntax:
showmount [-ade] [host]
Runs on:
Neutrino
Options:
-a List all mountpoints in this form: host:dirpath
-d Instead of printing the names of hosts, list the directory paths of mountpoints.
Description:
The showmount utility shows status information about the NFS server on the
specified host. By default, it prints the names of all hosts that have NFS filesystems
mounted on that host.
Caveats:
Because the NFS server is stateless, mount information is approximate. The
showmount utility displays this information as accurately as the nfsd daemon reports
it.
See also:
nfsd
Based on RFC 1094 (Appendix A: “Mount Protocol Definition”)
You must log in as root and be in text mode — not Photon — to run this utility.
Syntax:
show_vesa
Runs on:
Neutrino (x86 only)
Options:
None.
Description:
The show_vesa utility displays information for VESA BIOSes up to VESA 3. This
information includes general information, such as the amount of video RAM, as well
as details about each supported video mode. This information is sent to stdout.
Examples:
Here’s a sample of part of the output of show_vesa:
VESA Info Block
VESA Signature :
VESA
VESA Version :
0300
OEM String Ptr :
0080:0100
OEM String :
3Dfx Interactive, Inc.
Capabilities :
00000001
DAC width switchable to 8 bits per primary color
Controller VGA compatible
Normal RAMDAC operation
No Hardware Stereoscopic Signaling support
Stereo Signaling supported via external VESA stereo connector
Video Mode Ptr : 0080:0117
Total Memory : 1000000 (16777216)
VBE Software Revision : 0100
OEM Vendor Name Ptr : 0080:015B
OEM Vendor Name String : Elpin Systems, Inc.
OEM Product Name Ptr : 0080:016F
OEM Product Name String : 3Dfx Banshee
OEM Product Rev Ptr : 0080:017C
OEM Revision String : Version 1.00
OEM Data : 3Dfx Interactive, Inc.
Syntax:
shutdown [options]
Runs on:
Neutrino
Options:
-b Shut down but don’t reboot. You can’t use this option with -n
nodename.
-q Be quiet.
-v Be verbose.
Description:
The shutdown utility performs an orderly system shutdown as follows:
2 It then waits for a period of time (reduced if you specify the -f option).
The interval between the SIGTERM and SIGKILL signals allows processes that have
elected to catch the SIGTERM signal to perform any cleanup they need to do before the
system is rebooted.
Files:
/var/log/wtmp If this file already exists, shutdown adds an entry to it before
shutting down or rebooting the system.
The shutdown utility doesn’t create /var/log/wtmp if it doesn’t already exist. This
file can quickly become very big, which isn’t good on an embedded system with
limited resources.
See also:
phshutdown, procnto
Logging In, Logging Out, and Shutting Down in the QNX Neutrino User’s Guide
shutdown_system() in the QNX Neutrino Library Reference
Syntax:
size_variant [options] [objfile...]
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
The size_variant depends on the target platform, as follows:
Description:
The size utility lists the section sizes and the total size for each of the object or
archive files objfile in its argument list. By default, one line of output is generated for
each object file or each module in an archive.
For detailed documentation, see the GNU website at http://www.gnu.org/.
Contributing author:
GNU
Syntax:
slay [options]... process_name|process_id ...
Runs on:
Neutrino
Options:
- signal_number A signal number specifying which signal to raise on the
processes matching process_name or process_id. For a list of
signal numbers, see <signal.h>.
-C cpunum (QNX Neutrino Core OS 6.3.2 or later) Set the CPU affinity to
cpunum, where the first CPU is 0. You can use this option
multiple times. For more information, see “Setting the
runmask,” below.
-m name|pid Restrict the match to only the process name or to only the
process ID. By default, slay matches both process IDs and
names. For example:
-n nodename (QNX Neutrino Core OS 6.3.2 or later) Search for the specified
processes on the specified remote node nodename.
-q Query before dealing with the process, even if only one process
is found with a matching name or ID (overrides option -f).
This option is useful for viewing the other process information
that slay presents.
-R runmask (QNX Neutrino Core OS 6.3.2 or later) Set the CPU affinity to
runmask. You can use this option multiple times to specify
masks that are more than 32 bits long. For more information,
see “Setting the runmask,” below.
-S Don’t kill processes that have child processes. You typically use
this option in a shell command that shuts down shells on other
devices. Setting this option prevents slay from killing shells
that have other processes (such as editors) running. If you also
specify -q, slay prompts for a forced kill even if the named
process has child processes.
-s signal_name The signal to send. This option causes the signal sig to be raised
for the processes matching the process_name or ID.
-T tid (QNX Neutrino Core OS 6.3.2 or later) Apply the action to the
thread with the given ID. You can use this option to direct a
signal to a specific thread, or to change a thread’s priority or
runmask.
Description:
Use the slay utility to kill or modify a process by name or by ID. Process names are
specified without the path. For example, let’s say you have a process called
/bin/sleep that you want to kill. Entering sleep as the process name is sufficient
to allow slay to find and kill it.
There are many forms of this command. The simplest and most often used form is:
slay process_name|process_id
This command locates the process bearing the specified name or ID. If only one is
found, a SIGTERM signal is set on it. If more than one process bears the specified
name or ID, you’re prompted for a yes/no response for each process. When each
process is listed in this form, the process name, pid, and tty group/member numbers
are also displayed to help you make a selection.
To set a signal on a process you must either own the process or be logged in as root.
You can use slay to change the runmask, or the runmask and inherit mask, for threads
that are already running; to set the masks for a new process, use the on command.
Both commands interpret the -C and -R options in the same way.
You can use more than one -R option to specify a runmask that’s more than 32 bits
long. The first -R option specifies bits 0 through 31, the second specifies bits 32
through 63, and so on.
If you use both the -C and -R options or multiple instances of them, the resultant mask
is the bitwise ORing of all -C and -R options. For example, slay -R 0x1 is
equivalent to slay -C0, and slay -R 0x1 -C3 is equivalent to slay -C0 -C3.
When you use -R or -C without -T, all threads in the specified process or processes
are affected.
If you use -R or -C, slay always changes the runmask for the specified threads or
processes. If you also specify the -i option, slay also sets the inherit mask to the
same value as the runmask.
• If the resulting runmask specifies at least one CPU that’s physically present, the
runmask is accepted, and any bits that correspond to CPUs that aren’t present are
ignored. If the resulting runmask doesn’t specify any CPU that are physically
present, an error results.
• If you change the runmask for a process, the processor for blocked threads doesn’t
change until the threads become unblocked (or never if the threads remain blocked).
For more information about runmasks, see the Multicore Processing chapter of the
System Architecture guide, and the Developing Multicore Systems chapter of the
Multicore Processing User’s Guide.
Examples:
Kill the spooler process on node peterv:
slay -P 20 my_test
Exit status:
0 No processes matched the supplied criteria, an error occurred, or the
number of processes matched and acted upon was an even multiple of
256.
1-128 The number of processes matched and acted upon modulo 256 (e.g. a
status of 1 could mean 1 process, 257 processes, 513 processes etc.)
129-160 If the exit status was gleaned through direct spawning, this is the number
of processes matched and acted upon modulo 256. If slay was run
through the shell, this is either the number of processes matched and
acted upon, or it indicates why slay died due to a signal (subtract 128
from the exit status to determine the signal number).
161-255 The number of processes matched and acted upon, modulo 256.
Caveats:
The exit status of slay is nonstandard for historical reasons. We strongly recommend
that you not use slay in any situation where the exit status is relied upon because the
status is ambiguous in some circumstances.
See also:
kill, on, pidin, ps
Multicore Processing chapter of the System Architecture guide, the Multicore
Processing User’s Guide
Syntax:
sleep time
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
time For POSIX conformance, this must be a nonnegative decimal integer, from 0
to 4294967295, specifying the number of seconds to suspend execution.
As a QNX Neutrino extension, time can be a floating point number, so you
can specify fractions of seconds.
Description:
The sleep utility suspends execution for at least the number of seconds specified by
the time operand.
Exit status:
0 The execution was successfully suspended for at least time seconds, or a
SIGALRM signal was received.
Caveats:
The sleep utility takes the default action for all signals, except that sleep terminates
normally with a zero exit status on receipt of a SIGALRM signal.
See also:
sh
Syntax:
slinger [-a administrator] [-c] [-d] [-e]
[-i address] [-n] [-p port_number] [-s]
Runs on:
Neutrino
Options:
-a administrator Contact information of the administrator of Slinger (e.g. -a
my_admin@something.com). The information is stored in the
SERVER_ADMIN environment variable. The default is
nobody.
-c Request that HTML files with SSI not be placed in the browser
cache. Instead of using a previously downloaded version from
its local cache, the browser contacts the server whenever it
displays an HTML file containing SSI. Use this option when
you’d like the browser to display the latest version of your
dynamic SSI data.
-d Write debugging info to the system log. In order to capture the
log messages, you need to have syslogd running.
-e Enable the SSI exec command.
-i address The interface for slinger to listen on (e.g. 10.0.0.1). The
default is any.
-n Don’t move to the background.
-p port_number Set the port number.
-s Enable the SSI commands.
Description:
The slinger utility is an HTTP server for resource-constrained environments.
Slinger is compliant with the CGI 1.1 and HTTP 1.1 standards, and provides support
for dynamic HTML via Server Side Includes (SSI).
Running Slinger
To run Slinger, type:
slinger &
The slinger server listens on the TCP port 80. Since this is under 1024, slinger
needs to be run as root. As soon as it has attached to the HTTP port, it drops itself
down to user -2 (setuid (-2)).
For Slinger to process SSI tokens, the HTML file must have .shtml as its file
extension.
where:
SSI commands
The valid SSI commands are: break, config, echo, exec, if, goto, include,
label, and qnxvar.
break
Terminate transmission of an HTML document at any point. The break command has
no arguments, so the syntax is:
<!--#break -->
config
Set certain HTML output options. The syntax is:
<!--#config variable_set="value" -->
echo
Insert data from an HTML form field or an environment variable onto an HTML page.
The echo command has one argument, var. The syntax is:
<!--#echo var="string" -->
where string is the value of an HTML form field or an environment variable. For
example:
<!--#echo var="Last name" -->
Or
<!--#echo var="DATE_LOCAL" -->
The echo command uses these SSI variables, as well as CGI environment variables
(for more information, see the Environment variables section in this utility):
DOCUMENT_NAME
Complete local pathname of the current web page.
DOCUMENT_URI
Local pathname of the current web page referenced to the base
directory of the web space.
LAST_MODIFIED
Date and time of the last modification of the current web page.
QUERY_STRING_UNESCAPED
Unescaped query string sent by the remote client. All characters
that are special to the shell are escaped with \.
exec
Spawn an external program and print the output at the location of the exec token on
the HTML page. The external program is spawned to increase performance. The exec
command takes the following arguments:
where:
For example, suppose you have a CGI script, othello.cgi, and the
HTTPD_SCRIPTALIAS environment variable contains the directory
/web/games/. If you put the following token on your HTML page, Slinger
searches for the othello.cgi script in the /web/games/ directory:
<!--#exec cgi="othello.cgi" -->
• cmd — Spawn a shell and run a shell executable command. The syntax is:
<!--#exec cmd="[path/ ]executable [args]" -->
where:
The cmd token uses the CMD_INT environment variable to identify the command
interpreter, shell_program, and then spawns a shell using the following:
shell_program -c "string"
For example:
<!--#config cmdecho="ON" -->
<!--#exec cmd="cd /home/smr; ls" -->
if
Conditionally execute SSI operations and conditionally print the HTML text. The
syntax of the if command is:
where:
operation Action to take if the logical comparison evaluates to TRUE, where the
possible actions are: break, error, errorbreak, goto, print, and
printbreak.
The hasstring operator returns TRUE if the character string in op2 is found in the
op1 string.
If both operands are numbers, they’re compared as numbers; otherwise, the
comparison is based on the alphabetic order of the operands.
If the logical comparison evaluates to FALSE, nothing happens. For example:
The NULL operand is defined by "". NULL may be used to check for the existence of
data in a form field.
For example, if you have a form with the field Last name and you want to ensure the
user doesn’t leave it blank, then the token is:
If the field isn’t empty, nothing happens. But if the field is empty, the message is
displayed and the HTML document terminates.
goto
Jump to a labeled token (without printing skipped text or applying skipped tokens).
The syntax of the goto command is:
Here’s an example of how the goto and label commands are used together:
include
Insert the contents of a file into an HTML page. The include command takes these
arguments:
where pathname is the path and filename of an HTML file relative to the directory
of the current web page. Don’t use absolute paths, and don’t use ../ in the
pathname (since you can’t include a pathname that begins above the current
directory).
Use the file tag when you include files that are in the same directory as the
current directory. For example, suppose you have a directory
web/support/docs/ containing two files my_doc.html and docs.html, and
the URL is www.something.com/support/docs/docs.html. To insert the
my_doc.html file into the HTML page, write the token as:
<!--#include file="my_doc.html" -->
where pathname is the path and filename relative to the root directory on the
Slinger server, configured in the HTTPD_ROOT_DIR environment variable.
When you use the virtual tag, Slinger begins its search for the file from the root
directory. For example, suppose you have a directory web/support/docs/ that
contains the file my_doc.html, and the HTTPD_ROOT_DIR environment
variable contains the web directory. To insert my_doc.html into the HTML page
with the URL web/support/docs/my_doc.html, write the token as:
<!--#include virtual="/support/docs/my_doc.html" -->
The include command is recursive; each file inserted may contain include tokens.
Although the inserted file can’t be a CGI script, it can contain a reference to a CGI
script.
label
When Slinger encounters a goto command, jump to the label token on the HTML
page. The syntax of the label command is:
For example:
qnxvar
Get data or change data on the data server process. The qnxvar command takes the
following arguments:
• format — Set the format for subsequent displays of data obtained from the data
server process, on the HTML page. The syntax is:
<!--#qnxvar format="[text] %s [text] " -->
where:
The format remains in effect until the next format statement. For example:
<!--#qnxvar format="I work for %s." -->
If you want to print the % sign followed by a variable, you have to enter: \% %s. To
print %s, type \%s.
• read — Get the value of a variable on the data server process and display the result
at the location of the qnxvar token on the HTML page. The syntax is:
<!--#qnxvar read="var_name len [var_name len]" -->
• write — Change a variable on the data server process. The syntax is:
<!--#qnxvar write="var_name "data"" -->
The maximum length of var_name is 60 characters. Don’t omit the space after the
var_name.
config commands
cmdecho [ON | OFF]
Set the output option of subsequent exec tokens. The default is
OFF, meaning the output isn’t parsed or printed. The cmdecho
command doesn’t apply to the output of CGI scripts.
cmdprefix Set a prefix to each line output from subsequent exec tokens. The
syntax is:
cmdpostfix Set the string appended to the end of each line output from exec
tokens. The syntax is:
onerr Set the action to be taken when Slinger encounters an error. The
syntax is:
For example:
<!--#config onerr="goto oven_temp" -->
timefmt Set the format of the date and time. The syntax is:
• Slinger
• Write an I/O manager to provide changing HTML each time the prefix is
opened/read.
• Use Server Side Includes with the data server. The rest of this section describes this
method.
External Data
Slinger
app server
SSI token
Remote
client
HTML page
2 Use the qnxvar tokens to query and manipulate the global data.
3 Write an application to manipulate the global state using the data server library
functions. See the examples in the ds utility.
hostname Name of the host or the IP address of the host running Slinger.
scriptfile Name of the CGI script to be executed. Slinger uses the environment
variable HTTPD_SCRIPTALIAS to locate the pathname of the CGI
script file.
When Slinger executes a CGI script, it parses the output of the script for HTTP header
directives. Slinger must buffer the header directives, before transmitting the script
data, in case a header directive is passed that’ll affect the format of the default header
directives. Up to 1K of header information can be buffered. CGI scripts must provide
a valid header.
Slinger identifies the end of the header as a blank line, lines are terminated with a
<LF> or a <CR><LF>. A common HTTP header directive to provide specifies the
type of data that the CGI script provides. The default Content-Type is “text/html.” For
example:
Content-Type: text/html<LF>
<LF>
CGI script data...
A script with the filename prefix nph- (e.g. nph-myscript.cgi) won’t be parsed by
Slinger; only the raw data from the script is sent. Because Slinger doesn’t add any
HTTP header content, any script that isn’t parsed must provide the entire HTTP header
in its script output.
Security precautions
When you choose the directory for your data files:
• Place the CGI scripts in a directory isolated from your normal system binaries.
Don’t use /bin or /usr/bin as your CGI directory.
• Avoid setting your CGI script file permissions to “set user ID when executing”
when the file is owned by a privileged user (e.g. root).
• Keep your CGI scripts and documents in separate directories. This prevents people
from accessing your scripts.
• No files are owned by userid (-2) because Slinger runs as userid (-2) and you
don’t want Slinger to own the files.
These precautions prevent somebody from giving your machine a new password file or
tampering with your web pages.
Examples:
The right way
We recommend that you put your documents and scripts in separate directories. In this
example, the documents are in the /usr/webdoc directory, the root document is
foo.html, and the CGI scripts are in /usr/web/cgi:
export HTTPD_ROOT_DIR=/usr/webdoc
export HTTPD_ROOT_DOC=foo.html
export HTTPD_SCRIPTALIAS=/usr/web/cgi
slinger &
Files:
The slinger webserver requires a TCP/IP stack (included in io-pkt*) and the
libsocket.so shared libraries.
Environment variables:
Slinger configuration
Slinger uses the following environment variables to set its configuration:
HTTPD_ROOT_DOC
The name of the root document (e.g. index.html). When a web
client requests the root document, HTTPD_ROOT_DOC is
appended to HTTPD_ROOT_DIR to build the full pathname of the
root document. The default is index.html.
For example, let’s say HTTPD_ROOT_DOC is defined as
index.html and HTTPD_ROOT_DIR is defined as /usr/www.
Slinger appends index.html to /usr/www to build
/usr/www/index.html.
HTTPD_SCRIPTALIAS
The directory where Slinger looks for the CGI executables.
Note that if you define HTTPD_SCRIPTALIAS, anybody can run
scripts or processes that reside in this directory on your machine. Not
defining HTTPD_SCRIPTALIAS turns CGI off, causing all CGI
requests to fail.
For example, suppose HTTPD_SCRIPTALIAS contains
/cgi/bin as the name of the directory. If Slinger gets a request for
the resource www.qnx.com/cgi-bin/get_data.cgi/foo, the
get_data.cgi script found in /cgi/bin is executed, and foo is
sent as pathname information to get_data.cgi. The foo directory
is stored in the PATH_INFO environment variable (described
below).
CAUTION: To help keep your system secure, don’t use /bin or /usr/bin as your
! CGI directory.
ACCEPT_LANGUAGE
The languages that can be read by the remote client.
CONTENT_LENGTH
Length of attached information in the case of a POST.
DOCUMENT_ROOT
Location of data files. (Same as HTTP_ROOT_DIR.)
FORWARDED Name of the proxy server through which the web page is being
processed.
GATEWAY_INTERFACE
Name and version of the Common Gateway Interface served
on Slinger.
HTTP_ACCEPT MIME types that the client accepts, as given by HTTP headers.
HTTP_USER_AGENT
The browser that the client is using to send requests.
PATH_TRANSLATED
Append the pathname in PATH_INFO to the pathname in
HTTPD_ROOT_DIR.
REFERER URL of the HTML page that referred the remote client to this
web page.
SERVER_PROTOCOL
Name and version of HTTP served on Slinger.
SERVER_SOFTWARE
Name of Slinger software.
TZ Time zone.
Caveats:
The slinger webserver communicates over TCP sockets, so you need to have socket
runtime support. This means you need to have a TCP/IP stack running.
When configuring slinger, take care not to expose your machine to undue risk:
• The directory containing the documents shouldn’t have any sensitive files in it.
These precautions prevent somebody from giving your machine a new password file,
or tampering with your web pages.
If you configure slinger to support CGI, keep the following in mind:
• The CGI scripts should all be in a directory isolated from your normal system
binaries. In other words, don’t use the /bin or /usr/bin directories for your CGI
directory!
Besides these precautions, you should also keep your documents and scripts in
separate areas. This prevents people from either reading or modifying your scripts.
See also:
ds, io-pkt*
Setting Up an Embedded Web Server in the Neutrino User’s Guide
Based on RFC 2068
Syntax:
slogger [-c] [-f severity] [-l logfile[,size]]
[-s size] [-v[v]...]
Runs on:
Neutrino
Options:
-c Open the log file with O_SYNC to forcibly commit the logged
events to the disk.
-f severity Log only events to the logfile with this severity or higher. This
option is useful only with the -l option; slogger always saves
all events in its internal buffers. The lowest severity is 7 and the
highest is 0. The default is 7.
-l logfile[,size] Write a copy to logfile of each event that has a severity that’s
numerically less than or equal to that specified by the -f option.
If you specify the optional size after the filename, slogger
alternates between two files, logfile0 and logfile1, as the files
reach the given size.
Description:
The system logger, slogger, is the central manager for logging applications’ system
messages. It maintains these messages in a circular buffer, allowing them to be read
later or in real time. When the buffer fills, new messages replace the oldest ones in the
buffer. If you use the -l and -f options, slogger also writes the messages to a log
file, as described below.
Each system message is assigned a unique major code, minor code and a severity. The
severity levels are as follows:
If you specify the -l logfile option, slogger creates a separate thread that saves to
the specified file each system message that’s of the severity given in the -f option.
If you use the optional size argument to the -l option, slogger alternates between
two files, logfile0 and logfile1. When one file reaches the size given, slogger closes
it and opens the other file. This file is truncated to zero length and new messages are
written to it until it fills up. The process of alternating then repeats. This way you
always have one file containing the latest messages and another file containing the
most recent history.
Applications that can’t assume that they have a standard console output that’s
viewable should use slogger for logging notices, warnings and errors. This includes
all drivers and resource managers.
The slogger manager creates these devices in the pathname space:
/dev/console Implements a simple console tty that saves what you write to it in
the system log. Reads always return end-of-file.
Applications wishing to post a new system log message should use the library routines
slogb(), slogf(), slogi(), and vslogf(), which properly format the data and issue a write
to /dev/slog.
To view the log, use sloginfo. Applications wishing to read system log messages
may open /dev/slog for reading and issue read() calls. Each read may return one or
more messages, but messages are never split across a read.
More than one application may open /dev/slog for reading at a time. Each sees its
own copy of the data and doesn’t affect the others. This allows multiple filters, each
looking for certain log messages, to be run in parallel. Here’s a simple filter that prints
codes and severities:
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <time.h>
#include <errno.h>
#include <sys/slog.h>
fd = open("/dev/slog",
wait ? O_RDONLY : O_RDONLY|O_NONBLOCK);
for(;;) {
int cnt;
exit(EXIT_FAILURE);
}
major = _SLOG_GETMAJOR(evp[1]);
minor = _SLOG_GETMINOR(evp[1]);
cnt = _SLOG_GETCOUNT(evp[0]) +
_SLOG_HDRINTS;
severity = _SLOG_GETSEVERITY(evp[0]);
txt = _SLOG_GETTEXT(evp[0]);
sec = evp[2];
strftime(timebuf, sizeof(timebuf),
"%h %d %T", localtime(&sec));
printf("%s %d %5d %2d ", timebuf,
severity, major, minor);
if(txt)
printf("%s",
(char *) &evp[_SLOG_HDRINTS]);
}
exit(EXIT_SUCCESS);
}
You can clear the system log buffer by calling unlink("/dev/slog") from a
program, or rm /dev/slog from the shell.
The slogger manager replaces the older Unix system logger daemon, syslogd. The
Unix library routines for syslogd output their messages to /dev/console, which is
caught and logged by slogger.
You should start slogger as soon as possible after the system boots (see the
Controlling How Neutrino Starts chapter of the Neutrino User’s Guide). Otherwise,
messages from managers or drivers that were started before it may be lost. If slogger
is killed (or never started), all messages that programs send to slogger are lost. If
slogger is started or restarted, new messages go to the new slogger.
Examples:
Log system messages:
slogger
slogger -s 100k
In addition to keeping an in-memory buffer, save in a file those system log messages
of severity 0, 1, or 2:
slogger -l /var/logs/slogs -f 2
In addition to keeping an in-memory buffer, save all system log messages in a file.
Since a size option is specified, the log file alternates between slogs0 and slogs1,
switching as each file reaches a size of 100 KB:
slogger -l /var/logs/slogs,100k
See also:
sloginfo
slogb(), slogf(), slogi(), vslogf() in the Library Reference
Controlling How Neutrino Starts in the Neutrino User’s Guide
Syntax:
sloginfo [options] [filename]
Runs on:
Neutrino
Options:
-c Clear the log buffer after displaying all waiting events.
-m code Display events with this major code (default: display all).
-s 0..7 Display events with this severity or lower (default: 7). The lowest
severity is 7 and the highest is 0.
filename The name of the file containing raw events (default: /dev/slog).
Description:
The sloginfo utility prints the contents of the system log buffer managed by
slogger, which must be running to record these messages.
By default, sloginfo prints all messages and exits. You can use the -w option to
have it wait for more messages.
You can use the -m and -s options to filter the messages to print. There are 16 million
major codes, with 4096 minor codes for each major code. Selecting a major code
displays messages with any of the minor codes for the specified major code. You can
use the major codes to display messages for a specific area, such as TCP/IP. The major
codes are defined in the file /usr/include/sys/slogcodes.h.
If a filename is specified, sloginfo takes its input from that file instead of
/dev/slog. It’s assumed that the file contains raw system log data saved by a
program or is the file specified in the -l option to slogger.
Examples:
Print out all system log messages and exit:
sloginfo
Print out all system log messages and wait for more to arrive, printing them as they do:
sloginfo -w
Print out all system log messages, clear the log, and exit:
sloginfo -c
sloginfo -s 4
sloginfo /var/logs/slog0
Files:
/dev/slog The default system log file.
See also:
slogger
slogb(), slogf(), slogi(), vslogf() in the Library Reference
Syntax:
smic [options...] includefile
Runs on:
Neutrino
Options:
-0 Set message (and error) file to output file.
-1 Print copyright.
-2 Print version.
-C Check size/range.
-D Dump all.
-Q Dump Sequences.
includefile Name of the file that contains the order of modules to be compiled.
Description:
You can use the smic Management Information Base (MIB) compiler to check the
syntax of SNMP MIB modules, using varying levels of strictness. Using the options,
you can specify the output from the smic utility:
• Items in IMPORTs.
• Textual conventions.
• Extensive MIB syntax checking and continuation of syntax checking after syntax
errors.
To use smic, you first need to obtain the MIBs that you wish to compile (ASN.1
modules). A common place to find MIBs are in RFCs. If the text file that contains the
MIB has any text before or after the MIB module, that extra data must be stripped
from the file (see mstrip). You can sort these MIB modules into different directories.
The SMICINCL environment variable can then be used to define what directories the
MIB module files exist in. The current directory is searched first. For example:
smic includefile
Print out information regarding the type of objects and files that smic has processed:
-A, -D, -I, -K, -M, -N, -O, -P, -Q, -S, -T, -V
Control how strictly the smic utility syntax checks the MIB modules:
-3, -4, -5, -6, -7, -B, -C, -E, -G, -J, -R, -W
Suppress the use of strings from the description and reference clauses in the MIB text
files. Since these elements take up a significant amount of memory when they are
being compiled, this option can be useful if you have a limited amount of memory:
-X
Print the output generated by smic to a file instead of stdout, the default:
-F
Include File
The include file can consist of the following directives. Please see the example for
layout. These directives can also be placed in the MIB files, but they can only be
placed between the MIB modules.
#include filename Include the filename in the compile. The filename must be in
quotes, and can contain several MIB modules.
#aliasModule [module] [alias]
The alias directives are used to define alternative names for the
items in the IMPORT statements. This includes the object and
textual convention names and the FROM module name. You
can define more than one alias for each module. For example, if
you are using a MIB module file named RFC1271 and then it
was updated to RFC9999, you can use the aliasModule
directive to avoid having to change all of your other MIB files:
#pushOpt The pushOpt directive allows you to save the current set of
compile options in you wish to change the options later on for
specific MIB modules.
#popOpt The popOpt directive is used to restore the last set of saved
options.
#addOpt options The addOpt directive is used to add compile options (in
quotes) to the current set of options being used to compile a
module. For example:
#removeOpt options
The removeOpt directive is used to remove compile options
(in quotes from the current set of options being used to compile
a module.
#printOpt You can use this directive to print out the current set of options.
Examples:
Let’s say you have six files that contain MIB modules. The first thing you would do is
specify the directories they exist in using the SMICINCL environment variable. You
can then create a MIB Include File:
#include "rfc1155.smi"
#include "rfc1212.smi"
#include "rfc1215.smi"
#include "rfc1213.mib"
#include "rfc1215.trp"
#pushOpt
#addOpt "c r w b 7"
#include "new.mib"
#popOpt
By using the option directives, more strict syntax checking was done on the new MIB
modules. You can then run smic, specifying any compile options and any
output-generation options.
See also:
mstrip, snmpbulkwalk, snmpd, snmpget, snmpnetstat, snmpset,
snmpstatus, snmptest, snmptranslate, snmptrap, snmptrapd, snmpwalk
Syntax:
snapshot [-S i|n] [-s server] [-x position[%][r]]
[-y position[%][r]]
Runs on:
Neutrino
Options:
-Si|n The initial state of the main window (iconified or normal).
Description:
The snapshot utility captures portions of the Photon workspace. The main window
looks like this:
The controls across the top of the window let you choose the source of the snapshot,
which is one of:
• ${HOME}/snap.bmp
• ${HOME}/snap.jpg
If you want a snapshot of a menu or other popup item, set the snapshot options as you
wish, and then:
2 Click on the Take Snapshot button and select the appropriate window or area.
3 Before the timer counts down, display the menu or popup item.
Examples:
Run using Photon server on node my_node:
snapshot -s/net/my_node/dev/photon
Environment variables:
PWM_PRINTSCRN_APP
The application to start when the Print Scrn key is pressed. By default,
snapshot is started.
See also:
pv
Syntax:
snmpbulkwalk [-d] [-p port] -v 1 host community
[variable_name]
Runs on:
Neutrino
Options:
-d Dump input and output packets.
community The community name for the transaction with the remote system.
variable_name The portion of the object identifier space that’s searched using
BULK requests. The snmpbulkwalk utility queries all variables
in the subtree below the given variable and displays their values.
Specify variable_name in the format specified in the file
mib.txt.
If you don’t specify variable_name, snmpbulkwalk searches the
entire Internet MIB for host.
Description:
The snmpbulkwalk utility uses BULK requests to query for a tree of information
about a network entity (snmpwalk uses GET NEXT requests).
If you’re using SNMP version 2, the following files must be configured:
• /etc/acl.conf
• /etc/context.conf
• /etc/party.conf
• /etc/snmpd.conf (required only if you change the default location of your
config files)
For a description on how to configure the files please see the file page for each of the
configuration files listed above. If you wish to change the location of your
configuration files, you must include a snmpd.conf file.
Examples:
Retrieve the variables in the system subtree:
Using SNMPv1
snmpbulkwalk -v 1 netdev-kbox.cc.cmu.edu public system
Using SNMPv2
snmpbulkwalk netdev-kbox.cc.cmu.edu manager_party agent_party agent_context system
Environment variables:
MIBFILE Specify the location of the mib.txt file. For example,
MIBFILE=path/mib.txt (the default path is /etc).
SUFFIX If SUFFIX exists in your environment, all object IDs with a symbolic
name are printed with only the last element. Examples:
This ID:
system.syscontact.0
is printed as:
syscontact.0
This ID:
udp.udpTable.udpEntry.udpLocalAddress.0.0.0.161
is printed as:
udpLocalAddress.0.0.0.161
Errors:
If the network entity has an error processing the request packet, an error packet is
returned and snmpbulkwalk displays a message to help pinpoint how the request was
malformed.
If snmpbulkwalk tries to search beyond the end of the MIB, it displays this message:
End of MIB
See also:
snmpd, snmpget, snmpgetnext, snmpnetstat, snmpset, snmpstatus,
snmptest, snmptranslate, snmptrap, snmptrapd
/etc/acl.conf, /etc/context.conf, /etc/mib.txt, /etc/party.conf,
/etc/snmpd.conf, /etc/view.conf files
Based on RFC 1065, RFC 1066, RFC 1067,
RFC 1441, RFC 1445, RFC 1446,
RFC 1448, RFC 1449
Marshall T. Rose, The Simple Book: An Introduction to Internet Management, Revised
2nd ed. (Prentice-Hall, 1996, ISBN 0-13-451659-1)
Syntax:
snmpd [-a] [-d] [-i]
Runs on:
Neutrino
Options:
-a Log the IP address of every host that sends a message to the agent.
Description:
The snmpd daemon is a server that supports both the Simple Network Management
Protocol v2 and v1. It receives and responds to SNMP messages sent to the SNMP
port on the local machine.
If you’re using SNMP version 2, the following files must be configured:
• /etc/acl.conf
• /etc/context.conf
• /etc/party.conf
• /etc/view.conf
Opening port(s):
Environment variables:
MIBFILE The location of the mib.txt file. For example,
MIBFILE=path/mib.txt (the default path is /etc).
SNMPCONFIGFILE
The location of the snmpd.conf file.
See also:
/etc/acl.conf, /etc/context.conf, /etc/mib.txt, /etc/party.conf,
/etc/snmpd.conf, snmpget, snmpgetnext, snmpnetstat, snmpset,
snmpstatus, snmptest, snmptranslate, snmptrap, snmptrapd, snmpwalk,
/etc/view.conf
Based on ISO 8824 (ASN.1), RFC 1065, RFC 1066, RFC 1067,
RFC 1441, RFC 1445, RFC 1446, RFC 1448, RFC 1449
Marshall T. Rose, The Simple Book: An Introduction to Internet Management, Revised
2nd ed. (Prentice-Hall, 1996, ISBN 0-13-451659-1)
Name:
/etc/snmpd.conf
Description:
The snmpd.conf file provides some configuration information for the snmpd agent.
The agent searches for the location of the file, in this order:
3 /etc/snmpd.conf
## /etc/snmpd.conf:
See also:
snmpget, snmpgetnext, snmptest, snmptrapd, snmpwalk
/etc/acl.conf, /etc/context.conf, /etc/mib.txt, /etc/party.conf,
/etc/view.conf files
Syntax:
snmpget [-d] [-p port] [-r retry] [-t timeout]
-v 1 host community variable_name
[variable_name]
Runs on:
Neutrino
Options:
-d Dump input and output packets.
community The community name for the transaction with the remote system.
variable_name The variable name in the format specified in the file mib.txt.
Description:
The snmpget utility uses the GET request to query for information about a network
entity. You can specify one or more fully qualified object identifiers in the format
specified in the file mib.txt.
If you’re using SNMP version 2, the following files must be configured:
• /etc/acl.conf
• /etc/context.conf
• /etc/party.conf
• /etc/snmpd.conf (required only if you change the default location of your
config files)
For a description on how to configure the files please see the file page for each of the
configuration files listed above. If you wish to change the location of your
configuration files, you must include a snmpd.conf file.
Examples:
Retrieve the variables sysDescr.0 and sysUpTime.0:
Using SNMPv1
snmpget -v 1 netdev-kbox.cc.cmu.edu public \
system.sysDescr.0 system.sysUpTime.0
Using SNMPv2
snmpget \ netdev-kbox.cc.cmu.edu manager_party \
agent_party agent_context system.sysDescr.0 \
system.sysUpTime.0
Name: system.sysUpTime.0
Timeticks: (2270351) 6:18:23
Environment variables:
MIBFILE Specify the location of the mib.txt file. For example,
MIBFILE=path/mib.txt (the default path is /etc).
SUFFIX If SUFFIX exists in your environment, all object IDs with a symbolic
name are printed with only the last element. Examples:
This ID:
system.syscontact.0
is printed as:
syscontact.0
This ID:
udp.udpTable.udpEntry.udpLocalAddress.0.0.0.161
is printed as:
udpLocalAddress.0.0.0.161
Errors:
If the network entity has an error processing the request packet, an error packet is
returned and snmpget displays a message to help pinpoint how the request was
malformed. If you’ve specified other variables, snmpget resends the request without
the variable that caused the problem.
See also:
snmpd, snmpgetnext, snmpnetstat, snmpset, snmpstatus, snmptest,
snmptranslate, snmptrap, snmptrapd, snmpwalk
/etc/acl.conf, /etc/context.conf, /etc/mib.txt, /etc/party.conf,
/etc/snmpd.conf, /etc/view.conf files
Based on ISO 8824 (ASN.1), RFC 1065, RFC 1066, RFC 1067
RFC 1441, RFC 1445, RFC 1446
RFC 1448, RFC 1449
Marshall T. Rose, The Simple Book: An Introduction to Internet Management, Revised
2nd ed. (Prentice-Hall, 1996, ISBN 0-13-451659-1)
Syntax:
snmpgetnext [-d] host community variable_name
Runs on:
Neutrino
Options:
-d Dump input and output packets.
community The community name for the transaction with the remote system.
variable_name The variable name in the format specified in the file mib.txt.
Description:
The snmpgetnext utility uses the GET NEXT request to query for information on a
network entity. You can specify one or more fully qualified object identifiers in the
format specified in the file mib.txt. For each one, the utility returns the variable in
the network entity’s MIB that is next in alphanumeric order.
Examples:
Retrieve the variables sysDescr.0 and sysUpTime.0:
system.sysName.0 = "computer"
system.sysLocation.0 = "Outer Regions"
Errors:
If the network entity has an error processing the request packet, snmpgetnext
displays an error message helping to pinpoint how the request was malformed.
Caveats:
This utility has been deprecated; it works only with SNMP version 1.
See also:
snmpd, snmpget, snmpnetstat, snmpstatus, snmptest, snmptrap,
snmptrapd, snmpwalk
/etc/mib.txt file
Based on RFC 1065, RFC 1066, RFC 1067
Marshall T. Rose, The Simple Book: An Introduction to Internet Management, Revised
2nd ed. (Prentice-Hall, 1996, ISBN 0-13-451659-1)
Syntax:
snmpnetstat [-d] [-p port] -v 1 host community
[-ainrs] [-P protocol] [-I interface]
[interval]
Runs on:
Neutrino
Options:
-a Show statistics for all sockets (default is for active sockets only).
These statistics consist of the local and remote addresses, protocol,
and internal state of the protocol.
community The community name for the transaction with the remote system.
Description:
The snmpnetstat utility displays network-related statistics retrieved from a remote
system using the SNMP protocol.
If you’re using SNMP version 2, the following files must be configured:
• /etc/acl.conf
• /etc/context.conf
• /etc/party.conf
For a description on how to configure the files please see the file page for each of the
configuration files listed above. If you wish to change the location of your
configuration files, you must include a snmpd.conf file.
Addresses
The snmpnetstat utility tries to match the host, network, and port with entries in the
TCP/IP configuration files. If one of these matches, snmpnetstat displays the
corresponding symbolic names. If none of these match or if you specify -n,
snmpnetstat displays the addresses numerically.
Interface displays
The interface display shows a table of cumulative statistics on packets transferred,
errors, and collisions. It also displays the network addresses of the interface and the
maximum transmission unit (MTU). If you specify an interval, snmpnetstat shows
a continuous display. The first line of the continuous display is a summary of statistics
accumulated since the system was last booted; subsequent lines show values
accumulated over the preceding interval.
continued. . .
Environment variables:
MIBFILE Specify the location of the mib.txt file. For example,
MIBFILE=path/mib.txt (the default path is /etc).
See also:
netstat, snmpd, snmpget, snmpgetnext, snmpstatus, snmptest,
snmptranslate, snmptrap, snmptrapd, snmpwalk
/etc/acl.conf, /etc/context.conf, /etc/hosts, /etc/mib.txt,
/etc/networks, /etc/party.conf, /etc/protocols, /etc/services,
/etc/snmpd.conf, /etc/view.conf files
Based on ISO 8824 (ASN.1), RFC 1065, RFC 1066, RFC1067
RFC 1441, RFC 1445, RFC1446
RFC 1448, RFC 1449
Marshall T. Rose, The Simple Book: An Introduction to Internet Management, Revised
2nd ed. (Prentice-Hall, 1996, ISBN 0-13-451659-1)
Syntax:
snmpset [-d] [-p port] [-r retry] [-t timeout] -v 1
host community variable_name type value
[variable_name type value]
Runs on:
Neutrino
Options:
-d Dump input and output packets.
community The community name for the transaction with the remote system.
context The collection of object resources that can be set by the dstparty.
a IPADDRESS
d DECIMAL STRING
i INTEGER
n NULLOBJ
o OBJID
s STRING
t TIMETICKS
x HEX STRING
variable_name The variable name in the format specified in the file mib.txt.
Description:
The snmpset utility uses the SET request to set information about a network entity.
You can specify one or more fully qualified object identifiers in the format specified in
the file mib.txt.
If you’re using SNMP version 2, the following files must be configured:
• /etc/acl.conf
• /etc/context.conf
• /etc/party.conf
For a description on how to configure the files please see the file page for each of the
configuration files listed above. If you wish to change the location of your
configuration files, you must include a snmpd.conf file.
Examples:
Set the variable sysContact.0 to “John Doe”:
Using SNMPv1
snmpset -v 1 netdev-kbox.cc.cmu.edu public system.sysContact.0 s "John Doe"
Using SNMPv2
snmpset netdev-kbox.cc.cmu.edu manager_party agent_party agent_context
system.sysContact.0 s "John Doe"
Environment variables:
MIBFILE Specify the location of the mib.txt file. For example,
MIBFILE=path/mib.txt (the default path is /etc).
SUFFIX If SUFFIX exists in your environment, all object IDs with a symbolic
name are printed with only the last element. Examples:
This ID:
system.syscontact.0
is printed as:
syscontact.0
This ID:
udp.udpTable.udpEntry.udpLocalAddress.0.0.0.161
is printed as:
udpLocalAddress.0.0.0.161
Errors:
If the network entity has an error processing the request packet, an error packet is
returned and snmpset displays a message to help pinpoint how the request was
malformed.
See also:
snmpd, snmpget, snmpgetnext, snmpnetstat, snmpstatus, snmptest,
snmptranslate, snmptrap, snmptrapd, snmpwalk
Based on ISO 8824 (ASN.1), RFC 1065, RFC 1066, RFC 1067,
RFC 1441, RFC 1445, RFC 1446
RFC 1448, RFC 1449
Marshall T. Rose, The Simple Book: An Introduction to Internet Management, Revised
2nd ed. (Prentice-Hall, 1996, ISBN 0-13-451659-1)
Syntax:
snmpstatus [-d] host [community]
Runs on:
Neutrino
Options:
-d Dump input and output packets.
community The community name for the transaction with the remote system
(default is public).
Description:
The snmpstatus utility retrieves these statistics from a network entity:
Statistic Variable
IP address of the entity -
Textual description of the entity sysDescr.0
Uptime of the entity sysUpTime.0
Sum of received packets on all ifInU - CastPkts.* + ifInNUCastPkts.*
interfaces
Sum of transmitted packets on all ifOutU - CastPkts.* +
interfaces ifOutNUCastPkts.*
Number of IP input packets ipInReceives.0
Number of IP output packets ipOutRequests.0
The snmpstatus utility also checks the operational status of all interfaces
(ifOperStatus.*), and if it finds any interfaces that aren’t running, it displays a report
similar to:
2 interfaces are down!
Examples:
This command:
Errors:
If the network entity has an error processing the request packet, an error packet is
returned and snmpstatus displays a message to help pinpoint how the request was
malformed. If you’ve specified other variables, snmpstatus resends the request
without the variable that caused the problem.
Caveats:
This utility has been deprecated; it works only with SNMP version 1. If you need
similar functionality with SNMPv2, you should do the snmpget commands
separately.
See also:
snmpd, snmpget, snmpgetnext, snmpnetstat, snmptest, snmptrap,
snmptrapd, snmpwalk
/etc/mib.txt file
Based on RFC 1065, RFC 1066, RFC 1067
Marshall T. Rose, The Simple Book: An Introduction to Internet Management, Revised
2nd ed. (Prentice-Hall, 1996, ISBN 0-13-451659-1)
Syntax:
snmptest [-d] [-p port] [-r retry] [-t timeout]
-v 1 host community
Runs on:
Neutrino
Options:
-d Dump input and output packets.
community The community name for the transaction with the remote system.
context The collection of object resources that can be queried by the dstparty.
Description:
The snmptest utility enables you to monitor and manage information on a network
entity using SNMP (Simple Network Management Protocol). There are two different
versions of SNMP commonly in use: SNMPv1 and SNMPv2; future versions are
planned.
In SNMP terms, a server is called an agent and a client is called a manager. Agents
and managers exchange network information using protocol data units (PDUs). The
manager sends a PDU requesting information to the agent; the agent responds by
retrieving the information from the network’s management information database
(MIB) and sending a response PDU back to the manager. The manager can also
request changes to MIB data or ask for automatic log traps by sending the agent
different PDUs.
The snmptest utility provides an interactive facility for generating PDUs from the
SNMP manager’s command line.
You start an agent by running snmpd on a machine in your network.
You start an interactive manager session by invoking snmptest, after which, the
utility prompts you with:
Variable:
This starts your interactive session. You can enter one or more variable names, one per
line. If you enter a blank line, snmptest sends a request for each of the variables (in a
single packet) to the network entity. See the file mib.txt for the format specification
of variable names.
For example for SNMPv1, you might enter:
or for SNMPv2:
snmptest netdev-kbox.cc.cmu.edu manager_party agent_party agent_context
If you had access to this host, you would get a prompt like this:
Variable:
Variable: system.sysdescr.0
Variable:
After you enter the blank line, if your request was successful, snmptest will tell you
that is has received a Get Response and will display information about the
system.sysdescr.0 object.
By default, snmptest sends a GET request PDU but you can change this at the
Variable: prompt by entering a $ command, as follows:
GetBulkRequest-PDU ($B)
This returns information on several objects. You first specify any individual
objects you are interested in, then a number corresponding to a particular object
group, then the number of objects within that group you want to see. This is how
such a session might go:
Variable: $B
Request type is Bulk Request
Enter a blank line to terminate the list of non-repeaters
and to begin the repeating variables
Variable: system.sysDescr.0
Variable:
Now input the repeating variables
Variable: 3
Variable:
What repeat count? 4
Received Get Response from 10.7.0.55
requestid 0x7C81 errstat 0x0 errindex 0x0
system.sysObjectID.0 = OID: enterprises.QNX-Systems.1.1
at.atTable.atEntry.atIfIndex.1.1.10.0.2.51 = 1
at.atTable.atEntry.atIfIndex.1.1.10.7.0.55 = 1
at.atTable.atEntry.atPhysAddress.1.1.10.0.2.51 = Hex: 00 E0 29 34 6E 4D
at.atTable.atEntry.atPhysAddress.1.1.10.7.0.55 = Hex: 00 01 02 C1 8C 40
Variable:
There are a few things to notice about this sample session:
• After you have entered a variable, nothing happens until you enter a blank
line.
• In this case we have chosen to enter only one variable, but you may enter as
many variables as you want.
• The non-repeaters variable sends a GetNextRequest-PDU, not a
GetRequest-PDU.
• The repeating variables request asks for the number of the object
group from which you want start the bulk request (you’ll find these numbers
in the mib.txt file). In this case, it’s 3 and that correlates to the Address
Translation group (at).
• The repeat count specifies the number of contiguous MIB database objects
you want to inspect.
GetRequest-PDU ($G)
This is the default PDU. It asks the agent to send information about a network
entity. The agent responds with a Response-PDU containing the information
requested. For more information, see snmpget.
InformRequest-PDU ($I)
An SNMP manager uses this type of PDU to inform other managers about MIB
information hidden from their view. An inform request is similar to a trap in that
it can be used to send notification of an event that has occurred but, unlike a trap,
Variable: $S
Request type is Set Request
Variable: system.sysName.0
Type [i|s|x|d|n|o|t|a]: s
Value: James Bond
Variable:
Received Get Response from 10.7.0.55
requestid 0x6EC5 errstat 0x0 errindex 0x0
system.sysName.0 = "James Bond"
Variable:
In this session, we are requesting a change in the system name recorded in the
MIB database on the agent machine. As long as we have permission to do this,
snmptest asks for the variable we want to change, the type of data (a string in
this case), and the new value. After we have entered the obligatory blank line,
the object is changed and the new value is returned.
SNMPv2-Trap-PDU ($T)
Managers use this PDU to request an agent to report events asynchronously.
When the specified events occur, the agent sends a trap to the requesting
manager.
Before you can send this PDU, you have to invoke snmptrapd on the machine
running the agent.
If you enter $I, $S, or $T, snmptest requests information about each variable. First,
it prompts you for the variable type:
Type [i|s|x|d|n|o|t|a]:
continued. . .
Value:
If you’re using SNMP version 2, the following files must be configured on the
machine running the agent:
Environment variables:
MIBFILE Specify the location of the mib.txt file. For example,
MIBFILE=path/mib.txt (the default path is /etc).
SUFFIX If SUFFIX exists in your environment, all object IDs with a symbolic
name are printed with only the last element. Examples:
This ID:
system.syscontact.0
is printed as:
syscontact.0
This ID:
udp.udpTable.udpEntry.udpLocalAddress.0.0.0.161
is printed as:
udpLocalAddress.0.0.0.161
See also:
snmpd, snmpget, snmpgetnext, snmpnetstat, snmpset, snmpstatus,
snmptranslate, snmptrap, snmptrapd, snmpwalk
/etc/acl.conf, /etc/context.conf, /etc/mib.txt, /etc/party.conf,
/etc/snmpd.conf, /etc/view.conf files
Based on RFC 1065, RFC 1066, RFC 1067
RFC 1441, RFC 1445, RFC 1446
RFC 1448, RFC 1449
Marshall T. Rose, The Simple Book: An Introduction to Internet Management, Revised
2nd ed. (Prentice-Hall, 1996, ISBN 0-13-451659-1)
Syntax:
snmptranslate [-d] [-n] [-r] variable_name
Runs on:
Neutrino
Options:
-d Display the description of the object identifier from the mib.txt
file if it’s available.
-n Get the symbolic name from the dotted numeric notation (default
is to get the dotted numeric notation from the symbolic name).
variable_name The variable name in the format specified in the file mib.txt.
Description:
The snmptranslate utility is used to obtain the symbolic name from the dotted
numeric notation or vice versa — to obtain the dotted numeric notation from the
symbolic name of an object identifier.
You can specify one fully qualified object identifier in the format specified in the file
mib.txt.
Examples:
Obtain the dotted numeric notation of the system subtree:
snmptranslate system
.1.3.6.1.2.1.1
snmptranslate -n .1.3.6.1.2.1.1
system
Environment variables:
MIBFILE Specify the location of the mib.txt file. For example,
MIBFILE=path/mib.txt (the default path is /etc).
SUFFIX If SUFFIX exists in your environment, all object IDs with a symbolic
name are printed with only the last element. Examples:
This ID:
system.syscontact.0
is printed as:
syscontact.0
This ID:
udp.udpTable.udpEntry.udpLocalAddress.0.0.0.161
is printed as:
udpLocalAddress.0.0.0.161
Errors:
The snmptranslate utility has an error processing the request; an error message is
returned to help pinpoint how the request was malformed.
See also:
snmpd, snmpgetnext, snmpnetstat, snmpstatus, snmptest, snmptranslate,
snmptrap, snmptrapd, snmpwalk
/etc/mib.txt file
Based on RFC 1065, RFC 1066, RFC 1067, ISO 8824 (ASN.1)
RFC 1441, RFC 1445, RFC 1446, RFC 1448, RFC 1449
Marshall T. Rose, The Simple Book: An Introduction to Internet Management, Revised
2nd ed. (Prentice-Hall, 1996, ISBN 0-13-451659-1)
Syntax:
snmptrap [-d] -v 1 host community trap_type
specific_type device_description
[-a agent_addr]
Runs on:
Neutrino
Options:
-a agent_addr Change the address that the trap reports it’s being sent from. By
default, snmptrap uses the sending host’s address.
community The community name for the transaction with the remote system.
device_description
A textual description of the device sending this trap. The
description is used as the value of a system.sysDescr.0 variable.
trap_type An integer that specifies the type of trap message being sent. Trap
types are defined in the table below.
Description:
The snmptrap utility forms and sends an SNMP TRAP message to a host.
If you’re using SNMP version 2, you must configure the following files:
• /etc/acl.conf
• /etc/context.conf
• /etc/party.conf
For a description on how to configure the files, see the documentation for each of the
configuration files listed above. If you wish to change the location of your
configuration files, you must include a snmpd.conf file.
Examples:
Send a cold start trap to the specified host:
Using SNMPv1
snmptrap -v 1 nic.andrew.cmu.edu public 0 0 \
’SUN 3/60: SUNOS4.0’
Using SNMPv2
snmptrap nic.andrew.cmu.edu manager_party \
agent_party agent_context 0 0 ’SUN 3/60: SUNOS4.0’
Environment variables:
MIBFILE Specify the location of the mib.txt file. For example,
MIBFILE=path/mib.txt (the default path is /etc).
SUFFIX If SUFFIX exists in your environment, all object IDs with a symbolic
name are printed with only the last element. Examples:
This ID:
system.syscontact.0
is printed as:
syscontact.0
This ID:
udp.udpTable.udpEntry.udpLocalAddress.0.0.0.161
is printed as:
udpLocalAddress.0.0.0.161
See also:
snmpd, snmpget, snmpgetnext, snmpnetstat, snmpstatus, snmpset,
snmptest, snmptranslate, snmptrapd, snmpwalk
/etc/acl.conf, /etc/context.conf, /etc/mib.txt, /etc/party.conf,
/etc/snmpd.conf, /etc/view.conf files
Based on RFC 1065, RFC 1066, RFC 1067
RFC 1441, RFC 1445, RFC 1446
RFC 1448, RFC 1449
Marshall T. Rose, The Simple Book: An Introduction to Internet Management, Revised
2nd ed. (Prentice-Hall, 1996, ISBN 0-13-451659-1)
Syntax:
snmptrapd [-d] [-p] [-p port] [-v 1|2]
Runs on:
Neutrino
Options:
-d Dump input and output packets.
Description:
The snmptrapd utility receives SNMP TRAP messages sent to the snmp-trap port
on the local machine. If you specify -p, snmptrapd prints messages to standard
output. The messages are of the form:
Environment variables:
MIBFILE Specify the location of the mib.txt file. For example,
MIBFILE=path/mib.txt (the default path is /etc).
SUFFIX If SUFFIX exists in your environment, all object IDs with a symbolic
name are printed with only the last element. Examples:
This ID:
system.syscontact.0
is printed as:
syscontact.0
This ID:
udp.udpTable.udpEntry.udpLocalAddress.0.0.0.161
is printed as:
udpLocalAddress.0.0.0.161
See also:
/etc/acl.conf, /etc/context.conf, /etc/mib.txt, /etc/party.conf,
snmpd, /etc/snmpd.conf, snmpget, snmpgetnext, snmpnetstat, snmpset,
snmpstatus, snmptest, snmptranslate, snmptrap, snmpwalk syslogd,
/etc/view.conf
Based on RFC 1065, RFC 1066, RFC 1067
RFC 1441, RFC 1445, RFC 1446
RFC 1448, RFC 1449
Marshall T. Rose, The Simple Book: An Introduction to Internet Management, Revised
2nd ed. (Prentice-Hall, 1996, ISBN 0-13-451659-1)
Syntax:
snmpwalk [-d] [-p port] -v 1 host community
[variable_name]
Runs on:
Neutrino
Options:
-d Dump input and output packets.
community The community name for the transaction with the remote system.
variable_name The portion of the object identifier space that’s searched using
GET NEXT requests. The snmpwalk utility queries all variables
in the subtree below the given variable and displays their values.
Specify variable_name in the format specified in the file
mib.txt.
If you don’t specify variable_name, snmpwalk searches the
entire Internet MIB for host.
Description:
The snmpwalk utility uses GET NEXT requests to query for a tree of information
about a network entity (snmpbulkwalk uses BULK requests).
If you’re using SNMP version 2, you must configure the following files:
• /etc/acl.conf
• /etc/context.conf
• /etc/party.conf
• /etc/snmpd.conf (required only if you change the default location of your
config files)
For a description on how to configure the files, see the documentation for each of the
configuration files listed above. If you wish to change the location of your
configuration files, you must include a snmpd.conf file.
Examples:
Retrieve the variables in the system subtree:
Using SNMPv1
snmpwalk -v 1 netdev-kbox.cc.cmu.edu public system
Using SNMPv2
snmpwalk netdev-kbox.cc.cmu.edu manager_party \
agent_party agent_context system
Environment variables:
MIBFILE Specify the location of the mib.txt file. For example,
MIBFILE=path/mib.txt (the default path is /etc).
SUFFIX If SUFFIX exists in your environment, all object IDs with a symbolic
name are printed with only the last element. Examples:
This ID:
system.syscontact.0
is printed as:
syscontact.0
This ID:
udp.udpTable.udpEntry.udpLocalAddress.0.0.0.161
is printed as:
udpLocalAddress.0.0.0.161
Errors:
If the network entity has an error processing the request packet, an error packet is
returned and snmpwalk displays a message to help pinpoint how the request was
malformed.
If snmpwalk tries to search beyond the end of the MIB, it displays this message:
End of MIB
Caveats:
The snmpbulkwalk utility is more efficient.
See also:
snmpd, snmpbulkwalk, snmpget, snmpgetnext, snmpnetstat, snmpset,
snmpstatus, snmptest, snmptranslate, snmptrap, snmptrapd
/etc/acl.conf, /etc/context.conf, /etc/mib.txt, /etc/party.conf,
/etc/snmpd.conf, /etc/view.conf files
Based on RFC 1065, RFC 1066, RFC 1067
RFC 1441, RFC 1445, RFC 1446
RFC 1448, RFC 1449
Marshall T. Rose, The Simple Book: An Introduction to Internet Management, Revised
2nd ed. (Prentice-Hall, 1996, ISBN 0-13-451659-1)
Name:
/etc/socks.conf
Description:
All SOCKS client programs use this file to:
• exert access control based on the destination host, the requested service (port
number on the destination host), and the effective userid of the requesting local
user.
Each line in the file may be up to 1024 characters long. Lines starting with a number
sign (#) are comments. Lines that aren’t comments must be of one of the three forms:
deny [*=userlist] dst_addr dst_mask [op dst_port] [: shell_cmd]
eq Equal.
neq Not equal.
lt Less than.
gt Greater than.
le Less than or equal.
ge Greater than or equal.
dst_port Either a port number (e.g. 23) or the equivalent service name as
specified in the /etc/services file (e.g. telnet for port number
23). If this pair is omitted, the line applies to all services.
serverlist Used only in a sockd line. It consists of one or more SOCKS proxy
servers that the client program should try to use (in the indicated order)
for establishing a proxy connection.
You can use only commas as separator — no spaces or tabs are allowed
in the list. Although domain names of the servers may be used in the
list, it’s probably more prudent to specify IP addresses.
If the serverlist field is omitted, the client program uses the default
SOCKS proxy server, which is determined by the environment variable
SOCKS_SERVER or by the name compiled into the SOCKS client
program.
Consider this sockd line:
sockd @=1.2.3.4 *=boss,root 11.12.13.14 255.255.255.255 eq telnet
To match the condition indicated in this line, a request must come from
a local user whose effective id is either boss or root, the destination
IP address must be 11.12.13.14 exactly, and the service requested
must be telnet. In that case, connection to host 11.12.13.14
should be done via a SOCKS proxy server on host 1.2.3.4.
Every time a SOCKS client has to make a network connection, it
checks the pending request against the /etc/socks.conf file, one
line at a time. Once the client finds a line with conditions that are
matched by the request, the action specified on that line is taken. The
remaining lines of /etc/socks.conf are skipped. If no matching
line is found throughout the file, the request is denied.
The order of the lines in the file is extremely important — switch two lines and you
may have entirely different results!
shell_cmd A command string that’s executed when the conditions on that line are
satisfied. The following substitutions occur before the string is
presented to the Borne shell for execution:
You can string several shell commands together in the usual way with
|, ;, etc.
Although there’s an implied “deny all” at the end of the control file, you may supply
one explicitly to take some specific action when requests are so rejected. For example:
deny 0.0.0.0 0.0.0.0 : /usr/bin/mail -s ‘SOCKS: rejected %S from %u to %Z’ root
Environment variables:
SOCKS_SERVER
If defined, this environment variable specifies the name or IP address of the
SOCKS proxy server host to use, overriding the default server compiled into the
programs.
Syntax:
sockstat [-46clnu] [-f address_family] [-p ports]
Runs on:
QNX Neutrino
Options:
-4 Show AF_INET (IPv4) sockets.
-p ports Show only Internet sockets if either the local or foreign port
number is in the specified list. The ports argument is a
comma-separated list of port numbers and ranges specified as a
first and a last port separated by a dash.
Description:
The sockstat command lists open Internet or UNIX domain sockets.
If you don’t specify any of the -4, -6, or -u options, sockstat lists the sockets in all
three domains.
If you don’t specify either of the -c or -l, sockstat lists both listening and
connected sockets, as well as those sockets that are in neither state.
The information listed for each socket is:
PROTO The transport protocol associated with the socket for Internet
sockets, or the type of socket (stream or datagram) for UNIX
sockets.
LOCAL ADDRESS For Internet sockets, this is the address to which the local end of
the socket is bound (see getsockname() in the Neutrino Library
Reference). For bound UNIX sockets, it’s the socket’s filename
or -.
FOREIGN ADDRESS The address to which the foreign end of the socket is bound (see
getpeername()), or - for unconnected UNIX sockets.
See also:
netstat
getpeername(), getsockname(), INET6, UNIX in the Neutrino Library Reference
Syntax:
sort [-m] [-o name] [-bdfinru] [-t char]
[-k keydef ] [+oldkey] [file...]
Runs on:
QNX Neutrino, Microsoft Windows
Options:
-c Check that the single input file is already sorted. Produce no output.
-m Merge only. It’s assumed that the input files are already sorted.
-o name The name argument is the name of an output file to be used instead of
the default, which is standard output. This file can be the same as one of
the input files.
-u Unique; suppress all but one key in each set of lines having equal keys.
The following options override the default ordering rules. When ordering options
appear independent of key field specifications, the requested field ordering rules are
applied globally to all sort keys. When attached to a specific key (see option -k), the
specified ordering options override all global ordering options for that key.
Description:
The sort utility orders lines from a set of files (or standard input if no files are
provided) and merges the output into the specified output (or standard output if no
output file is specified). The sort utility provides a number of options for controlling
the sorting mechanism. The default behavior of sort is to treat all lines as a sequence
of characters to be sorted in ascending order.
The sort utility regards files and file contents the following way:
The -t option has subtle effects. If you don’t use the option, only the first blank in a
string of blank characters is interpreted as a field separator; the remaining are
considered part of the next field. If you use the -t option, every occurrence of the field
separator character is considered a terminator for a field. Thus, four adjacent field
separators represent three empty fields.
A sort key field may be defined using the following syntax:
Notice that the type_string attached to field_string is used to determine the type of
comparison with this key.
The second type_string is solely to adjust the extent of the sort_key, thus only i and b
make any sense. Any other characters are ignored.
Examples:
The standard password file has the form:
username:password:uid:gid:misc:home:shell
Exit status:
0 All input files were sorted successfully, or the option -c was specified and the
input file was already correctly sorted.
1 The -c option was used and the input file wasn’t already sorted.
See also:
diff, grep, sed, tsort
Syntax:
spatch [-bp] file [offset]
Runs on:
Neutrino
Options:
-b Browse only; don’t allow the Save command. The file or disk is accessed
in read-only mode.
offset The address — in RAM, in the file, or on the disk — where the spatch is
to begin (specified in hex).
Description:
The spatch utility provides fullscreen editing of files or disk blocks. The screen
displays a 16-by-16 (256) byte image of the data being examined, similar to that
shown here:
Edit Next Prev Lastblk Home Goto Find Continue Save Addr Quit
000000000: 2E 28 6E 65 77 29 20 53 50 41 54 43 48 20 22 46 .(new) SPATCH "F
000000010: 75 6C 6C 20 73 63 72 65 65 6E 20 70 61 74 63 68 ull screen patch
000000020: 20 75 74 69 6C 69 74 79 22 1E 2E 28 73 79 6E 74 utility"..(synt
000000030: 61 78 29 1E 09 11 73 70 61 74 63 68 10 20 20 11 ax)...spatch. .
At the top of the screen, there’s a list of commands. To select a command, either type
its first letter or move the cursor to the command (with the arrow keys) and press Enter.
The commands are as follows:
Edit Enter the data area. Pressing Tab switches between hex and ASCII
data entry. Pressing Esc returns you to the menu. The changed data
isn’t updated on the disk or in memory.
Next Move forward 256 bytes. You can also press Pg Dn.
Prev Move backward 256 bytes. You can also press Pg Up.
Home Go to the start of the file, disk, or memory. You can also press the
Home key.
Lastblk Go to the last block of the file or disk. You can also press End.
Find Search for a specified pattern, which may consist of single characters
or hex digit pairs separated by a space. For example, the patterns 61
62 63 d e and a b c d e both match the five characters abcde.
To stop the search, press any key.
Continue Find the next occurrence of the last pattern found. You typically use
this command after a Find when searching.
Save Save the current screen back to the source. Without issuing this
command, all changes made using Edit are lost as soon as you leave
the current screen of data. The Save option is disabled if you specify
the -b (browse) option.
If you specify a directory in the file argument, the disk is edited, but spatch moves
only through the blocks that make up the directory. This is similar to “spatching” a
file, but if you wish to make changes, the disk must be opened for exclusive use as
would any block special file.
To run spatch on a directory or a block special file, you must either be root or have
write permission for the disk’s block special file.
The offset argument lets you specify the address where spatch is to begin. If file is a
regular file, the offset is a byte offset. If file is a block special file, the offset is a
block:byte offset. If file is a block special file with a QNX filesystem on it, the offset
may be the name of a file or directory (the beginning address is the first block of the
named file). If the named file has extents, spatch doesn’t thread through those
extents, but goes to the next sequential block.
You can use spatch to recover lost files or directories. For more information, see the
Working with Filesystems and Backing Up and Recovering Data chapters of the
Neutrino User’s Guide.
Examples:
Patch the contents of the file /bin/ls:
spatch /bin/ls
spatch /dev/hd0
Environment variables:
TERM Interpreted as the name of the terminal type.
Exit status:
0 Success.
Caveats:
You may not use the spatch utility on a disk when there are open files on the disk,
unless you specify the -b (browse) option.
See also:
hd
Working with Filesystems and Backing Up and Recovering Data in the Neutrino
User’s Guide
Syntax:
split [-a suffix_length] [-b n[k|m]] [-l line_count]
[-p pattern] [file [name]]
Runs on:
QNX Neutrino, Microsoft Windows
Options:
-a suffix_length Use suffix_length letters to form the suffix of the filenames of the
split file.
-b n[k|m] Split a file into pieces that are n bytes in size. You can add the
letter k or m after n to specify units of kilobytes (1024 bytes) or
megabytes (1048576 bytes).
-l line_count (“el”)Split the files so that there are line_count lines in each
resulting file piece. The line_count argument is an unsigned
decimal integer. The default is 1000. Note that the last file might
differ in size from the other files.
file The pathname of the file to be split. If you don’t specify any files,
or file is -, split reads from standard input.
name The prefix to be used for each of the files resulting from the split
operation. If you don’t specify a name, x is used as the prefix of
the output files. The combined length of name and suffix_length
can’t exceed 48 characters.
Description:
The split utility reads an input file and writes the data from that file into one or more
output files.
By default, the names of the output files are xaa, xab, ..., xzz, and each output file,
except possibly the last, gets 1000 lines.
The last file contains the remainder of the input file, and therefore may be smaller than
the requested size. Conversely, it may be longer than the other files if there are too few
filenames available to take all the input in chunks of the specified size.
Examples:
Suppose you have a file named big_file that’s 8192 lines in length. The following
command creates nine files named xaa, xab, xac, ..., xai. The first eight files all
contain 1000 lines, while the last file contains only 192:
split big_file
Again, assuming that big_file is 8192 lines in length, the following command
creates only two files: smaller_aa, which contains 8000 lines, and smaller_ab,
which contains 192 lines:
Files:
You can use any file as input, but if you’re splitting a nontext file, you must specify
option -b. The output files contain portions of the original input file that are otherwise
unchanged.
Exit status:
0 Successful completion.
See also:
cat, cut, gawk, head, sed, tail
Syntax:
spooler -d device [options]
Runs on:
Neutrino
Options:
-C Calculate and print the device ID, and then exit.
-c config The name of the configuration file that defines filters and properties
for a printer.
-f maxjobs Limit the number of simultaneous spool files to maxjobs. The default
is no limit.
-n name The name of the printer. If this option isn’t specified, spooler gets
the name from the PnP model or the configuration file. The Print
dialog for a Photon application uses this name in the list of available
printers.
Description:
The spooler allows multiple users to share the resources of a single printer. If you
have more than one printer, you can start an instance of spooler for each one.
The spooler is usually started by an enumerator, such as enum-par (see
enum-devices), as follows:
spooler -d /dev/par1
or you can start spooler (e.g. for a network printer) in your /etc/rc.d/rc.local
file — see Controlling How Neutrino Starts in the Neutrino User’s Guide.
When you start spooler, it queries the printer to determine its type. If you provide a
PnP string, spooler doesn’t query the printer for it:
You can use other options to force spooler to use a configuration file and assign a
name to the printer, but this isn’t recommended:
You can find configuration files for commonly used printers in /etc/printers.
These files specify the possible and default settings for the printers, as well as filters
for converting output to a form that the printers understand.
Photon applications use spooler for printing. The filters that convert Photon
draw-stream (.phs) output are named phs-to-*.
For a graphical interface to spooler, see prjobs.
See also:
enum-devices, phs-to-*, prjobs
Controlling How Neutrino Starts and Printing chapters of the Neutrino User’s Guide
Syntax:
ssh [-1246AaCfgKkMNnqsTtVvXxY] [-b bind_address]
[-c cipher_spec] [-D [bind_address:]port] [-e escape_char]
[-F configfile] [-i identity_file]
[-L [bind_address:]port:host:hostport]
[-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option]
[-p port] [-R [bind_address:]port:host:hostport] [-S ctl_path]
[-w local_tun[:remote_tun]] [user@]hostname [command]
Runs on:
QNX Neutrino
Options:
See ssh in the NetBSD documentation.
Description:
The ssh (SSH client) utility is a program for logging into a remote machine and for
executing commands on a remote machine. For more information, see ssh in the
NetBSD documentation.
Contributing author:
NetBSD
See also:
/etc/moduli, scp, sftp, sftp-server, ssh-add, ssh-agent, ssh-keygen,
ssh-keyscan, ssh-keysign, ˜/.ssh/ssh_config, /etc/ssh/ssh_config,
sshd, /etc/ssh/sshd_config in the NetBSD documentation
Syntax:
ssh-add [-cDdLlXx] [-t life] [file ...]
ssh-add -s reader
ssh-add -e reader
Runs on:
QNX Neutrino
Options:
See ssh-add in the NetBSD documentation.
Description:
The ssh-add adds RSA or DSA identities to the authentication agent, ssh-agent.
For more information, see ssh-add in the NetBSD documentation.
Contributing author:
NetBSD
See also:
/etc/moduli, scp, sftp, sftp-server, ssh, ssh-agent, ssh-keygen,
ssh-keyscan, ssh-keysign, ˜/.ssh/ssh_config, /etc/ssh/ssh_config,
sshd, /etc/ssh/sshd_config in the NetBSD documentation
Syntax:
ssh-agent [-c | -s] [-d] [-a bind_address] [-t life]
[command [arg ...]]
Runs on:
QNX Neutrino
Options:
See ssh-agent in the NetBSD documentation.
Description:
The ssh-agent is a program that holds private keys used for public key
authentication (RSA, DSA). For more information, see ssh-agent in the NetBSD
documentation.
Contributing author:
NetBSD
See also:
/etc/moduli, scp, sftp, sftp-server, ssh, ssh-add, ssh-keygen,
ssh-keyscan, ssh-keysign, ˜/.ssh/ssh_config, /etc/ssh/ssh_config,
sshd, /etc/ssh/sshd_config in the NetBSD documentation
Name:
˜/.ssh/ssh_config, /etc/ssh/ssh_config
Description:
The ssh program obtains configuration data from the following sources in the
following order:
1 command-line options
See also:
/etc/moduli, scp, sftp, sftp-server, ssh, ssh-add, ssh-agent,
ssh-keygen, ssh-keyscan, ssh-keysign, sshd, /etc/ssh/sshd_config in
the NetBSD documentation
Syntax:
ssh-keygen [-q] [-b bits] -t type [-N new_passphrase]
[-C comment] [-f output_keyfile]
ssh-keygen -D reader
Runs on:
QNX Neutrino
Options:
See ssh-keygen in the NetBSD documentation.
Description:
The ssh-keygen utility generates, manages, and converts authentication keys for
ssh. For more information, see ssh-keygen in the NetBSD documentation.
Contributing author:
NetBSD
See also:
/etc/moduli, scp, sftp, sftp-server, ssh, ssh-add, ssh-agent,
ssh-keyscan, ssh-keysign, ˜/.ssh/ssh_config, /etc/ssh/ssh_config,
sshd, /etc/ssh/sshd_config in the NetBSD documentation
Syntax:
ssh-keyscan [-46Hv] [-f file] [-p port] [-T timeout]
[-t type] [host | addrlist namelist] [...]
Runs on:
QNX Neutrino
Options:
See ssh-keyscan in the NetBSD documentation.
Description:
The ssh-keyscan utility gathers the public SSH host keys of a number of hosts. For
more information, see ssh-keyscan in the NetBSD documentation.
Contributing author:
NetBSD
See also:
/etc/moduli, scp, sftp, sftp-server, ssh, ssh-add, ssh-agent,
ssh-keygen, ssh-keysign, ˜/.ssh/ssh_config, /etc/ssh/ssh_config,
sshd, /etc/ssh/sshd_config in the NetBSD documentation
Syntax:
ssh-keysign
Runs on:
QNX Neutrino
Options:
None.
Description:
The ssh-keysign program is used by ssh to access the local host keys and generate
the digital signature required during host-based authentication with SSH protocol
version 2. For more information, see ssh-keysign in the NetBSD documentation.
Contributing author:
NetBSD
See also:
/etc/moduli, scp, sftp, sftp-server, ssh, ssh-add, ssh-agent,
ssh-keygen, ssh-keyscan, ˜/.ssh/ssh_config, /etc/ssh/ssh_config,
sshd, /etc/ssh/sshd_config in the NetBSD documentation
Syntax:
sshd [-46Ddeiqt] [-b bits] [-f config_file]
[-g login_grace_time] [-h host_key_file] [-k key_gen_time] [-o option]
[-p port] [-u len]
Runs on:
QNX Neutrino
Options:
See sshd in the NetBSD documentation.
Description:
The sshd (OpenSSH Daemon) is the daemon program for ssh. Together, these
programs replace rlogin and rsh, and provide secure encrypted communications
between two untrusted hosts over an insecure network. For more information, see
sshd in the NetBSD documentation.
Contributing author:
NetBSD
See also:
rlogin, rsh
/etc/moduli, scp, sftp, sftp-server, ssh, ssh-add, ssh-agent,
ssh-keygen, ssh-keyscan, ssh-keysign, ˜/.ssh/ssh_config,
/etc/ssh/ssh_config, /etc/ssh/sshd_config in the NetBSD documentation
Name:
/etc/ssh/sshd_config
Description:
The sshd daemon reads configuration data from /etc/ssh/sshd_config (or the
file specified with the -f option). For more information, see
/etc/ssh/sshd_config in the NetBSD documentation.
See also:
/etc/moduli, scp, sftp, sftp-server, ssh, ssh-add, ssh-agent,
ssh-keygen, ssh-keyscan, ssh-keysign, ˜/.ssh/ssh_config,
/etc/ssh/ssh_config, sshd in the NetBSD documentation
Description:
All QNX Neutrino startup programs support the generic options described below.
There are additional options for the following architectures:
• ARM
• PowerPC
• x86
Individual startup programs can override these options and may support additional
board-specific options. The order of precedence is as follows:
1 board-specific options
2 architecture-specific options
3 generic options
Generic options
-A Reboot the system on any abnormal termination of the kernel.
The default is to display information about the crash, and then
halt.
-D channel[.channel_opts]
Specify an output channel for debugging information. The
format of this option and the default value vary from board to
board.
-F [˜]value Control the flags field in the cpuinfo section of the system page:
• value — OR the flags field with value
• ˜value — AND the flags field with ˜value
For more information about the flags, see “Structure of the
system page” in the Customizing Image Startup Programs
chapter of the Building Embedded Systems guide.
-f [cpu_freq][,[cycles_freq][,timer_freq]]
Specify CPU frequencies. All frequencies can be followed by
H for hertz, K for kilohertz, or M for megahertz (these suffixes
aren’t case-sensitive). If no suffix is given, the library assumes
megahertz if the number is less than 1000; otherwise it
assumes hertz.
Even if the IFS checksum verification is disabled, a checksum is still performed on the
IFS Restoration internal data structure (approximately 32 bytes) to ensure at least
some data integrity.
For more information, see Reloadable Image Filesystems in the
QNX Neutrino technotes.
-i ifs2_size[,flags][,paddr_src][,paddr_dst]
Enable secondary IFS restoration.
The arguments are:
Even if the secondary IFS checksum is disabled, a checksum is still performed on the
IFS Restoration internal data structure (approximately 16 bytes) to ensure at least
some data integrity.
For more information, see Reloadable Image Filesystems in the
QNX Neutrino technotes.
-K channel[.channel_opts]
Specify an output channel for kernel debugger information.
The format of this option and the default value vary from board
to board.
-N hostname Specify the node name. The default is the local host.
Flag: Memory:
None Clears to 0
0 Clears to 0
1 Does not clear
-S [˜]section Turn on (or, if you use ˜section, off) output of the specified
syspage section’s information. Use this to restrict the amount
of syspage information. For more information, see the
description of print_syspage() in the Customizing Image
Startup Programs chapter of Building Embedded Systems.
The configuration must specify at least the default (pte) field. Any
unsupported policy should specify 0 in the appropriate field, and if that
policy is requested via the -w option, it’s ignored, and the default policy
is used.
-E Save and restore the External Access Register (EAR) in the context when
switching threads. The EAR is an optional register available on some PPC600
family chips. If the chip supports it, it should be saved and restored, but the
instructions that reference it are seldom used. Accordingly, it’s left out of the
thread context for performance reasons, unless you specify the -E option.
-x Enable extended addressing. This lets you access physical addresses above 4
GB. This option is supported for backward compatibility; XAE is enabled by
default if the chip supports it.
-B By default, x86 startups use the Advanced Control and Power Interface (ACPI)
table to determine the number of logical CPUs on hyperthreaded systems. Use
this option to avoid checking for ACPI in the case of buggy BIOSs; if ACPI
isn’t present or you specify -B, the startup uses the Intel Multiprocessor
Specification to determine the number of CPUs.
-x Enable extended addressing. This lets you access physical addresses above 4
GB.
This option has an effect only if the CPU supports more than 32 address lines. On x86
CPUs, extended addressing is supported if the X86_CPU_PAE bit is on in the
SYSPAGE_ENTRY(cpuinfo)->flags. For more information, see “Structure of the
system page” in the Customizing Image Startup Programs chapter of Building
Embedded Systems.
See also:
mkifs, procnto, startup-*
ClockTime(), SYSPAGE_ENTRY() in the QNX Neutrino Library Reference
Customizing Image Startup Programs in Building Embedded Systems
Reloadable Image Filesystems in the QNX Neutrino technotes
Syntax:
startup-apic [-ABb] [-D channel[.channel_opts]]
[-F [˜]value]
[-f [cpu_freq][,[cycles_freq][,timer_freq]]]
[-I flag] [-i ifs2_size[,flags][,paddr_src][,paddr_dst]]
[-j addr] [-K channel[.channel_opts]]
[-N hostname] [-P max_cpus]
[-R size[,align]] [-r addr,size[,flag]]
[-S [˜]section] [-s size] [-T] [-v[v]...] [-x]
Runs on:
QNX Neutrino
Targets:
x86
Options:
In addition to the generic startup-* and x86-specific options, startup-apic
supports the following options:
-b Don’t reserve the bottom 4 KB of memory for virtual 8086 mode. This
provides an extra 4 KB of memory for system use.
-s size Copy the given amount of video card ROM into RAM, and set the x86
page tables to refer to the RAM copy rather than the ROM. The size is in
bytes, unless followed by one of K (kilobytes), M (megabytes), or G
(gigabytes). Specifying the -s option causes the following call:
For more information, see “The startup library” in the Customizing Image
Startup Programs chapter of Building Embedded Systems.
Debug channels
The debug channel specified with the -D and -K options can be:
8250[.port[ˆshift][.baud[.clock[.divisor]]]]
Use a generic 8250-compatible serial chip, with:
port Specify the I/O port base address for the 8250, in hexadecimal.
The default is 3f8.
shift Specify the spacing between the I/O registers, in 2shift bytes.
The default is 0.
baud Specify the baud rate for the debug channel. The default is
57600.
clock Specify the clock rate (in Hz) input to the chip. The default is
1843200.
divisor Specify the divisor used on the clock rate by the chip. The
default is 16.
You can skip options by leaving out the data associated with that part. For example, if
you want to send the debugging output to an 8250 chip using 9600 baud, use:
-D 8250..9600
-D console
-K 8250.3f8ˆ0.57600.1843200.16
Description:
The startup-apic program is the startup for boards that support Intel Advanced
Programmable Interrupt Controllers (APIC). It supports Message Signaled Interrupts
(MSI) and Extended MSI (MSI-X).
pci-bios=pci-bios-v2
Examples:
Direct debug output to the console:
Direct debug output to the first serial port (making sure the baud rate was set to
115200 on the receiving side):
See also:
mkifs, pci-bios-v2, procnto, procnto-smp, startup-* options, startup-*
ClockTime(), SYSPAGE_ENTRY() in the QNX Neutrino Library Reference
Customizing Image Startup Programs in Building Embedded Systems
Syntax:
startup-bios [-ABb] [-D channel[.channel_opts]]
[-F [˜]value]
[-f [cpu_freq][,[cycles_freq][,timer_freq]]]
[-I irq] [-j addr] [-K channel[.channel_opts]] [-L]
[-N hostname] [-P max_cpus]
[-R size[,align]] [-r addr,size[,flag]]
[-S [˜]section] [-s size] [-T] [-v[v]...] [-x]
Runs on:
Neutrino
Targets:
x86 with a PC-compatible BIOS
Options:
In addition to the generic startup-* and x86-specific options, startup-bios and
startup-bios-32 support the following options:
-b Don’t reserve the bottom 4 KB of memory for virtual 8086 mode. This
provides an extra 4 KB of memory for system use.
-I irq Make irq the highest-priority hardware interrupt in the system. You can
specify a number from 0 through 7 (the default is 3).
For more information, see “The startup library” in the Customizing Image
Startup Programs chapter of Building Embedded Systems.
Debug channels
The debug channel specified with the -D and -K options can be:
8250[.port[ˆshift][.baud[.clock[.divisor]]]]
Use a generic 8250-compatible serial chip, with:
port Specify the I/O port base address for the 8250, in
hexadecimal. The default is 3f8.
shift Specify the spacing between the I/O registers, in 2shift bytes.
The default is 0.
baud Specify the baud rate for the debug channel. The default is
57600.
clock Specify the clock rate (in Hz) input to the chip. The default is
1843200.
divisor Specify the divisor used on the clock rate by the chip. The
default is 16.
You can skip options by leaving out the data associated with that part. For example, if
you want to send the debugging output to an 8250 chip using 9600 baud, use:
-D 8250..9600
The default -D and -K settings are:
-D console
-K 8250.3f8ˆ0.57600.1843200.16
Description:
The startup-bios and startup-bios-32 programs are responsible for probing
PC hardware resources using the BIOS. They’re similar, except that startup-bios
uses 64-bit physical addresses, and startup-bios-32 uses 32-bit ones.
If you want to use Message Signaled Interrupts (MSI) or Extended MSI (MSI-X), use
startup-apic instead of startup-bios in your build file. You must use
startup-apic in conjunction with pci-bios-v2.
Examples:
Direct debug output to the console:
startup-bios -Nnode120 -vvvv -Dconsole
Direct debug output to the first serial port (making sure the baud rate was set to
115200 on the receiving side):
startup-bios -Nnode120 -vvvv -D8250..115200
Direct debug output to the serial port at 2f8:
startup-bios -Nnode120 -vvvv -D8250.2f8.115200
For more examples, see ${QNX_TARGET}/x86/build.
See also:
mkifs, procnto, procnto-smp, startup-*
ClockTime(), SYSPAGE_ENTRY() in the QNX Neutrino Library Reference
Customizing Image Startup Programs in Building Embedded Systems
Syntax:
strings_variants [options] file...
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
The strings_variant depends on the target platform, as follows:
Description:
For each file given, strings prints the printable character sequences that are at least 4
characters long (or the number given with the options) and are followed by an
unprintable character. By default, it prints only the strings from the initialized and
loaded sections of object and ELF files; for other types of files, it prints the strings
from the whole file.
The strings utility is mainly useful for determining the contents of nontext files.
For detailed documentation, see the GNU website at http://www.gnu.org/.
Contributing author:
GNU
Syntax:
strip_variant [options] objfile...
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
The strip_variant depends on the target platform, as follows:
Description:
The strip utility discards all symbols from object files objfile. The list of object files
may include archives. At least one object file must be given.
This utility modifies the files named in its argument instead of writing modified copies
under different names.
For detailed documentation, see the GNU website at http://www.gnu.org/.
Contributing author:
GNU
Syntax:
stty [-a|-g] [operands] [< device]
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
-a Display all settings.
Description:
The stty utility sets and/or reports terminal I/O characteristics for the device that is
its standard input. If no operands are specified, stty displays the settings. If operands
are given, then stty changes the terminal state to reflect those settings.
Terminal settings fall into two major categories:
edit mode The user can edit the input data. It’s made available to programs only
when a CR is pressed. Output data is normally presented in a
human-readable format.
raw mode All data flows to and from the terminal with little extra processing.
If you’re at a shell prompt, your terminal is probably in the default system edit mode.
A full-screen program such as an editor, on the other hand, typically puts the terminal
into raw mode.
Normally, stty displays only significant settings relative to the system default
settings for edit or raw, and displays only the defined control characters. If -a or -g is
specified, then stty displays all the settings.
The stty utility manages a very large number of potential terminal attributes and
control characters. Most of these parameters are very device-specific and seldom need
to be changed by the user. Programs often change these terminal attributes in the
course of their operation, and upon occasion (such as abnormal termination) may leave
the terminal settings in an unknown state. The stty +edit option is a convenient
method of restoring a terminal to a usable state.
Supported operands
The tables below list the operands supported by stty. In these tables, the following
conventions are used:
The following descriptions give the action taken when the option is on.
continued. . .
Parameter Defines
bits=5 5-bit characters
bits=6 6-bit characters
bits=7 7-bit characters
bits=8 8-bit characters
stopb=2 2-stop bits
stopb=1 1-stop bits
{+|-}parenb Enable parity
+parodd Odd parity
-parodd Even parity
{+|-}parstk Stick parity
+cs5 Same as bits=5
+cs6 Same as bits=6
+cs7 Same as bits=7
+cs8 Same as bits=8
+cstopb Same as stopb=2
-cstopb Same as stopb=1
number Same as baud=number
+evenp Same as par=even, bits=7
-evenp Same as par=none, bits=8
+parity Same as par=even, bits=7
-parity Same as par=none, bits=8
+oddp Same as par=odd, bits=7
-oddp Same as par=none, bits=8
{+|-}hupcl Hangup on last close
{+|-}hup Same as hupcl
{+|-}cread Enable receiver
{+|-}clocal Assume no modem control
{+|-}ihflow Enable hardware input flow control
{+|-}ohflow Enable hardware output flow control
continued. . .
Parameter Defines
{+|-}isflow Enable software input flow control
{+|-}osflow Enable software output flow control
{+|-}ihpaged Input is paged by hardware flow control
{+|-}ohpaged Output is paged by hardware flow control
{+|-}ispaged Input is paged by software flow control
{+|-}ospaged Output is paged by software flow control
rows=value[,value] The number of rows and (optionally) columns of the terminal
continued. . .
Parameter Defines
{+|-}echoke Kill character erases displayed line
{+|-}echonl Echo NL, even if ECHO is off
{+|-}noflsh Don’t flush I/O after INTR, QUIT, or SUSP
min=number Minimum characters required to satisfy raw input
time=number Timeout value for raw input
{+|-}tostop Send SIGTTOU for background output.
+nl Same as +icrnl
-nl Same as -icrnl, -inlcr, -igncr
+sane Reset all parameters to sane values based on current mode
(edit/raw)
+fix Same as +sane
+edit Reset parameters to system default edit mode
+flush Flush all pending input and output
+raw Reset parameters to system default raw mode
continued. . .
Parameter Defines
fwd=value Forwarding or framing character; if this character is set, then
readcond() returns when either the read length is reached or the
FWD character is found in the data stream. For more
information, see the entry for readcond() in the QNX Neutrino
Library Reference.
intr=value Generate SIGINT character
kill=value Delete entire line character
lnext=value Character for entering the next character quoted
quit=value Generate SIGQUIT character
reprint=value Character for redrawing the current line
susp=value Generate SIGTSTP character
swtch=value Character for switching to a different shell layer
stop=value Stop output
start=value Resume output
+ek Resets ERASE and KILL to system defaults
werase=value Character for erasing the last word typed
Parameter Meaning
+load Set editing keys based on currently defined terminal type
term=name Set editing keys for the specified type of terminal
pr1=value First character of prefix
pr2=value Second character of prefix
pr3=value Third character of prefix
pr4=value Fourth character of prefix
sf1=value First character of suffix
continued. . .
Parameter Meaning
sf2=value Second character of suffix
sf3=value Third character of suffix
sf4=value Fourth character of suffix
Action characters
The following are action characters when preceded by prefix (subsequent suffix are
discarded).
Parameter Meaning
up=value Recall previous line
down=value Recall next line
left=value Move cursor left
right=value Move cursor right
ins=value Toggle insert mode
del=value Delete current character
rub=value Delete previous character
can=value Delete entire line character
home=value Move cursor to beginning of line
end=value Move cursor to end of line
Examples:
Display settings of the terminal to which stty is attached:
stty
Display settings of a specified device:
stty < /dev/ser1
Change the baud rate of a specified device:
stty baud=1200 < /dev/ser1
Put terminal into a fixed, sane state:
stty +sane
Set editing keys to VT100 values:
stty term=vt100
Restore settings from a shell variable:
stty $saveterm
Exit status:
0 Success.
Caveats:
The stty utility quietly accepts all of the documented options, but some of the current
managers might not support them.
Syntax:
su [-c] [[-] userid [arguments]]
Runs on:
Neutrino
Options:
-c Pass the specified list of arguments to the shell.
userid Switch to the specified user ID. If preceeded by the - argument, userid’s
login scripts will run, setting up the shell environment as if you had
actually logged in as the specified user.
Description:
The su utility lets you temporarily become another user, then return to your regular
userid.
The su utility requests the password of the given userid (root, by default) and
changes to that userid, invoking its shell but modifying only essential elements of the
environment. Only the HOME, PATH, and possibly SHELL environment variables
are changed, but the new shell has the rights and privileges of the user specified. The
new userid remains in effect until this shell exits.
This utility needs to have the setuid (“set user ID”) bit set in its permissions. If you use
mkefs, mketfs, or mkifs on a Windows host to include this utility in an image, use
the perms attribute to specify its permissions explicitly, and the uid and gid
attributes to set the ownership correctly.
Files:
/bin/sh Korn shell command interpreter.
/etc/.pwlock This file is used to lock password files when modifications are
taking place.
/etc/default/profile
The passwd utility copies this file as a user’s initial .profile
when it creates a new account.
See also:
login, passwd
Logging In, Logging Out, and Shutting Down in the Neutrino User’s Guide
Syntax:
sync
Runs on:
Neutrino
Options:
None.
Description:
The sync utility forces the filesystem manager to begin flushing all modified
in-memory inodes and all previously unwritten system buffers to disk. This ensures
that all file modifications up to that point are scheduled to be saved.
The sync utility usually returns before the operation is complete. After executing
sync, you must allow sufficient time for the driver queues to drain before you may
assume that the data is safely on disk. This delay depends on the speed of your disk(s),
the number of buffers that must be drained, and how active your system is at the time.
It is unusual for the operation to take more than four to five seconds with typical IDE
drives and a large (2 megabyte) cache, if a large portion of the cache needs to be
flushed. With faster disks (e.g. SCSI), it usually completes in under two seconds. If
significant amounts of data are being flushed to a floppy disk, it could take many tens
of seconds.
Examples:
Synchronize the local filesystem:
sync
See also:
shutdown
Syntax:
sysctl [-n] name...
Runs on:
Neutrino
Options:
-a List all the currently available string or integer values.
-A List all the known MIB names, including tables. Those with
string or integer values are printed as they would be with the -a
option; for the table values, the name of the utility to retrieve
them is given.
-n Suppress the printing of the field name, and output only its value.
You’ll find this option useful when you’re setting shell variables.
For example, to save the IP TTL value in the variable ipttl, type
the following:
Description:
The sysctl utility retrieves the state of the socket manager and allows processes with
appropriate privilege to set the state. The variable to be retrieved or set is described
using a Management Information Base (MIB) style name, described as a dotted set of
components.
The information available from sysctl consists of integers, strings, and tables. You
can retrieve tabular information only by using special-purpose programs such as arp
and netstat.
The variables that are available to you depend on what you’re running on your
machine; the table below shows the variables that are likely of most interest. For
information about determining the meaning of other variables, see sysctl() in the
Neutrino Library Reference.
A process with appropriate privilege can change the value of all these variables except
those marked as read-only. All values are integers unless otherwise indicated.
net.inet.arp.down
The failed ARP entry lifetime.
net.inet.arp.keep
The valid ARP entry lifetime.
net.inet.arp.prune
The ARP cache pruning interval.
net.inet.arp.refresh
The ARP entry refresh interval.
net.inet.ip.allowsrcrt
Allow (1) or drop (0) all source-routed packets.
net.inet.ip.directed-broadcast
Enable (1) or disable (0) directed-broadcast.
net.inet.ip.do_loopback_cksum
Compute (1) or don’t compute (0) checksums on loopback.
net.inet.ip.forwarding
Disable (0) or enable (1) IP forwarding. If this is enabled, the host
acts as a router.
net.inet.ip.forwsrcrt
Forward source-routed packets.
net.inet.ip.maxflows
The maximum number of IP flows allowed.
net.inet.ip.mtudisc
Allow (1) or disallow (0) path MTU discovery.
net.inet.ip.redirect
Allow (1) or disallow (0) send ICMP redirections when forwarding.
This option is ignored unless the host is routing IP packets.
Normally, this option should be enabled on all systems.
net.inet.ip.subnetsarelocal
Treat (1) or don’t treat (0) subnets as local addresses.
net.inet.ip.ttl
The maximum time-to-live (hop count) value for an IP packet
sourced by the system. This value applies to normal transport
protocols, not to ICMP.
net.inet.tcp.congctl.available
A string that lists the available TCP congestion-control algorithms.
net.inet.tcp.congctl.selected
A string that contains the name of the currently selected TCP
congestion-control algorithm.
net.inet.tcp.do_loopback_cksum
Compute (1) or don’t compute (0) checksums on loopback.
net.inet.tcp.keepcnt
The keepalive count.
net.inet.tcp.keepidle
The keepalive idle time, in milliseconds.
net.inet.tcp.keepintvl
The keepalive probe interval, in milliseconds.
net.inet.tcp.mssdflt
The default maximum segment size.
net.inet.tcp.recvspace
The default size of the receive buffer.
net.inet.tcp.sack.enable
Enable (1) or disable (0) RFC 2018 Selective ACKnowledgements.
net.inet.tcp.sack.globalmaxholes
The global maximum number of TCP SACK holes.
net.inet.tcp.sack.maxholes
The maximum number of TCP SACK holes allowed per connection.
net.inet.tcp.sendspace
The default size of the send buffer.
net.inet.tcp.slowhz (read only)
The units for tcp.keepidle and tcp.keepintvl; those
variables are in ticks of a clock that ticks tcp.slowhz times per
second. (That is, you must divide their values by the value of
tcp.slowhz to get times in seconds.)
net.inet.tcp.win_scale
RFC 1323 window scaling.
net.inet.udp.do_loopback_cksum
Compute (1) or don’t compute (0) checksums on loopback.
net.inet.udp.recvspace
The default size of the receive buffer.
net.inet.udp.sendspace
The default size of the send buffer.
net.inet6.ip6.forwarding
Disable (0) or enable (1) IP forwarding. If this is enabled, the host
acts as a router.
net.inet6.ip6.redirect
Allow (1) or disallow (0) send ICMP redirections when forwarding.
This option is ignored unless the host is routing IP packets.
Normally, this option should be enabled on all systems.
net.inet6.tcp6.do_loopback_cksum
Compute (1) or don’t compute (0) checksums on loopback.
net.inet6.tcp6.keepcnt
The keepalive count.
net.inet6.tcp6.keepidle
The keepalive idle time, in milliseconds.
net.inet6.tcp6.keepintvl
The keepalive probe interval, in milliseconds.
net.inet6.tcp6.recvspace
The default size of the receive buffer.
net.inet6.tcp6.sack.enable
Enable (1) or disable (0) RFC 2018 Selective ACKnowledgements.
net.inet6.tcp6.sack.globalholes (read only)
The global number of TCP SACK holes.
net.inet6.tcp6.sack.globalmaxholes
The global maximum number of TCP SACK holes.
net.inet6.tcp6.sack.maxholes
The maximum number of TCP SACK holes allowed per connection.
net.inet6.tcp6.sendspace
The default size of the send buffer.
net.inet6.tcp6.slowhz (read only)
The units for tcp.keepidle and tcp.keepintvl; those
variables are in ticks of a clock that ticks tcp.slowhz times per
second. (That is, you must divide their values by the value of
tcp.slowhz to get times in seconds.)
net.inet6.udp6.do_loopback_cksum
Compute (1) or don’t compute (0) checksums on loopback.
net.inet6.udp6.recvspace
The default size of the receive buffer.
net.inet6.udp6.sendspace
The default size of the send buffer.
Examples:
Check to see if the UDP checksum is enabled:
sysctl net.inet.udp.checksum
sysctl -w net.inet.ip.forwarding=1
See also:
arp, netstat
sysctl() in the Neutrino Library Reference
Syntax:
sysinfo [options]
Runs on:
QNX Neutrino, Microsoft Windows, Linux
Options:
-l Use logging mode (loops gathering data in a cycled mode).
-F dir Specify a target directory for output files. The default is /tmp.
-P priority Specify the priority at which to gather the data, in the range 0–254.
The default is 10.
Description:
The sysinfo script gathers system information based on the options you specify, and
then stores the output in a sysinfo.tar.gz file located in the target directory
specified by the -F option (the default is /tmp). QNX Technical Support might ask
you to use this script to gather information to help them solve a problem on your
system.
The sysinfo script offers a logging mode, which runs at the specified priority
(default 10) and logs general system information. It logs the files in a ring mode, such
that it keeps the last four entries, so that there is some system history for a problem
that’s being tracked. This is good for systems that are rebooting because of an error on
the system; a running log of what happened in the system last could give some hints as
to what went wrong.
Examples:
Fetch all system information that pertains to audio, graphics, and HID, and place it in
the default /tmp/sysinfo.tar.gz file:
sysinfo -a -g -h
See also:
qbinaudit, qconfig, QWinCfg, showlicense
Name:
/etc/syslog.conf
Description:
The /etc/syslog.conf file is the configuration file for the syslogd daemon. It
consists of lines with two fields:
Selector field The types of messages and priorities to which the line applies.
Action field The action to take if a message received by syslogd matches the
selection criteria.
Use one or more tab characters to separate the selector and action fields.
The selectors are encoded as a facility, a dot (.), and a level, with no intervening
whitespace. Both the facility and the level are case-insensitive.
The facility describes the part of the system generating the message, and is one of the
following keywords:
• auth
• authpriv
• cron
• daemon
• kern
• lpr
• mark
• news
• syslog
• user
• uucp
These keywords (with the exception of mark) correspond to the similar “LOG_”
values specified to the openlog() and syslog() routines.
The level describes the severity of the message, and is a keyword from the following
ordered (higher to lower) list:
• emerg
• alert
• crit
• err
• warning
• notice
• info
• debug
These keywords also correspond to the similar “LOG_” values specified to the
syslog() routine.
For further descriptions of both the facility and level keywords and their significance,
see syslog() in the Library Reference.
If a received message matches the specified facility and is of the specified (or higher)
level, then the action specified in the action field is taken.
You can specify multiple selectors for a single action by separating them with
semicolon (;) characters.
Note that each selector can modify the ones preceding it.
You can specify multiple facilities for a single level by separating them with comma
(,) characters.
You can use an asterisk (*) to specify all facilities or all levels.
The special facility mark receives a message at priority info every 20 minutes (see
syslogd).
The special level none disables a particular facility.
The action field of each line specifies the action to be taken when the selector field
selects a message. The action field can take these forms:
• a pathname (beginning with a leading slash) — the selected messages are appended
to the file
Blank lines and lines whose first nonblank character is a hash (#) character are
ignored.
Examples:
A configuration file might appear as follows:
Caveats:
The effects of multiple selectors aren’t always intuitive. For example,
mail.crit,*.err selects mail facility messages at the level of err or higher, not
at the level of crit or higher.
Logging messages to users isn’t currently implemented.
See also:
syslogd
openlog(), syslog() in the Library Reference
Syntax:
syslogd [-f config_file] [-m mark_interval]
[-t threads]
Runs on:
Neutrino
Options:
-f config_file Specify the pathname of an alternate configuration file (the
default is /etc/syslog.conf).
-t threads Set the maximum number of threads that syslogd should use
(the default is 15).
Description:
The syslogd daemon reads and logs messages to the system console, log files, and
other machines as specified by its configuration file.
The daemon reads its configuration file when it starts up and whenever it receives a
hangup signal. For information on the format of the configuration file, see
/etc/syslog.conf.
The messages sent to syslogd should consist of a single line, which may start with a
facility/priority (as defined in <syslog.h>) in angle brackets (e.g. "<5> hello"). If
the message doesn’t specify a priority, it defaults to LOG_USER|LOG_NOTICE
("<13>").
The syslog() API (and the logger utility, which uses syslog()) sends messages to
syslogd by opening and writing to /dev/log.
If a log message is submitted to /dev/log, the entry includes the string nto instead
of the local host name. If the log message is submitted via the socket interface, the
entry includes the host name. If the message is redirected from another syslogd on
another host, the entry includes the host name.
Files:
The syslogd daemon requires the following files:
/etc/syslog.conf
This configuration file contains the selection criteria and the
action to be taken if a message received by syslogd matches the
selection criteria.
/etc/services This file specifies the Internet domain socket port that syslogd
listens to.
Environment variables:
SYSLOG Used by clients to specify which node to look for syslogd.
See also:
logger, /etc/services, /etc/syslog.conf
syslog() in the Library Reference
Syntax:
tail [-number] [-fl] [-c number | -n number] [file]...
Runs on:
QNX Neutrino, Microsoft Windows
Options:
-number Deprecated; use -n number instead.
-f If the input file is a regular file (i.e. not a tty or FIFO), don’t terminate
after the last line of the input file has been copied, but enter a
continuous loop. The tail utility then sleeps for approximately one
second, then attempts to read and copy further bytes from the input file.
-l (“el”) Measure the quantity of output in lines; this is the default unit of
measure. Deprecated; use -n number instead.
file The pathname of an input file. If you don’t specify a file, the standard
input is used.
Description:
The tail utility copies its input files to the standard output, beginning at the point in
the files indicated by the -c or -n option. For both options, the number argument is a
decimal integer whose sign specifies the location in the file to begin copying:
If you don’t specify a -c or -n option, the default is -n 10 (i.e. the last ten lines of
the file).
If you use both -c and the deprecated -l option, the order of the options is important.
If you specify:
tail -l -c 5 my_file
tail -c 5 -l my_file
it copies 5 lines.
When tail is applied to a nonseekable file (e.g. a tty), tail must maintain an
internal buffer. This buffer is large enough to hold at least 10 lines of characters.
Examples:
You can use the -f option to monitor the growth of a file that is being written by a
process. For example, the command:
tail -f fred
prints the last ten lines of the file fred, followed by any lines that are appended to
fred between the time tail is initiated and terminated. As another example, the
command:
tail -f -c 15 fred
prints the last 15 bytes of the file fred, followed by any lines that are appended to
fred between the time tail is initiated and terminated.
Exit status:
0 Successful completion.
See also:
cat, head, less, more
Syntax:
Create a new archive:
Runs on:
QNX Neutrino, Microsoft Windows
Options:
-[0-7][lmh] Specify the drive and density.
-b blksize Specify the blocking factor for tape records. The default is 1; the
maximum is 20. This option should be used only with raw
magnetic tape archives. Normally, the block size is determined
automatically when reading tapes.
-F=file Run the given script at the end of each tape (implies -M).
-f file Specify the name of the archive to use instead of the default, which
is standard output. If you specify the dash character (-) as a
filename, tar writes to the standard output or reads from the
standard input, whichever is appropriate for the options given.
Thus, you can use tar as the head or tail of a pipeline.
-l (“el”) Report if all of the links to the files being archived cannot be
resolved. If this option isn’t specified, no error messages are
written to the standard output. This option is valid only with the
-c and -r options.
-N=date Store only the files that are newer than date.
-R Show the block number within the archive with each message.
-r Write named files to the end of the archive specified in the required
-f file option.
-T=name Get the names to extract or create from the file, name.
-u Append only files that are newer than the copy in the archive.
Description:
The tar utility reads and writes archive files. For more information, see the GNU
website at http://www.gnu.org/.
This utility is subject to the GNU Public License (GPL). We’ve included it for use on
development systems.
The GNU tar is incompatible with the current POSIX standard and with tar
programs that follow POSIX. For details, see the GNU documentation.
Examples:
Display a verbose listing of the archive members in dist.tar:
tar -tvf dist.tar
Copy the contents of the current directory to the floppy drive:
tar -cf /dev/fd0 .
Make an archive, backup.tar, of all the C source and header files in the current
directory:
tar -cvf backup.tar *.[ch]
Files:
The controlling terminal (/dev/tty) is used to prompt the user for information when
either or both the -i or -y options are specified.
Contributing author:
GNU
See also:
bzip2, cpio, gzip, pax
Backing Up and Recovering Data in the Neutrino User’s Guide
Syntax:
tcpdump [-AdDefKlLnNOpqRStuUvxX] [-c count] [-C file_size]
[-E spi@ipaddr algo:secret,...] [-F file] [-G rotate_seconds]
[-i interface] [-m module] [-M secret] [-r file]
[-s snaplen] [-T type] [-w file]
[-W filecount] [-y datalinktype] [-z postrotate-command]
[-Z user] [expression]
Runs on:
Neutrino
Options:
-A Print each packet (minus its link level header) in ASCII. Handy
for capturing web pages.
-C file_size Before writing a raw packet to a savefile, check whether the file
is currently larger than file_size and, if so, close the current
savefile and open a new one. Savefiles after the first savefile
will have the name specified with the -w option, with a number
after it, starting at 1 and continuing upward. The units of
file_size are millions of bytes (1,000,000 bytes, not 1,048,576
bytes).
-E spi@ipaddr algo:secret,...
Use spi@ipaddr algo:secret for decrypting IPsec ESP packets
that are addressed to addr and contain Security Parameter
Index value spi. You can specify additional combinations,
separating them with commas or newlines.
Setting the secret for IPv4 ESP packets isn’t currently supported.
-F file Use file as input for the filter expression. Any additional
expression given on the command line is ignored.
-G rotate_seconds If specified, rotates the dump file specified with the -w option
every rotate_seconds seconds. Savefiles have the name
specified by -w, which should include a time format as defined
by strftime(). If no time format is specified, each new file
overwrites the previous.
If used in conjunction with the -C option, file names take the
form file<count>.
-L List the known data link types for the interface, and then exit.
-m module Load SMI MIB module definitions from file module. You can
use this option several times to load several MIB modules into
tcpdump.
-M secret Use secret as a shared secret for validating the digests found in
TCP segments with the TCP-MD5 option (RFC 2385), if
present.
-n Don’t convert addresses (i.e., host addresses, port numbers,
etc.) into names.
-N Don’t print domain name qualification of host names. For
example, if you give this option, tcpdump prints nic instead
of nic.ddn.mil.
-O (“Oh”) Don’t run the packet-matching code optimizer. This is
useful only if you suspect a bug in the optimizer.
-p Don’t put the interface into promiscuous mode. Note that the
interface might be in promiscuous mode for some other reason;
hence, you can’t use -p as an abbreviation for ether host
{local-hw-addr} or ether broadcast.
-r file Read packets from file (which was created with the -w option).
If file is -, tcpdump uses standard input.
-s snaplen Snarf snaplen bytes of data from each packet rather than the
default of 68 (with SunOS’s NIT, the minimum is actually 96).
68 bytes is adequate for IP, ICMP, TCP and UDP, but may
truncate protocol information from name server and NFS
packets (see below).
Packets truncated because of a limited snapshot are indicated
in the output with [|proto], where proto is the name of the
protocol level at which the truncation has occurred.
Taking larger snapshots both increases the amount of time it takes to process packets
and, effectively, decreases the amount of packet buffering. This may cause packets to
be lost. You should limit snaplen to the smallest number that will capture the protocol
information you’re interested in. If you set snaplen to 0, tcpdump uses the required
length to catch whole packets.
-vv Even more verbose output. For example, additional fields are
printed from NFS reply packets, and SMB packets are fully
decoded.
-w file Write the raw packets to file rather than parsing and printing
them. You can print them with the -r option. If file is -,
tcpdump uses standard output.
The tcpdump utility runs the command in parallel with the capture, using the lowest
priority so that this doesn’t disturb the capture process.
If you want to use a command that itself takes options or
different arguments, write a shell script that takes the savefile
name as the only argument, arrange the options and arguments
as required, and then execute the command that you want.
-Z user Drop privileges (if root) and change the user ID to user and
the group ID to the primary group of user. You can also enable
this behavior by default at compile time.
Description:
The tcpdump utility prints a description of the contents of packets on a network
interface that match the boolean expression. You can also run it with the -w option,
which causes it to save the packet data to a file for later analysis, and/or with the -r
option, which causes it to read from a saved packet file rather than to read packets
from a network interface. In all cases, tcpdump processes only those packets that
match expression.
For information about the expression argument, see “Expressions,” below.
The tcpdump utility, if not run with the -c option, continues capturing packets until
it’s interrupted by a SIGINT signal (generated, for example, by typing your interrupt
character, typically Control-C) or a SIGTERM signal (typically generated with the
kill command); if run with the -c option, tcpdump captures packets until it’s
interrupted by a SIGINT or SIGTERM signal, or the specified number of packets have
been processed.
When tcpdump finishes capturing packets, it reports counts of:
• packets “captured” — the number of packets that tcpdump has received and
processed.
• packets “received by filter” — the number of packets handed to the filter, not
packets that passed the filter. This includes packets later dropped because there
wasn’t enough buffer space.
• packets “dropped by kernel” — the number of packets that were dropped, due to a
lack of buffer space, by the packet-capture mechanism.
Reading packets from a network interface may require that you have special privileges:
Expressions
The expression on the command line selects which packets to dump. If no expression
is given, all packets on the net will be dumped. Otherwise, only packets for which
expression is true are dumped.
The expression consists of one or more primitives that usually consist of an ID (name
or number) preceded by one or more qualifiers. The different kinds of qualifier are:
type The kind of thing the ID name or number refers to. Possible types are host,
net, port, and portrange. For example, host xyz, net 128.3, port
20, and portrange 6000-6008. If there’s no type qualifier, tcpdump
uses host.
dir A particular transfer direction to and/or from the ID. Possible directions are
src, dst, src or dst, and src and dst. For example, src xyz, dst
net 128.3, src or dst port ftp-data. If there is no dir qualifier,
src or dst is assumed.
For some link layers, such as SLIP and the “cooked” Linux capture mode
used for the any device and for some other device types, you can use the
inbound and outbound qualifiers to specify a desired direction.
proto Restrict the match to a particular protocol. Possible protocols are ether,
fddi, tr, wlan, ip, ip6, arp, rarp, decnet, tcp, and udp. For example,
ether src xyz, arp net 128.3, tcp port 21, and udp portrange
7000-7009.
If there’s no proto qualifier, all protocols consistent with the type are
assumed. For example, src xyz means (ip or arp or rarp) src
xyz (except the latter isn’t legal syntax), net abc means (ip or arp or
rarp) net abc, and port 53 means (tcp or udp) port 53.
The fddi protocol is actually an alias for ether; the parser treats them
identically as meaning “the data link level used on the specified network
In addition to the above, there are some special “primitive” keywords that don’t follow
the pattern:
• gateway
• broadcast
• less
• greater
dst host host True if the IPv4/v6 destination field of the packet is host,
which may be either an address or a name.
src host host True if the IPv4/v6 source field of the packet is host.
host host True if either the IPv4/v6 source or destination of the packet is
host.
You can prepend any of the above host expressions with the
keywords ip, arp, rarp, or ip6 as in:
ip host host
ether dst ehost True if the Ethernet destination address is ehost. The ehost
may be either a name from /etc/ethers or a number (see
ethers(3N) for numeric format).
ether host ehost True if either the Ethernet source or destination address is
ehost.
gateway host True if the packet used host as a gateway. That is, the Ethernet
source or destination address was host, but neither the IP
source nor the IP destination was host. The host must be a
name and must be found both by the machine’s
host-name-to-IP-address resolution mechanisms (host name
file, DNS, NIS, etc.) and by the machine’s
host-name-to-Ethernet-address resolution mechanism
(/etc/ethers, etc.). (An equivalent expression is:
dst net net True if the IPv4/v6 destination address of the packet has a
network number of net. The net may be either a name from the
networks database (/etc/networks, etc.) or a network number.
An IPv4 network number can be written as a dotted quad (e.g.,
192.168.1.0), dotted triple (e.g., 192.168.1), dotted pair
(e.g, 172.16), or single number (e.g., 10); the netmask is
255.255.255.255 for a dotted quad (which means that it’s
really a host match), 255.255.255.0 for a dotted triple,
255.255.0.0 for a dotted pair, or 255.0.0.0 for a single
number.
An IPv6 network number must be written out fully; the
netmask is ff:ff:ff:ff:ff:ff:ff:ff, so IPv6 “network”
matches are really always host matches, and a network match
requires a netmask length.
src net net True if the IPv4/v6 source address of the packet has a network
number of net.
net net True if either the IPv4/v6 source or destination address of the
packet has a network number of net.
net net/len True if the IPv4/v6 address matches net with a netmask len bits
wide. May be qualified with src or dst.
dst port port True if the packet is ip/tcp, ip/udp, ip6/tcp, or ip6/udp, and has
a destination port value of port. The port can be a number or a
name used in /etc/services. (see tcp(4P) and udp(4P)).
If you use a name, both the port number and protocol are
checked. If you use a number or ambiguous name, only the
port number is checked (e.g., dst port 513 will print both
tcp/login traffic and udp/who traffic, and port domain will
print both tcp/domain and udp/domain traffic).
src port port True if the packet has a source port value of port.
port port True if either the source or destination port of the packet is
port.
dst portrange port1-port2
True if the packet is ip/tcp, ip/udp, ip6/tcp or ip6/udp and has a
destination port value between port1 and port2. The port1 and
port2 are interpreted in the same fashion as the port parameter
for port.
src portrange port1-port2
True if the packet has a source port value between port1 and
port2.
portrange port1-port2
True if either the source or destination port of the packet is
between port1 and port2.
You can prepend any of the above port or port range
expressions with the keywords tcp or udp, as in:
less length True if the packet has a length less than or equal to length.
This is equivalent to:
greater length True if the packet has a length greater than or equal to length.
This is equivalent to:
ip proto protocol True if the packet is an IPv4 packet (see ip(4P)) of protocol
type protocol. The protocol can be a number, or one of the
names icmp, icmp6, igmp, igrp, pim, ah, esp, vrrp, udp,
or tcp.
The identifiers tcp, udp, and icmp are also keywords and must be escaped via
backslash (\), which is \\ in the C shell. This primitive doesn’t chase the protocol
header chain.
ip6 proto protocol True if the packet is an IPv6 packet of protocol type protocol.
Note that this primitive doesn’t chase the protocol header
chain.
ip6 protochain protocol
True if the packet is IPv6 packet, and contains a protocol
header with the type protocol in its protocol header chain. For
example
ip6 protochain 6
ether broadcast True if the packet is an Ethernet broadcast packet. The ether
keyword is optional.
ether multicast True if the packet is an Ethernet multicast packet. The ether
keyword is optional. This is shorthand for ether[0] & 1 !=
0.
decnet src host True if the DECNET source address is host, which is in the
form 10.123.
decnet host host True if either the DECNET source or destination address is
host.
ifname interface True if the packet was logged as coming from the specified
interface (applies only to packets logged by OpenBSD’s pf).
rnr num True if the packet was logged as matching the specified PF rule
number (applies only to packets logged by OpenBSD’s pf).
reason code True if the packet was logged with the specified PF reason
code. The known codes are: match, bad-offset,
fragment, short, normalize, and memory (applies only to
packets logged by OpenBSD’s pf).
rset name True if the packet was logged as matching the specified PF
ruleset name of an anchored ruleset (applies only to packets
logged by pf).
srnr num True if the packet was logged as matching the specified PF rule
number of an anchored ruleset (applies only to packets logged
by pf).
action act True if PF took the specified action when the packet was
logged. Known actions are pass and block (applies only to
packets logged by OpenBSD’s pf).
ip, ip6, arp, rarp, atalk, aarp, decnet, iso, stp, ipx, netbeui
Abbreviations for:
ether proto p
type wlan_type True if the IEEE 802.11 frame type matches the specified
wlan_type. Valid wlan_types are: mgt, ctl, and data.
type wlan_type subtype wlan_subtype
True if the IEEE 802.11 frame type matches the specified
wlan_type, and frame subtype matches the specified
wlan_subtype.
If the specified wlan_type is mgt, then valid wlan_subtypes
are assoc-req, assoc-resp, reassoc-req,
reassoc-resp, probe-req, probe-resp, beacon, atim,
disassoc, auth, and deauth.
If the specified wlan_type is ctl, then valid wlan_subtypes
are ps-poll, rts, cts, ack, cf-end, and cf-end-ack.
If the specified wlan_type is data, then valid wlan_subtypes
are data, data-cf-ack, data-cf-poll,
data-cf-ack-poll, null, cf-ack, cf-poll,
cf-ack-poll, qos-data, qos-data-cf-ack,
qos-data-cf-poll, qos-data-cf-ack-poll, qos,
qos-cf-poll, and qos-cf-ack-poll.
subtype wlan_subtype
True if the IEEE 802.11 frame subtype matches the specified
wlan_subtype, and frame has the type to which the specified
wlan_subtype belongs.
The first vlan keyword encountered in expression changes the decoding offsets for
the remainder of expression on the assumption that the packet is a VLAN packet. You
can use the vlan[vlan_id] expression more than once, to filter on VLAN hierarchies.
Each use of that expression increments the filter offsets by 4.
For example:
vlan 100 && vlan 200
The first mpls keyword encountered in expression changes the decoding offsets for
the remainder of expression on the assumption that the packet is a MPLS-encapsulated
IP packet. You can use the mpls [label_num] expression more than once, to filter on
MPLS hierarchies. Each use of that expression increments the filter offsets by 4.
For example:
mpls 100000 && mpls 1024
The first pppoes keyword encountered in expression changes the decoding offsets for
the remainder of expression on the assumption that the packet is a PPPoE session
packet.
For example:
pppoes && ip
iso proto protocol True if the packet is an OSI packet of protocol type protocol.
The Protocol can be a number, or one of the names clnp,
esis, or isis.
The first lane keyword encountered in expression changes the tests done in the
remainder of expression on the assumption that the packet is either a LANE emulated
Ethernet packet or a LANE LE Control packet. If lane isn’t specified, the tests are
done under the assumption that the packet is an LLC-encapsulated packet.
expr relop expr True if the relation holds, where relop is one of >, <, >=, <=, =,
or !=, and expr is an arithmetic expression composed of
integer constants (expressed in standard C syntax), the normal
binary operators (+, -, *, /, &, |, <<, >>), a length operator,
and special packet data accessors. Note that all comparisons
are unsigned, so that, for example, 0x80000000 and
0xffffffff are greater than 0. To access data inside the
packet, use the following syntax:
proto [expr : size ]
where proto is one of ether, fddi, tr, wlan, ppp, slip,
link, ip, arp, rarp, tcp, udp, icmp, ip6, or radio, and
indicates the protocol layer for the index operation (ether,
fddi, wlan, tr, ppp, slip, and link all refer to the link
layer; radio refers to the “radio header” added to some
802.11 captures).
The tcp, udp, and other upper-layer protocol types apply only to IPv4, not IPv6 (this
will be fixed in the future).
The byte offset, relative to the indicated protocol layer, is given
by expr. The size is optional and indicates the number of bytes
in the field of interest; it can be one, two, or four, and defaults
to one. The length operator, indicated by the keyword len,
gives the length of the packet.
For example, ether[0] & 1 != 0 catches all multicast
traffic. The expression ip[0] & 0xf != 5 catches all IPv4
packets with options. The expression ip[6:2] & 0x1fff =
0 catches only unfragmented IPv4 datagrams and frag zero of
fragmented IPv4 datagrams. This check is implicitly applied to
the tcp and udp index operations. For instance, tcp[0]
always means the first byte of the TCP header, and never
means the first byte of an intervening fragment.
Some offsets and field values may be expressed as names
rather than as numeric values. The following protocol header
field offsets are available: icmptype (ICMP type field),
icmpcode (ICMP code field), and tcpflags (TCP flags
field).
The following ICMP type field values are available:
icmp-echoreply, icmp-unreach, icmp-sourcequench,
icmp-redirect, icmp-echo, icmp-routeradvert,
icmp-routersolicit, icmp-timxceed,
icmp-paramprob, icmp-tstamp, icmp-tstampreply,
icmp-ireq, icmp-ireqreply, icmp-maskreq, and
icmp-maskreply.
The following TCP flags field values are available: tcp-fin,
tcp-syn, tcp-rst, tcp-push, tcp-ack, tcp-urg.
• negation: ! or not
• alternation: || or or
is short for:
Output format
The output of tcpdump is protocol-dependent. The following gives a brief description
and examples of most of the formats.
Link-level headers
If you specify the -e option, the link-level header is printed out. On Ethernets, the
source and destination addresses, protocol, and packet length are printed.
On FDDI networks, the -e option causes tcpdump to print the frame-control field, the
source and destination addresses, and the packet length. The frame-control field
governs the interpretation of the rest of the packet. Normal packets (such as those
containing IP datagrams) are “async” packets, with a priority value between 0 and 7;
for example, async4. Such packets are assumed to contain an 802.2 Logical Link
Control (LLC) packet; the LLC header is printed if it is not an ISO datagram or a
so-called SNAP packet.
On Token Ring networks, the -e option causes tcpdump to print the access-control
and frame-control fields, the source and destination addresses, and the packet length.
As on FDDI networks, packets are assumed to contain an LLC packet. Regardless of
whether the -e option is specified or not, the source routing information is printed for
source-routed packets.
On 802.11 networks, the -e option causes tcpdump to print the frame-control fields,
all of the addresses in the 802.11 header, and the packet length. As on FDDI networks,
packets are assumed to contain an LLC packet.
The following description assumes familiarity with the SLIP compression algorithm
described in RFC 1144.
On SLIP links, a direction indicator (I for inbound, O for outbound), packet type, and
compression information are printed out. The packet type is printed first. The three
types are ip, utcp, and ctcp. No further link information is printed for ip packets.
For TCP packets, the connection identifier is printed following the type. If the packet
is compressed, its encoded header is printed out. The special cases are printed out as
*S+n and *SA+n, where n is the amount by which the sequence number (or sequence
number and ack) has changed. If it isn’t a special case, zero or more changes are
printed. A change is indicated by U (urgent pointer), W (window), A (ack), S
(sequence number), and I (packet ID), followed by a delta (+n or -n), or a new value
(=n). Finally, the amount of data in the packet and compressed header length are
printed.
For example, the following line shows an outbound compressed TCP packet, with an
implicit connection identifier; the ack has changed by 6, the sequence number by 49,
and the packet ID by 6; there are 3 bytes of data and 6 bytes of compressed header:
O ctcp * A+6 S+49 I+6 3 (6)
ARP/RARP packets
Arp/rarp output shows the type of request and its arguments. The format is intended to
be self-explanatory. Here is a short sample taken from the start of an rlogin from
host rtsg to host csam:
arp who-has csam tell rtsg
arp reply csam is-at CSAM
The first line says that rtsg sent an arp packet asking for the Ethernet address of
Internet host csam. Csam replies with its Ethernet address (in this example, Ethernet
addresses are in uppercase, and Internet addresses are in lowercase).
This would look less redundant if we had done tcpdump -n:
arp who-has 128.3.254.6 tell 128.3.254.68
arp reply 128.3.254.6 is-at 02:07:01:00:01:c4
If we had done tcpdump -e, the fact that the first packet is broadcast and the second is
point-to-point would be visible:
RTSG Broadcast 0806 64: arp who-has csam tell rtsg
CSAM RTSG 0806 64: arp reply csam is-at CSAM
For the first packet this says the Ethernet source address is RTSG, the destination is the
Ethernet broadcast address, the type field contained hexadecimal 0806 (type
ETHER_ARP) and the total length was 64 bytes.
TCP Packets
The following description assumes familiarity with the TCP protocol described in
RFC 793. If you aren’t familiar with the protocol, neither this description nor
tcpdump will be of much use to you.
Src and dst are the source and destination IP addresses and ports. Flags are some
combination of S (SYN), F (FIN), P (PUSH), R (RST), W (ECN CWR) or E
(ECN-Echo), or a single . (no flags). Data-seqno describes the portion of sequence
space covered by the data in this packet (see example below). Ack is sequence number
of the next data expected the other direction on this connection. Window is the number
of bytes of receive buffer space available the other direction on this connection. Urg
indicates there is urgent data in the packet. Options are tcp options enclosed in angle
brackets (e.g., <mss 1024>).
The src, dst, and flags are always present. The other fields depend on the contents of
the packet’s tcp protocol header and are output only if appropriate.
Here’s the opening portion of an rlogin from host rtsg to host csam:
rtsg.1023 > csam.login: S 768512:768512(0) win 4096 <mss 1024>
csam.login > rtsg.1023: S 947648:947648(0) ack 768513 win 4096 <mss 1024>
rtsg.1023 > csam.login: . ack 1 win 4096
rtsg.1023 > csam.login: P 1:2(1) ack 1 win 4096
csam.login > rtsg.1023: . ack 2 win 4096
rtsg.1023 > csam.login: P 2:21(19) ack 1 win 4096
csam.login > rtsg.1023: P 1:2(1) ack 21 win 4077
csam.login > rtsg.1023: P 2:3(1) ack 21 win 4077 urg 1
csam.login > rtsg.1023: P 3:4(1) ack 21 win 4077 urg 1
The first line says that tcp port 1023 on rtsg sent a packet to port login on csam. The
S indicates that the SYN flag was set. The packet sequence number was 768512 and it
contained no data. (The notation is first:last(nbytes), which means “sequence numbers
first up to but not including last which is nbytes bytes of user data.”) There was no
piggy-backed ack, the available receive window was 4096 bytes and there was a
max-segment-size option requesting an mss of 1024 bytes.
Csam replies with a similar packet except it includes a piggy-backed ack for rtsg’s
SYN. Rtsg then acks csam’s SYN. The . means no flags were set. The packet
contained no data so there is no data sequence number. Note that the ack sequence
number is a small integer (1). The first time tcpdump sees a TCP “conversation”, it
prints the sequence number from the packet. On subsequent packets of the
conversation, the difference between the current packet’s sequence number and this
initial sequence number is printed. This means that sequence numbers after the first
can be interpreted as relative byte positions in the conversation’s data stream (with the
first data byte each direction being 1). The -S option overrides this feature, causing
the original sequence numbers to be output.
On the sixth line, rtsg sends csam 19 bytes of data (bytes 2 through 20 in the rtsg ->
csam side of the conversation). The PUSH flag is set in the packet. On the seventh
line, csam says it’s received data sent by rtsg up to but not including byte 21. Most of
this data is apparently sitting in the socket buffer since csam’s receive window has
gotten 19 bytes smaller. Csam also sends one byte of data to rtsg in this packet. On the
eighth and ninth lines, csam sends two bytes of urgent, pushed data to rtsg.
If the snapshot was small enough that tcpdump didn’t capture the full TCP header, it
interprets as much of the header as it can and then reports “[|tcp]” to indicate the
remainder couldn’t be interpreted. If the header contains a bogus option (one with a
length that’s either too small or beyond the end of the header), tcpdump reports it as
“[bad opt]” and doesn’t interpret any further options (since it’s impossible to tell
where they start). If the header length indicates options are present but the IP datagram
length isn’t long enough for the options to actually be there, tcpdump reports it as
“[bad hdr length]”.
Capturing TCP packets with particular flag combinations (SYN-ACK, URG-ACK, etc.)
There are 8 bits in the control bits section of the TCP header:
CWR | ECE | URG | ACK | PSH | RST | SYN | FIN
Let’s assume that we want to watch packets used in establishing a TCP connection.
Recall that TCP uses a 3-way handshake protocol when it initializes a new connection;
the connection sequence with regard to the TCP control bits is
Now we’re interested in capturing packets that have only the SYN bit set (Step 1).
Note that we don’t want packets from step 2 (SYN-ACK), just a plain initial SYN.
What we need is a correct filter expression for tcpdump.
Recall the structure of a TCP header without options:
0 15 31
-----------------------------------------------------------------
| source port | destination port |
-----------------------------------------------------------------
| sequence number |
-----------------------------------------------------------------
| acknowledgment number |
-----------------------------------------------------------------
| HL | rsvd |C|E|U|A|P|R|S|F| window size |
-----------------------------------------------------------------
| TCP checksum | urgent pointer |
-----------------------------------------------------------------
A TCP header usually holds 20 octets of data, unless options are present. The first line
of the graph contains octets 0 - 3, the second line shows octets 4 - 7 etc.
Starting to count with 0, the relevant TCP control bits are contained in octet 13:
0 7| 15| 23| 31
----------------|---------------|---------------|----------------
| HL | rsvd |C|E|U|A|P|R|S|F| window size |
----------------|---------------|---------------|----------------
| | 13th octet | | |
| |
|---------------|
|C|E|U|A|P|R|S|F|
|---------------|
|7 5 3 0|
These are the TCP control bits we’re interested in. We have numbered the bits in this
octet from 0 to 7, right to left, so the PSH bit is bit number 3, while the URG bit is
number 5.
Recall that we want to capture packets with only SYN set. Let’s see what happens to
octet 13 if a TCP datagram arrives with the SYN bit set in its header:
|C|E|U|A|P|R|S|F|
|---------------|
|0 0 0 0 0 0 1 0|
|---------------|
|7 6 5 4 3 2 1 0|
Looking at the control bits section, we see that only bit number 1 (SYN) is set.
Assuming that octet number 13 is an 8-bit unsigned integer in network byte order, the
binary value of this octet is 00000010, and its decimal representation is:
7 6 5 4 3 2 1 0
0*2 + 0*2 + 0*2 + 0*2 + 0*2 + 0*2 + 1*2 + 0*2 = 2
We’re almost done, because now we know that if only SYN is set, the value of the
thirteenth octet in the TCP header, when interpreted as a 8-bit unsigned integer in
network byte order, must be exactly 2.
This relationship can be expressed as:
tcp[13] == 2
We can use this expression as the filter for tcpdump in order to watch packets which
have only SYN set:
The expression says “let the thirteenth octet of a TCP datagram have the decimal value
2”, which is exactly what we want.
Now, let’s assume that we need to capture SYN packets, but we don’t care if ACK or
any other TCP control bit is set at the same time. Let’s see what happens to octet 13
when a TCP datagram with SYN-ACK set arrives:
|C|E|U|A|P|R|S|F|
|---------------|
|0 0 0 1 0 0 1 0|
|---------------|
|7 6 5 4 3 2 1 0|
Now bits 1 and 4 are set in the thirteenth octet. The binary value of octet 13 is
00010010, which translates to decimal:
7 6 5 4 3 2 1 0
0*2 + 0*2 + 0*2 + 1*2 + 0*2 + 0*2 + 1*2 + 0*2 = 18
Now we can’t just use ’tcp[13] == 18’ in the tcpdump filter expression, because that
would select only those packets that have SYN-ACK set, but not those with only SYN
set. Remember that we don’t care if ACK or any other control bit is set as long as
SYN is set.
In order to achieve our goal, we need to logically AND the binary value of octet 13
with some other value to preserve the SYN bit. We know that we want SYN to be set
in any case, so we’ll logically AND the value in the thirteenth octet with the binary
value of a SYN:
We see that this AND operation delivers the same result regardless whether ACK or
another TCP control bit is set. The decimal representation of the AND value as well as
the result of this operation is 2 (binary 00000010), so we know that for packets with
SYN set the following relation must hold true:
Note that you should use single quotes or a backslash in the expression to hide the
AND (’&’) special character from the shell.
UDP Packets
This says that port who on host actinide sent a udp datagram to port who on host
broadcast, the Internet broadcast address. The packet contained 84 bytes of user data.
Some UDP services are recognized (from the source or destination port number) and
the higher level protocol information printed. In particular, Domain Name service
requests (RFCs 1034 and 1035) and Sun RPC calls (RFC 1050) to NFS.
The following description assumes familiarity with the Domain Service protocol
described in RFC 1035.
Host h2opolo asked the domain server on helios for an address record (qtype=A)
associated with the name ucbvax.berkeley.edu. The query ID was 3. The + indicates
the recursion desired flag was set. The query length was 37 bytes, not including the
UDP and IP protocol headers. The query operation was the normal one, Query, so the
op field was omitted. If the op had been anything else, it would have been printed
between the 3 and the +. Similarly, the qclass was the normal one, C_IN, and omitted.
Any other qclass would have been printed immediately after the A.
A few anomalies are checked and may result in extra fields enclosed in square
brackets: If a query contains an answer, authority records or additional records
section, ancount, nscount, or arcount are printed as [na], [nn], or [nau], where n is
the appropriate count. If any of the response bits are set (AA, RA or rcode) or any of
the “must be zero” bits are set in bytes two and three, [b2&3=x] is printed, where x is
the hexadecimal value of header bytes two and three.
In the first example, helios responds to query ID 3 from h2opolo with 3 answer
records, 3 name server records and 7 additional records. The first answer record is
type A (address) and its data is Internet address 128.32.137.3. The total size of the
response was 273 bytes, excluding UDP and IP headers. The op (Query) and response
code (NoError) were omitted, as was the class (C_IN) of the A record.
In the second example, helios responds to query 2 with a response code of
non-existent domain (NXDomain) with no answers, one name server and no authority
records. The * indicates that the authoritative answer bit was set. Since there were no
answers, no type, class or data were printed.
Other flag characters that might appear are - (recursion available, RA, not set) and |
(truncated message, TC, set). If the question section doesn’t contain exactly one entry,
[nq] is printed.
Note that name server requests and responses tend to be large and the default snaplen
of 68 bytes may not capture enough of the packet to print. Use the -s flag to increase
the snaplen if you need to seriously investigate name server traffic. For example, -s
128.
SMB/CIFS decoding
Sun NFS (Network File System) requests and replies are printed as:
For example:
In the first line, host sushi sends a transaction with ID 6709 to wrl (note that the
number following the source host is a transaction ID, not the source port). The request
was 112 bytes, excluding the UDP and IP headers. The operation was a readlink
(read symbolic link) on file handle (fh) 21,24/10.731657119. (If you’re lucky, as in
this case, the file handle can be interpreted as a major, minor device number pair,
followed by the inode number and generation number.) The wrl host replies ok with
the contents of the link.
In the third line, sushi asks wrl to look up the name xcolors in directory file
9,74/4096.6878. Note that the data printed depends on the operation type. The format
is intended to be self explanatory if read in conjunction with an NFS protocol spec.
If you specify the -v (verbose) option, additional information is printed. For example:
(The -v optioin also prints the IP header TTL, ID, length, and fragmentation fields,
which have been omitted from this example.) In the first line, sushi asks wrl to read
8192 bytes from file 21,11/12.195, at byte offset 24576. The wrl host replies ok; the
packet shown on the second line is the first fragment of the reply, and hence is only
1472 bytes long (the other bytes will follow in subsequent fragments, but these
fragments don’t have NFS or even UDP headers and so might not be printed,
depending on the filter expression used). Because the -v flag is given, some of the file
attributes (which are returned in addition to the file data) are printed: the file type
(“REG”, for regular file), the file mode (in octal), the uid and gid, and the file size.
If you specify more than one -v option, even more details are printed.
Note that NFS requests are very large and much of the detail won’t be printed unless
snaplen is increased. Try using -s 192 to watch NFS traffic.
NFS reply packets don’t explicitly identify the RPC operation. Instead, tcpdump
keeps track of “recent” requests, and matches them to the replies using the transaction
ID. If a reply doesn’t closely follow the corresponding request, it might not be
parsable.
Transarc AFS (Andrew File System) requests and replies are printed as:
src.sport > dst.dport: rx packet-type
src.sport > dst.dport: rx packet-type service call call-name args
src.sport > dst.dport: rx packet-type service reply call-name args
In the first line, host elvis sends a RX packet to pike. This was a RX data packet to the
fs (fileserver) service, and is the start of an RPC call. The RPC call was a rename, with
the old directory file ID of 536876964/1/1 and an old filename of .newsrc.new, and
a new directory file ID of 536876964/1/1 and a new filename of .newsrc. The host
pike responds with a RPC reply to the rename call (which was successful, because it
was a data packet and not an abort packet).
In general, all AFS RPCs are decoded at least by RPC call name. Most AFS RPCs
have at least some of the arguments decoded (generally only the “interesting”
arguments, for some definition of interesting).
The format is intended to be self-describing, but it will probably not be useful to
people who aren’t familiar with the workings of AFS and RX.
If the -v (verbose) flag is given twice, acknowledgment packets and additional header
information is printed, such as the the RX call ID, call number, sequence number,
serial number, and the RX packet flags.
If the -v flag is given twice, additional information is printed, such as the the RX call
ID, serial number, and the RX packet flags. The MTU negotiation information is also
printed from RX ack packets.
If you specify the -v option three times, the security index and service ID are printed.
Error codes are printed for abort packets, with the exception of Ubik beacon packets
(because abort packets are used to signify a yes vote for the Ubik protocol).
Note that AFS requests are very large and many of the arguments won’t be printed
unless snaplen is increased. Try using -s 256 to watch AFS traffic.
AFS reply packets don’t explicitly identify the RPC operation. Instead, tcpdump
keeps track of “recent” requests, and matches them to the replies using the call number
and service ID. If a reply doesn’t closely follow the corresponding request, it might
not be parsable.
1.254 ether
16.1 icsd-net
1.254.110 ace
The first two lines give the names of AppleTalk networks. The third line gives the
name of a particular host. (A host is distinguished from a net by the third octet in the
number; a net number must have two octets and a host number must have three octets.)
The number and name should be separated by whitespace (blanks or tabs). The
/etc/atalk.names file may contain blank lines or comment lines (lines starting
with a #).
AppleTalk addresses are printed in the form:
net.host.port
(If the /etc/atalk.names doesn’t exist or doesn’t contain an entry for some AppleTalk
host/net number, addresses are printed in numeric form.) In the first example, NBP
(DDP port 2) on net 144.1 node 209 is sending to whatever is listening on port 220 of
net icsd node 112. The second line is the same except the full name of the source node
is known (office). The third line is a send from port 235 on net jssmag node 149 to
broadcast on the icsd-net NBP port (note that the broadcast address (255) is indicated
by a net name with no host number; for this reason it’s a good idea to keep node names
and net names distinct in /etc/atalk.names).
NBP (name binding protocol) and ATP (AppleTalk transaction protocol) packets have
their contents interpreted. Other protocols just dump the protocol name (or number if
no name is registered for the protocol) and packet size.
NBP packets are formatted like the following examples:
icsd-net.112.220 > jssmag.2: nbp-lkup 190: ‘‘=:LaserWriter@*’’
jssmag.209.2 > icsd-net.112.220: nbp-reply 190: ‘‘RM1140:LaserWriter@*’’ 250
techpit.2 > icsd-net.112.220: nbp-reply 190: ‘‘techpit:LaserWriter@*’’ 186
The first line is a name-lookup request for laserwriters sent by net icsd host 112 and
broadcast on net jssmag. The nbp ID for the lookup is 190. The second line shows a
reply for this request (note that it has the same id) from host jssmag.209 saying that
it has a laserwriter resource named RM1140 registered on port 250. The third line is
another reply to the same request saying host techpit has laserwriter techpit
registered on port 186.
ATP packet formatting is demonstrated by the following example:
jssmag.209.165 > helios.132: atp-req 12266<0-7> 0xae030001
helios.132 > jssmag.209.165: atp-resp 12266:0 (512) 0xae040000
helios.132 > jssmag.209.165: atp-resp 12266:1 (512) 0xae040000
helios.132 > jssmag.209.165: atp-resp 12266:2 (512) 0xae040000
helios.132 > jssmag.209.165: atp-resp 12266:3 (512) 0xae040000
helios.132 > jssmag.209.165: atp-resp 12266:4 (512) 0xae040000
helios.132 > jssmag.209.165: atp-resp 12266:5 (512) 0xae040000
helios.132 > jssmag.209.165: atp-resp 12266:6 (512) 0xae040000
helios.132 > jssmag.209.165: atp-resp*12266:7 (512) 0xae040000
jssmag.209.165 > helios.132: atp-req 12266<3,5> 0xae030001
The jssmag.209 host initiates transaction ID 12266 with host helios by requesting
up to 8 packets (the <0-7>). The hexadecimal number at the end of the line is the
value of the userdata field in the request.
The helios host responds with 8 512-byte packets. The :digit following the
transaction ID gives the packet sequence number in the transaction and the number in
parentheses is the amount of data in the packet, excluding the ATP header. The * on
packet 7 indicates that the EOM bit was set.
The jssmag.209 host then requests that packets 3 and 5 be retransmitted; helios
resends them, and then jssmag.209 releases the transaction. Finally, jssmag.209
initiates the next request. The * on the request indicates that XO (“exactly once”)
wasn’t set.
IP Fragmentation
(frag id:size@offset+)
(frag id:size@offset)
The first form indicates there are more fragments. The second indicates this is the last
fragment.
Id is the fragment id. Size is the fragment size (in bytes) excluding the IP header.
Offset is this fragment’s offset (in bytes) in the original datagram.
The fragment information is output for each fragment. The first fragment contains the
higher level protocol header and the frag info is printed after the protocol info.
Fragments after the first contain no higher level protocol header and the frag info is
printed after the source and destination addresses. For example, here is part of an ftp
from arizona.edu to lbl-rtsg.arpa over a CSNET connection that doesn’t appear to
handle 576 byte datagrams:
arizona.ftp-data > rtsg.1170: . 1024:1332(308) ack 1 win 4096 (frag 595a:328@0+)
arizona > rtsg: (frag 595a:204@328)
rtsg.1170 > arizona.ftp-data: . ack 1536 win 2560
There are a couple of things to note here: First, addresses in the second line don’t
include port numbers. This is because the TCP protocol information is all in the first
fragment and we have no idea what the port or sequence numbers are when we print
the later fragments. Second, the tcp sequence information in the first line is printed as
if there were 308 bytes of user data when, in fact, there are 512 bytes (308 in the first
frag and 204 in the second). If you are looking for holes in the sequence space or
trying to match up acks with packets, this can fool you.
A packet with the IP don’t fragment flag is marked with a trailing (DF).
Timestamps
By default, all output lines are preceded by a timestamp. The timestamp is the current
clock time, in the form hh:mm:ss.frac and is as accurate as the kernel’s clock. The
timestamp reflects the time io-pkt first saw the packet. No attempt is made to
account for the time lag between when the Ethernet interface removed the packet from
the wire and when io-pkt serviced the “new packet” interrupt.
Examples:
Print all packets arriving at or departing from sundown:
tcpdump host sundown
Print all IP packets between ace and any host except helios:
tcpdump ip host ace and not helios
Print all ftp traffic through Internet gateway snup (note that the expression is quoted
to prevent the shell from (mis-)interpreting the parentheses):
tcpdump ’gateway snup and (port ftp or ftp-data)’
Print traffic neither sourced from nor destined for local hosts (if you gateway to one
other net, this stuff should never make it onto your local net):
tcpdump ip and not net localnet
Print the start and end packets (the SYN and FIN packets) of each TCP conversation
that involves a non-local host:
tcpdump ’tcp[tcpflags] & (tcp-syn|tcp-fin) != 0 and not src and dst net localnet’
Print all IPv4 HTTP packets to and from port 80, i.e. print only packets that contain
data, not, for example, SYN and FIN packets and ACK-only packets (IPv6 is left as an
exercise for the reader):
tcpdump ’tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)’
Print IP packets longer than 576 bytes sent through gateway snup:
tcpdump ’gateway snup and ip[2:2] > 576’
Print IP broadcast or multicast packets that weren’t sent via Ethernet broadcast or
multicast:
tcpdump ’ether[0] & 1 = 0 and ip[16] >= 224’
Print all ICMP packets that aren’t echo requests/replies (i.e., not ping packets):
tcpdump ’icmp[icmptype] != icmp-echo and icmp[icmptype] != icmp-echoreply’
Exit status:
0 Successful completion.
1 An error occurred.
Contributing author:
The original authors are Van Jacobson, Craig Leres, and Steven McCanne, all of the
Lawrence Berkeley National Laboratory, University of California, Berkeley, CA. The
tcpdump utility is currently maintained by tcpdump.org.
IPv6/IPsec support is added by WIDE/KAME project. This program uses Eric
Young’s SSLeay library, under specific configuration.
See also:
stty
bpf, pcap in the NetBSD documentation at http://www.netbsd.org/docs/
Syntax:
tee [-ai] [file... ]
Runs on:
QNX Neutrino, Microsoft Windows
Options:
-a Append output to the specified file rather than overwriting it.
file A pathname of an output file. If you don’t specify any files, tee writes to the
standard output.
Description:
The tee utility copies standard input to standard output, making a copy in zero or
more files. It doesn’t buffer its output. You usually use tee in a pipeline, in order to
make a copy of the output of a utility.
If -a is specified, the named file is opened for appending and data from tee is added
to the file’s existing data. If -a isn’t specified, the file is opened for writing and the
original data in the file is lost.
While it normally takes the default action for all signals, tee ignores SIGINT if -i is
specified.
Examples:
Look for some spots in a collection of C programs where a variable count looks like
it’s being assigned a value, and tee the output both to standard output (where you can
see it immediately) and a file output where you can look at it later (note the grep
example here isn’t sufficient for an exhaustive examination of where count might be
assigned a value):
grep ’count *[ˆ+-/\*]\{,1\}= *[!-([:alnum:]]’ | tee output
Files:
An output file is created for each file operand.
Exit status:
0 Success.
Errors:
If a write to any successfully opened file fails, writes to standard output and other
successfully opened files continue. The exit status, however, is nonzero.
Syntax:
telnet [-8] [-c] [-d] [-E] [-e escape_char]
[-L] [-N] [-n tracefile] [-P policy]
[-S tos] [host [port]]
Runs on:
Neutrino
Options:
-8 Allow an eight-bit input data path at all times. Without this
option, parity bits are stripped whenever the remote side’s stop
and start characters are ˆS and ˆQ.
-n tracefile Record trace information in the specified file. See the set tracefile
command, below.
-P policy Use the IPsec policy specification string policy for the
connections. For details of the IPsec policy control, see the
Library Reference.
-S tos Sets the IP type-of-service (TOS) option for the telnet connection
to the value tos, which can be a numeric TOS value or, on
systems that support it, a symbolic TOS name found in the
/etc/iptos file.
Description:
Use the telnet command to communicate with another host via the TELNET
protocol. If you invoke telnet without a host argument, it enters command mode and
displays this prompt:
telnet>
In command mode, telnet accepts and executes the commands listed in “Telnet
commands,” below.
If you invoke telnet with a host argument, it opens a connection to the named host
(i.e. it performs an open command).
If LINEMODE is enabled, character processing is done on the local system, under the
control of the remote system. When input editing or character echoing is to be
disabled, the remote system relays that information. The remote system also relays
changes to any special characters that happen on the remote system, so that they can
take effect on the local system.
In “character-at-a-time” mode, most text that’s typed is immediately sent to the remote
host for processing.
In “old-line-by-line” mode, all text is echoed locally, and (in most cases) only
completed lines are sent to the remote host. You can use the “local echo character”
(initially Ctrl-E) to turn off and on the local echo (you use this mostly to enter
passwords without echoing).
If the LINEMODE option is enabled, or if the localchars toggle is TRUE (the default
for “old-line-by-line”), your quit, intr, and flush characters are trapped locally
and sent as TELNET protocol sequences to the remote side.
If LINEMODE has ever been enabled, then your susp and eof are also sent as
TELNET protocol sequences, and quit is sent as a TELNET ABORT instead of as a
BREAK. There are options (see toggle autoflush and toggle autosynch
below) that cause this action to flush subsequent terminal output (until the remote host
acknowledges the TELNET sequence) and to flush previous terminal input (in the case
of quit and intr).
While you’re connected to a remote host, you can enter telnet’s command mode by
entering the telnet escape sequence (initially Ctrl-]). The normal terminal editing
conventions are available in command mode.
Telnet commands:
In the following commands, you need to type only enough of each command to
uniquely identify it; this is also true for arguments to the mode, set, toggle, unset,
environ, and display commands.
display argument...
Display all, or some, of the set and toggle values (see below).
mode type The type argument can have one of several values, depending on
the state of the TELNET session. The remote host is asked for
permission to go into the requested mode. If the remote host can
enter that mode, the mode is entered.
send arguments Send one or more special character sequences to the remote host.
You can specify the following arguments (more than one
argument may be specified at a time):
environ argument...
The environ command manipulates the variables that may be
sent through the TELNET ENVIRON option. The initial set of
variables is taken from the user’s environment; only the
DISPLAY and PRINTER environment variables are exported
by default. Valid arguments are:
toggle flag... Toggle between TRUE and FALSE various flags that control how
telnet responds to events. You can explicitly set these flags to
TRUE or FALSE with the set and unset commands listed above.
To query the state of these flags, use the display command.
Note that you can specify more than one flag.
Valid arguments are:
status Show the current status of telnet. This includes the peer you’re
connected to as well as the current mode.
Files:
$HOME/.telnetrc
User-customized startup values for telnet.
Environment variables:
The telnet utility uses at least the HOME, SHELL, DISPLAY, and TERM
environment variables. The environment variables may be propagated to the other side
via the TELNET ENVIRON option.
License:
This utility is based on copyright software of the Regents of the University of
California; for licensing information, see the Third Party License Terms List at
http://licensing.qnx.com/third-party-terms/.
Caveats:
On some remote systems, you have to turn echo off manually when you’re in
old-line-by-line mode.
In old-line-by-line mode or LINEMODE, the terminal’s EOF character is recognized
(and sent to the remote system) only when it’s the first character on a line.
See also:
rlogin, rsh, telnetd
Based on RFC 854
Syntax:
telnetd [-debug] [-D (options|report|netstat|ptydata)]
[-h] [-n] [-U] [-46] [port]
Runs on:
Neutrino
Options:
-4 or -6 The address family to use for -debug mode. During normal operation
(called from inetd), telnetd will use the file descriptor passed
from inetd.
-D modifier Print debugging information. You can specify any of the following:
Description:
The telnetd daemon is a server that supports the DARPA-standard TELNET
virtual-terminal protocol.
The telnetd daemon is started when inetd receives a service request to connect to
the TELNET port (inetd listens for service requests specified in the inetd.conf
file at a port defined in the services file).
By specifying the -debug option, you can start up telnetd manually instead of
through inetd. If you start telnetd this way, you can use the port argument to run
telnetd on an alternate TCP port number.
You can use the -D option for debugging. This option lets telnet print debugging
information to the connection, letting you see what telnetd is doing.
The telnetd daemon operates by allocating a pseudo-terminal device for a client,
then creating a login process that has the slave side of the pseudo-terminal as standard
input, standard output, and standard error. The telnetd daemon manipulates the
master side of the pseudo-terminal, implementing the TELNET protocol and passing
characters between the remote client and the login process.
If you get a message saying that all network ports are in use, you’ve either run out of
pseudo devices or you haven’t started devc-pty. The telnetd daemon looks only at
the pseudo-terminal devices named /dev/pty[pqrs][0-f], no matter how many
others are created.
When a TELNET session is started up, telnetd sends TELNET options to the client
side that indicate a willingness to do remote echoing of characters, to suppress
go-ahead, and to do remote flow control, as well as to receive terminal-type
information, terminal-speed information, and window-size information from the
remote client. If the remote client is willing, the remote terminal type is propagated in
the environment of the created login process. The pseudo-terminal allocated to the
client is configured to operate in cooked mode, and with XTABS and CRMOD
enabled.
The telnetd daemon is willing to do:
• echo
• binary
• suppress go ahead
• timing mark
• line mode
• binary
• terminal type
• terminal speed
• window size
• environment
• X display location
• suppress go ahead
• libsocket.so
• devc-pty for pseudo-tty support. You should use the -n option for this daemon to
specify the number of sessions; each telnet session uses one pseudo device.
• ifconfig and route — both these utilities are used to configure your network
interface. These utilities could be replaced by dhcp.client.
• /bin/login
You can link login to sh or another binary if you don’t want to actually log in, but
you must include /etc/passwd if you do want to log in.
• /etc/termcap
• /usr/lib/terminfo
• /bin/sh
To configure the interface from a shell prompt, either use ifconfig and route or
dhcp.client. You can then start inetd.
Files:
The telnetd daemon requires the libsocket.so shared library.
License:
This utility is based on copyright software of the WIDE project and of the Regents of
the University of California; for licensing information, see the Third Party License
Terms List at http://licensing.qnx.com/third-party-terms/.
Caveats:
Because of bugs in the original 4.2 BSD telnet, telnetd performs some protocol
exchanges to try to discover if the remote client is, in fact, a 4.2 BSD telnet.
Binary mode has no common interpretation except between similar operating systems
(UNIX in this case).
The terminal-type name received from the remote client is converted to lowercase.
The telnetd daemon never sends TELNET go-ahead commands.
See also:
/etc/hosts, ifconfig, inetd, inetd.conf, login, /etc/resolv.conf,
rlogind, route, rshd, /etc/services, sh, telnet
TCP/IP Networking in the Neutrino User’s Guide
Based on RFC 854
Syntax:
textto [-c|l|r] [-qz] file...
Runs on:
QNX Neutrino, Microsoft Windows
Options:
-c Convert the specified files to DOS format (CR/LF).
-l (“el”) Convert the specified files to QNX 4 and UNIX format (LF). By default,
if none of the options are specified, -l is assumed.
file The name of the file to be converted. You can use wildcards in the name.
Description:
The textto utility lets you convert text files to QNX 2, QNX 4/UNIX, or DOS
format. You can use the -z option to strip ˆZ codes from DOS-based files. Some DOS
programs use this character as an end-of-file indicator.
Examples:
Change all QNX 2 record separators in prog.c to QNX 4 line feeds:
textto -l prog.c
Change all QNX 4 line feeds in all of the .h files in the current directory to QNX 2
record separators:
textto -r *.h
Change all QNX 4 line feeds in all of the .txt files in the current directory to DOS
CR/LFs:
textto -c *.txt
See also:
tr
Syntax:
tftp [-e] [host] [port]
Runs on:
Neutrino
Options:
-e Use binary transfer mode and set the extended options, as if tout, tsize,
and blksize 65464 had been given.
Description:
The tftp utility is the user interface to the Internet TFTP (Trivial File Transfer
Protocol), which lets you transfer files to and from a remote machine. If you specify a
remote host (and an optional port) on the command line, tftp uses that host (and
port) as the default for future transfers (see the connect command below). The client
host must have an entry in the /etc/services file to provide tftp service.
Commands:
Once tftp is running, it issues a prompt and accepts the following commands:
? command_name...
Print help information.
blksize blk-size Set the blocksize to blk-size octets (8-bit bytes). Since the
number of blocks in a tftp get or put is 65535, the default
block size of 512 bytes allows only a maximum of just under 32
MB to be transferred. The value given for blk-size must be
between 8 and 65464, inclusive. Note that many servers don’t
respect this option.
get file
get remotefile localfile
get file1 file2 ... fileN
Get a file or set of files from the specified sources. The source
can be in one of two forms: a filename on the remote host (if the
host has already been specified), or a string of the form
hosts : filename to specify both a host and file at the same time.
If you use the latter form, the last hostname specified becomes
the default.
mode transfer_mode
Set the mode for transfers to either ascii or binary (default is
ascii).
put file
put localfile remotefile
put file1 file2 ... fileN remote_directory
Put a file or set of files to the specified remote file or directory.
The destination can be in one of two forms: a filename on the
remote host (if the host has already been specified), or a string
of the form hosts : filename to specify both a host and file. If
you use the latter form, the hostname specified becomes the
default; if you use the remote_directory form, the remote host is
assumed to be a Unix box.
If you need to specify IPv6 numeric addresses for the hosts,
enclose them in square brackets ([hosts]:filename) to
disambiguate the colon.
rexmt retransmission_timeout
Set the per-packet retransmission timeout (specified in seconds).
timeout total_transmission_timeout
Set the total transmission timeout (specified in seconds).
tout Toggle the timeout option. If you use this option, the client
passes its retransmission-timeout to the server. Note that many
servers don’t respect this option.
tsize Toggle the tsize option. If you enable this option, the client
passes and requests the size of a file at the beginning of a file
transfer. Note that many servers don’t respect this option.
Files:
The tftp utility requires the libsocket.so shared library.
Caveats:
Since there’s no user-login or validation within the TFTP protocol, the remote site
should have some file-access restrictions — the exact methods for implementing these
vary.
See also:
/etc/services, ftp, tftpd
Syntax:
tftpd [-dln] [-g group] [-p port] [-s directory]
[-u user] [directory ...]
Runs on:
Neutrino
Options:
-d Increase the debugging level.
-g group Change the group ID to that of group on startup. If you don’t specify
this option, the group ID is set to that of the user specified with the
-u option.
-s directory The root directory that you want tftpd to change to on startup. This
is recommended for security reasons (so that files other than those in
the /tftpboot directory aren’t accessable). If the remote host
passes the directory name as part of the file name to transfer, you
may have to create a symbolic link from tftpboot to . under
/tftpboot.
-u user Change the user ID to that of user on startup. If you don’t specify
this option, the user defaults to nobody. If you don’t specify -g,
tftpd uses the group ID of user as well.
Description:
The tftpd daemon is a server that supports the DARPA Trivial File Transfer
Protocol.
The tftpd daemon is started when inetd receives a service request at the port
indicated by the tftp entry (inetd listens for service requests specified in the
inetd.conf at a port defined in the services file).
Because tftp doesn’t require an account or password on the remote system, tftpd
allows only publicly readable files to be accessed. Files may be written only if they
already exist and are publicly writable.
This extends the concept of “public” to include all users on all hosts that can be
reached through the network—this may not be appropriate on all systems, and its
implications should be considered before enabling the tftp service. The daemon
should have the user ID with the lowest possible privilege.
Filenames must start with a /. If a list of directories is given to tftpd, filenames must
be in that list. To get a file, the file must have world-read privileges; to put a file, the
file must have world-write privileges.
The bootpd utility works with tftpd to provide the client with a boot image.
Files:
The tftpd daemon requires the libsocket.so shared library.
See also:
bootpd, ftpd, inetd, tftp
TCP/IP Networking in the Neutrino User’s Guide
Based on RFC 1350
Syntax:
tic [-c] [-i] [-v n] file
Runs on:
Neutrino
Options:
-c Perform only a syntax check of the input file. No output file is produced.
-i Ignore errors when compiling terminfo files from other systems that describe
capabilities not currently supported in /usr/lib/terminfo.
file The pathname of a file that contains one or more terminal descriptions in
terminfo source format. Each description in the file describes a particular
terminal. When a use=entry_name field is encountered within a terminal
description, tic reads the previously compiled description from the
/usr/lib/terminfo directory to finish the entry. This allows terminal
descriptions that are only slightly different from one previously defined to be
expressed as an extension to that previous description. If the environment
variable TERMINFO is set, the directory named is used instead of the
/usr/lib/terminfo directory.
Description:
The tic utility translates a terminfo file from the source format into the compiled
format, ready to use by applications running on the terminal type named in the
terminfo source file.
The compiled terminfo capability files are stored in single-character directories,
under the /usr/lib/terminfo directory. For example, the VT100 terminfo file is
stored in /usr/lib/terminfo/v/vt100.
You can use the infocmp utility to convert a binary, compiled terminfo file back into a
source format that you can modify, and then recompile it with tic.
Some error messages produced by tic indicate the line of the source file in error and
the terminal name being processed at that point.
Environment variables:
TERMINFO When defined, the compiled output from tic is placed under the
directory named instead of in the /usr/lib/terminfo directory.
Exit status:
0 The input file was compiled successfully.
Caveats:
The total size of a compiled terminfo description cannot exceed 4096 bytes. The name
field cannot exceed 128 bytes.
Terminal names longer than 14 characters are truncated to 14 characters.
See also:
infocmp
Strang, John, Linda Mui, and Tim O’Reilly. 1988. termcap & terminfo. Sebastopol,
CA: O’Reilly and Associates. ISBN 0937175226.
Syntax:
time command
Runs on:
Neutrino
Options:
command The command, including any of its options, for which the execution
time is to be determined.
Description:
The time utility and the time shell built-in determine the execution time of command,
which must be specified. When execution of command is complete, the time utility
displays the total elapsed time for execution, the time spent in the system, and the time
spent in executing command. Times are reported in hours, minutes, and seconds.
Times aren’t always accurate to the milliseconds as displayed, depending on the tick
size.
Examples:
Time the execution of dcheck -b2048 /dev/hd0:
Exit status:
The time utility exits with the exit status of the command that was timed.
Caveats:
The time command doesn’t obtain execution information from a remote node. To
time remote programs, use the on command to run time on the same machine as the
program being timed, e.g.:
on -n 61 time sleep 30
NOT:
time on -n 61 sleep 30
See also:
date, uptime
Syntax:
tinit [-f file] [-pt] [env_var=value...]
Runs on:
Neutrino
Options:
-f file The configuration file that defines the commands to start (see
below). The default is /etc/config/ttys.
-p Start Photon.
env_var=value Set the environment variable env_var to value and add it to the
environment.
Description:
The tinit utility lets you bring up login (or other programs) on devices. You
normally use tinit to invoke login on the console(s) and serial terminals.
The tinit utility runs as a background process, and is nearly always started in the
/etc/rc.d/rc.sysinit file. If /etc/system/config/nophoton doesn’t exist
on your system, the default rc.sysinit starts tinit with the -p option.
After creating the specified programs as its children, tinit waits for any of them to
terminate. When one of these commands terminates, tinit re-invokes the command
on that device.
For example, let’s assume that tinit started a login on /dev/con1. After logging
in, the user is presented with a shell. Then, after executing any number of commands,
the user decides to terminate the shell. At this point, tinit detects the termination
and starts a new login on /dev/con1.
con1 The first field is the device name. Unless you define a complete
pathname, starting with / (slash), tinit adds the prefix /dev/
"/bin/login". The second field contains a string that specifies the pathname of
the command to be started on the device. This command can be
anything you like; most often it will be either login, as in this
default example, or photon.
qansi-m The third field describes the terminal type. You can find a list of
the terminal types you can specify in /usr/lib/terminfo.
• Fields may be quoted or unquoted; quoted fields are enclosed by double quotation
marks (").
• An unquoted field is separated from the next field by one or more spaces; a quoted
field is separated from the next by its closing quote, followed by zero or more
spaces.
The tinit utility is the root of all logins, so any environment variables it sets will be
inherited; this makes the tinit command line a convenient place for you to set the
environment variables you need, using the env_var options.
Files:
/etc/config/ttys
The terminal configuration file used by tinit.
See also:
diskboot, login, phlogin
Controlling How Neutrino Starts in the Neutrino User’s Guide
Syntax:
top [-i number] [-d] [-n node] [-p priority]
Runs on:
QNX Neutrino
Options:
-d Tailor the output for a dumb terminal. By default, top refreshes its
output in place for each iteration. If you specify -d, top displays the
output for each iteration after the output from the previous one.
-i number Run for the specified number of iterations. By default, top runs until
you terminate it.
Description:
The top utility displays the system usage. Its output looks like this:
See also:
hogs, pidin, ps
Fine-Tuning Your System in the Neutrino User’s Guide
Syntax:
touch [-acm] [-r ref_file|-t time] file...
Runs on:
QNX Neutrino, Microsoft Windows
Options:
-a Change the access time of file to time, or to the current time if time
isn’t specified. Don’t change the modification time unless the -m
option is also specified.
-c If file doesn’t already exist, don’t create file and don’t write any
diagnostic messages concerning this condition.
-r ref_file Use the specified reference file’s modification time instead of the
current time.
-t time Use the specified time instead of the current time, where time is a
decimal number of the form:
[[CC]YY]MMDDhhmm[.SS]
The two-digit pairs in time represent the following:
If YY is: CC becomes:
69-99 19
00-68 20
Description:
The touch utility lets you change either the modification times or access times of
files, or both.
If any file you specify doesn’t exist, the file is created unless you specify the -c
option. If no time is specified, the current time is used. The -a option changes only
the access time of the file; the -m option changes only the modification time of the file.
If you don’t specify any options, touch behaves as if you used the -a and -m options.
Examples:
Set file1’s access and modification time to the current system time:
touch file1
Change file2’s access and modification time to be the same as file1’s modification
time:
Set file3’s access and modification time to December 25, 12:34, using the current
year:
Environment variables:
TZ Specifies the local time for the specified time zone.
Exit status:
0 Successful completion.
Syntax:
tr [-cs] [-r filename] string1 string2
Runs on:
QNX Neutrino, Microsoft Windows
Options:
-c Complement the set of characters in string1 with respect to the
universe of characters from 00 through FF hex. Characters in string1
are copied unchanged while all other characters are translated.
-d Delete all input characters in string1 (or not in string1 for -dc).
-r filename (QNX Neutrino extension) Translate the named file in place (don’t
use stdin/stdout).
If you specify both -d and -s, tr deletes instances of the characters in string1 and
squeezes instances of the characters in string2 (i.e. tr doesn’t translate in this case).
Description:
The tr utility copies the standard input to the standard output with substitution or
deletion of selected characters. The options specified and the string1 and string2
operands control translations that occur while copying characters.
The default behavior is to replace each input character found in string1 with the
character at the same position in string2, while copying characters not in string1
unchanged.
When string2 is shorter than string1, string2 is extended to the length of string1 by
duplicating the last character of string2. If string2 is explicitly a string of zero length,
it’s padded with NUL characters.
The string1 and string2 operands often require quoting to avoid interpretation by the
shell. Single quotes are usually the proper quoting mechanism.
Examples:
Convert all lowercase characters in the input to the corresponding uppercase
characters:
Or
Create a list of all words in file1 one per line in file2 where a word is taken to be a
maximal string of letters (octal 012 is the code for newline):
Exit status:
0 Success
1 An error occurred.
See also:
gawk, sed, textto
• In order to log trace events, your system must be running an instrumented version
of procnto (i.e. procnto*-instr).
Syntax:
tracelogger [-cEPRrw] [-A attribute] [-b num] [-d mode]
[-F num] [-f file] [-k num] [-M -S size]
[-n num] [-s num] [-v[v...]]
Runs on:
QNX Neutrino
Targets:
x86, PPC, SH-4, ARM, and MIPS
Options:
-A attribute Specify an attribute to add to the log. The attribute is in the form
name=value, where the name and value are arbitrary strings.
-f file The name of the file to store logged events in. The default is
/dev/shmem/tracebuffer.kev.
You can specify more than one filter by using multiple -F options. For
example, to disable both the Interrupt and VThread classes, specify
-F2 -F5. For more information about these classes, see the Events
and the Kernel chapter of the System Analysis Toolkit User’s Guide.
-k num The number of buffers to allocate in the kernel; the default is 32. Each
buffer has a size of approximately 16 KB.
-M Map the log file directly instead of writing. If you use this option, the
log file must be in shared memory, and you must use the -S option to
specify the maximum file size.
-n num The number of iterations to log in iterations mode. The default is 32;
specify 0 for unlimited iterations.
-r Set the kernel buffer to ring mode. The default is linear mode.
-S size The maximum size of the log file. Use M for megabytes or K for
kilobytes. If you don’t use M or K, the units are assumed to be bytes.
You must specify this option if you use the -M option.
Description:
The tracelogger daemon receives events from the instrumented kernel
(procnto*-instr) and saves them in a file or on a device for later analysis. By
default, tracelogger saves the events in /dev/shmem/tracebuffer.kev. The
.kev extension is short for “kernel events”; the Integrated Development Environment
opens files with this extension in the System Profiler.
You can run tracelogger in the following modes:
-d1 Daemon mode: the kernel doesn’t log events, and tracelogger
doesn’t capture them, until an application calls TraceEvent() with a
command of _NTO_TRACE_START. Logging continues until an
application calls TraceEvent() with a command of
_NTO_TRACE_STOP, or you terminate tracelogger.
-s seconds The kernel logs events; tracelogger captures them over the
specified time.
Examples:
Start tracelogger in wide mode and display operational information on the console
screen; store the logged data in the named file and stop logging when 12 trace buffers
are full:
#tracelogger -f /dev/shmem/my_tracebuffer.kev -n 12 -w
Start tracelogger in ring mode (background) using 5 internal buffers and wait for
an asynchronous signal (e.g. Ctrl-C) to stop it:
#tracelogger -r -b 5
tracelogger -c -s20
Exit status:
-1 An error occurred.
Errors:
Severe errors cause tracelogger to terminate.
Caveats:
Run only one instance of tracelogger at a time. Similarly, don’t run tracelogger
and use qconn (under control of the IDE) to trace events at the same time.
See also:
procnto*-instr, qconn, traceprinter
TraceEvent() in the QNX Neutrino Library Reference
System Analysis Toolkit User’s Guide
Analyzing Your System with Kernel Tracing chapter of the IDE User’s Guide
Syntax:
traceprinter [-nv] [-f file] [-o out_file]
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
-f file The filename of the file that stores the trace information to be
displayed. The default is /dev/shmem/tracebuffer.
-o out_file The name of the file in which to store the data. By default,
traceprinter sends its output to stdout.
Description:
The traceprinter utility displays the contents of a trace file generated by
tracelogger. The utility parses the linearly stored time events stored in the named
trace file and sends the resulting formatted stream to standard output (or to the file
identified by the -o option).
The formatted stream looks like this:
The stream always shows the clk_time and cpu variables; the variables in brackets are
optional.
clk_time The time offset in CPU clock cycles when the trace event was
registered. The 64-bit variable is broken into two 32-bit
hexadecimal numbers (msb and lsb). Apart from at the start of
the trace and when the lsb rolls over, only the lsb number is
shown.
Optional variables The other variables are optional, depending on the tracing
information logged. The class and event variables are followed
continued. . .
The number of arguments and return values depends on the event and whether the
trace file was produced using fast or wide tracing mode. For more information, see the
Current Trace Events and Data appendix of the System Analysis Toolkit User’s Guide.
Examples:
Here’s an example of the first few lines of output from traceprinter:
Exit status:
-1 An error occurred.
Errors:
Severe errors cause traceprinter to terminate; noncatastrophic errors are displayed
in verbose mode (if the -v option is set).
Caveats:
You must run tracelogger before running traceprinter. The tracelogger
utility creates an event file containing trace data; traceprinter parses and prints the
data in this file.
See also:
tracelogger
System Analysis Toolkit User’s Guide
Syntax:
traceroute [-DdFIlnPrvx] [-a | -A as_server] [-f first_ttl]
[-g gateway] [-i iface] [-m max_ttl]
[-p port] [-q nqueries] [-s src_addr]
[-t tos] [-w wait_time] host [packetsize]
Runs on:
Neutrino
Options:
-A as_server Turn on AS lookups and use the given server instead of the default.
-f first_ttl Set the initial time-to-live used in the first outgoing probe packet.
-P Set the “don’t fragment” bit and use the next hop MTU each time a
“need fragmentation” error is received, thus probing the path MTU.
-p port The base UDP port number to be used in probes (default is 33434).
The traceroute utility hopes that nothing is listening on UDP
ports base to base + nhops -1 at the destination host (so an ICMP
-q nqueries The number of probes per ttl to nqueries (default is three probes).
-w wait_time The time (in seconds) to wait for a response to a probe (default is 5).
Description:
The Internet is a large and complex aggregation of network hardware, connected
together by gateways. Tracing the route your packets follow — or finding the gateway
that’s discarding your packets — can be difficult. The traceroute utility uses the IP
This utility needs to have the setuid (“set user ID”) bit set in its permissions. If you use
mkefs, mketfs, or mkifs on a Windows host to include this utility in an image, use
the perms attribute to specify its permissions explicitly, and the uid and gid
attributes to set the ownership correctly.
% traceroute nis.nsf.net.
traceroute to nis.nsf.net (35.1.1.48), 30 hops max, 56 byte packet
1 helios.ee.lbl.gov (128.3.112.1) 19 ms 19 ms 0 ms
2 lilac-dmc.Berkeley.EDU (128.32.216.1) 39 ms 39 ms 19 ms
3 lilac-dmc.Berkeley.EDU (128.32.216.1) 39 ms 39 ms 19 ms
4 ccngw-ner-cc.Berkeley.EDU (128.32.136.23) 39 ms 40 ms 39 ms
5 ccn-nerif22.Berkeley.EDU (128.32.168.22) 39 ms 39 ms 39 ms
6 128.32.197.4 (128.32.197.4) 40 ms 59 ms 59 ms
7 131.119.2.5 (131.119.2.5) 59 ms 59 ms 59 ms
8 129.140.70.13 (129.140.70.13) 99 ms 99 ms 80 ms
9 129.140.71.6 (129.140.71.6) 139 ms 239 ms 319 ms
10 129.140.81.7 (129.140.81.7) 220 ms 199 ms 199 ms
11 nic.merit.edu (35.1.1.48) 239 ms 239 ms 239 ms
Note that lines 2 and 3 are the same. This is due to a buggy kernel on the second hop
system (lbl-csam.arpa), that forwards packets with a zero TTL (a bug in the
distributed version of 4.3 BSD). Note that you have to guess what path the packets are
taking cross-country since the NSFNet (129.140) doesn’t supply address-to-name
translations for its NSSs.
This example is more interesting:
% traceroute allspice.lcs.mit.edu.
traceroute to allspice.lcs.mit.edu (18.26.0.115), 30 hops max
1 helios.ee.lbl.gov (128.3.112.1) 0 ms 0 ms 0 ms
2 lilac-dmc.Berkeley.EDU (128.32.216.1) 19 ms 19 ms 19 ms
3 lilac-dmc.Berkeley.EDU (128.32.216.1) 39 ms 19 ms 19 ms
4 ccngw-ner-cc.Berkeley.EDU (128.32.136.23) 19 ms 39 ms 39 ms
5 ccn-nerif22.Berkeley.EDU (128.32.168.22) 20 ms 39 ms 39 ms
6 128.32.197.4 (128.32.197.4) 59 ms 119 ms 39 ms
7 131.119.2.5 (131.119.2.5) 59 ms 59 ms 39 ms
8 129.140.70.13 (129.140.70.13) 80 ms 79 ms 99 ms
9 129.140.71.6 (129.140.71.6) 139 ms 139 ms 159 ms
10 129.140.81.7 (129.140.81.7) 199 ms 180 ms 300 ms
11 129.140.72.17 (129.140.72.17) 300 ms 239 ms 239 ms
12 * * *
13 128.121.54.72 (128.121.54.72) 259 ms 499 ms 279 ms
14 * * *
15 * * *
16 * * *
17 * * *
18 ALLSPICE.LCS.MIT.EDU (18.26.0.115) 339 ms 279 ms 279 ms
The gateways that are 12, 14, 15, 16, and 17 hops away either don’t send ICMP “time
exceeded” messages or send the messages with a TTL that’s too small to reach you.
Gateways 14 to 17 are running the MIT C Gateway code that doesn’t send “time
exceeded”s. The silent gateway 12 may be the result of a bug in the 4.[23] BSD
network code (and its derivatives): versions 4.3 or earlier send an unreachable
message using whatever TTL remains in the original datagram. Since for gateways the
remaining TTL is zero, the ICMP time exceeded is guaranteed to not make it back to
you. The behavior of this bug is slightly more interesting when it appears on the
destination system:
1 helios.ee.lbl.gov (128.3.112.1) 0 ms 0 ms 0 ms
2 lilac-dmc.Berkeley.EDU (128.32.216.1) 39 ms 19 ms 39 ms
3 lilac-dmc.Berkeley.EDU (128.32.216.1) 19 ms 39 ms 19 ms
4 ccngw-ner-cc.Berkeley.EDU (128.32.136.23) 39 ms 40 ms 19 ms
5 ccn-nerif35.Berkeley.EDU (128.32.168.35) 39 ms 39 ms 39 ms
6 csgw.Berkeley.EDU (128.32.133.254) 39 ms 59 ms 39 ms
7 * * *
8 * * *
9 * * *
10 * * *
11 * * *
12 * * *
13 rip.Berkeley.EDU (128.32.131.22) 59 ms ! 39 ms ! 39 ms !
Notice that there are 12 “gateways” (13 is the final destination) and that exactly the
last half of them are missing. What’s really happening is that rip (a Sun-3 running
Sun OS3.5) is using the TTL from your arriving datagram as the TTL in its ICMP
reply. So, the reply timeouts on the return path (with no notice sent to anyone since
ICMPs aren’t sent for ICMPs) until you probe with a TTL that’s at least twice the path
length. That is, rip is really only 7 hops away. A reply that returns with a TTL of 1 is
a clue that this problem exists.
The traceroute utility prints a ! after the time if the TTL is less than or equal to 1.
Since vendors ship a lot of obsolete (DECs Ultrix, Sun3.x) or nonstandard (HPUX)
software, expect to see this problem frequently and/or take care when picking the
target host of your probes. Other possible annotations after the time are:
!F Fragmentation needed.
!H Host unreachable.
!N Network unreachable.
!P Protocol unreachable.
Neither !S nor !F should ever occur — the associated gateway is broken if you see
one. If almost all the probes result in some kind of unreachable, traceroute gives
up and exits.
Intended for use in network testing, measurement, and management, traceroute
should be used primarily for manual fault isolation. Because of the load it could
impose on the network, you shouldn’t use traceroute during normal operations or
from automated scripts.
Files:
The traceroute utility requires the libsocket.so shared library.
Contributing author:
Implemented by Van Jacobson from a suggestion by Steve Deering. Debugged by
others with suggestions and fixes from C. Philip Wood, Tim Seaver, and Ken Adelman.
See also:
netstat, ping
Syntax:
traceroute6 [-dIlnrv] [-f firsthop] [-g gateway]
[-m hoplimit] [-p port] [-q probes] [-s src]
[-w waittime] target [datalen]
Runs on:
Neutrino
Options:
-d Enable debugging.
-l (“el”) Print both the host hostnames and numeric addresses (normally,
only hostnames are printed; or, if -n is specified, only numeric
addresses).
-v Be verbose.
datalen Increase the packet size by this amount. By default, the size is zero
and no data is sent.
Description:
This utility prints the route that the IPv6 packets take to the destination. For more
information, see traceroute.
This utility needs to have the setuid (“set user ID”) bit set in its permissions. If you use
mkefs, mketfs, or mkifs on a Windows host to include this utility in an image, use
the perms attribute to specify its permissions explicitly, and the uid and gid
attributes to set the ownership correctly.
Exit status:
0 Successful completion.
See also:
ping, ping6, traceroute
Syntax:
true
Runs on:
QNX Neutrino, Microsoft Windows
Options:
None.
Description:
The true utility does nothing but exit immediately with a zero exit code.
The true utility is typically used in shell scripts. One common application is to create
an infinite loop, as in:
while true
do
myprogram
sleep 300
done
which runs myprogram every five minutes (300 seconds) until the shell script is
interrupted.
The shell has a builtin true command; see ksh. To make sure you use the executable,
specify the full path.
Exit status:
0
See also:
false, ksh
Syntax:
tsort [-l] [-q] [file]
Runs on:
QNX Neutrino
Options:
-l Search for and display the longest cycle. This can take a very long time.
Description:
The tsort utility takes a list of pairs of node names representing directed arcs in a
graph and prints the nodes in topological order on standard output. Input is taken from
the named file, or from standard input if no file is given.
Node names in the input are separated by white space, and there must be an even
number of node names.
The presence of a node in a graph can be represented by an arc from the node to itself.
This is useful when a node isn’t connected to any other nodes.
If the graph contains a cycle (and therefore cannot be properly sorted), one of the arcs
in the cycle is ignored, and the sort continues. Cycles are reported on standard error.
Contributing author:
NetBSD
See also:
sort
Syntax:
tty [-s]
Runs on:
Neutrino
Options:
-s Be silent; don’t output the terminal name. This option is useful if you’re
concerned only with tty’s exit status.
Description:
The tty utility writes to the standard output the name of the terminal that’s open as
standard input. If standard input isn’t a terminal (e.g. it’s a file such as /dev/null),
the string not a tty is output instead.
The -s option is deprecated by POSIX; you can achieve the effect of this option,
simply and portably, by redirecting output to /dev/null or by using the shell builtin,
test -c.
Examples:
The following command prints /dev/con1 if run on console 1:
tty
The following command prints not a tty because /dev/null causes isatty() to
return 0:
tty </dev/null
Exit status:
0 Success.
Syntax:
uesh [script_file]
Runs on:
Neutrino
Options:
script_file A file containing shell commands to execute.
Description:
The uesh utility provides a subset of the functionality found in the standard embedded
shell, esh. You should find uesh useful for situations where memory requirements are
limited. For example, you could use it to run a simple system initialization file for an
embedded system.
The micro-embedded shell has some very significant limitations:
• no pipes
• no aliases
• no filename- or command-completion
• no set command
For applications that require greater functionality, use esh or the full shell, sh.
Command-line format
In uesh, command lines take this form:
command arg1 arg2 ... [redir-op file] [&]
Where:
Specifying: Will:
<file redirect standard input from this file.
>file Redirect standard output to this file. If the file exists, it’s
overwritten; if the file doesn’t exist, it’s created.
>>file Redirect standard output to this file. If the file exists, the
information is appended to the end of the file; if the file
doesn’t exist, it’s created.
2>file Do the same as >file, but for standard error.
2>>file Do the same as >>file, but for standard error.
& If a command contains an unquoted &, then uesh
doesn’t wait for the command to complete execution but
immediately moves on to process the next command.
The standard input of the command is redirected from
/dev/null, and SIGINT and SIGQUIT are ignored.
Filename expansion
The uesh shell doesn’t support filename expansion. Such shorthands as *.c for all
files ended in .c don’t work.
Quoting
The following characters have a special meaning in uesh:
& \ " [ space
To suppress the special meaning of these characters and keep their literal meaning, use
quoting.
To quote a sequence of characters or sequence of words, enclose the sequence in
double quotes. To quote a single character, use double quotes or precede it with the
escape character (\).
ab\"cd
represents the single, five-character argument ab"cd.
Builtin commands
The following commands are built into uesh (that is, uesh interprets and executes
them internally):
• cd
• emount
• ewaitfor
• exec
• exit
• export
cd command
cd [directory]
Change the working directory of the current execution environment. If directory isn’t
specified, the value of the HOME environment variable becomes the new working
directory.
emount command
emount special directory [fs_type]
continued. . .
The emount command was implemented in QNX Momentics 6.3.0 Service Pack 2.
ewaitfor command
ewaitfor path [max_seconds [delay]]
max_seconds The maximum number of seconds to wait for the file to appear. The
default is 1 second.
The ewaitfor command was implemented in QNX Momentics 6.3.0 Service Pack 2.
exec command
exec [command [argument...]]
exit command
exit [n]
Cause uesh to exit with the exit status specified by n. If n isn’t specified, uesh exits
with the status of the last command executed.
export command
export name[=word]...
export -p
Mark environment variables for export, which causes them to be in the environment of
subsequently executed commands. If you specify the -p option, the names and values
of all exported variables are written to the standard output.
Examples:
Invoke uesh:
uesh
Environment variables:
HOME The pathname of the user’s home directory
PATH The directory search path used by uesh for locating executable
programs. To change PATH, you must use the export command.
If PATH isn’t in the existing environment when uesh is invoked, it’s
set to /bin:/usr/bin. For more information on setting PATH, see
“Setting PATH and LD_LIBRARY_PATH” in the Configuring
Your Environment chapter of the Neutrino User’s Guide.
See also:
esh, fesh, ksh, rsh, sh
“Setting PATH and LD_LIBRARY_PATH” in the Configuring Your Environment
chapter of the Neutrino User’s Guide
Syntax:
umask [-o|-s|mask]
Runs on:
Neutrino
Options:
-o Display the current mask, in octal.
-s Display the current mask in symbolic form. This is the default output.
mask Set the file mode creation mask to mask, which you can specify either as an
octal number or as a symbolic representation.
If you specify the mask in octal form, it replaces the current file mode
creation mask. Every bit that’s set describes a mode bit that won’t be allowed
in the file mode of created files. In other words, it says: “mask this bit off.”
The symbolic form of the mask is an expression that modifies or replaces the
current file mode creation mask. The form of the symbolic mask is similar to
that of the mode operand for the chmod utility:
Where:
Once the symbolic mask expression has been applied to the current file
mode creation mask, any occurrence of [r,w, x] describes a mode bit that is
allowed in the file mode of created files. The absence of a symbol means that
permission isn’t allowed and is masked “off.”
Description:
The umask utility sets the file mode creation mask of the invoking process to the value
specified by the mask operand. The file mode creation mask affects the initial value of
the file permission bits of subsequently created files when no mode is specified.
When files are created without specifying the permission mode bits, the filesystem
assigns default permissions of 0777 (rwxrwxrwx) to directories and executable files,
thereby giving read, write, and execute privileges for user, group, and others. For files
that aren’t executable, permissions of 0666 (rw-rw-rw-) are assigned. The umask
utility is used to adjust these defaults.
The file mode creation mask is inherited by any children of the current process.
You can use either of the display forms (-o or -s) as the mask operand to a
subsequent invocation of umask.
As in the chmod utility, the use of the octal number form of mask values is deprecated.
The shell has a builtin umask command; see ksh. To make sure you use the
executable, specify the full path.
Examples:
1 Set mask to allow read, write, and execute, for user, group, and others:
$ umask a=rwx
2 Specify that no permissions for group and others be allowed; set the mask to
allow only read and write for user only:
$ umask u=rw
Exit status:
0 The file mode creation mask was successfully changed, or no mask operand
was supplied.
>0 An error occurred. The process’s file mode creation mask isn’t changed.
See also:
chmod, ksh
Working with Files in the Neutrino User’s Guide
Syntax:
umount [-f] path [path ...]
Runs on:
Neutrino
Options:
-f Force an unmount, even if the device is busy.
Description:
This utility unmounts the devices that were mounted as the given paths.
If a device is busy (for example, if a file is open), umount fails. You can force the
device to be unmounted by specifying the -f option.
See also:
mount
Syntax:
uname [-amnprsv] [-S name]
Runs on:
QNX Neutrino, Microsoft Windows
Options:
-a Behave as if the options -snrvmp were specified.
-m Write the name of the hardware type on which the system is running.
-v Write the current version level of this release of the operating system
(indicated by a timestamp).
Description:
The uname utility writes to standard output information on the name and release of the
operating system being run. A portable application may use uname on any POSIX
system to determine what operating system it’s running under.
If you don’t specify any options, uname writes the operating system name (QNX).
Examples:
Write the operating system name:
uname
Write a formatted string showing the name, release level, and version level of the
operating system:
Exit status:
0 Success
Caveats:
The pidin utility provides more detailed information than uname, but pidin is a
QNX Neutrino utility and isn’t present on other systems.
See also:
pidin
uname() in the Library Reference
Syntax:
unexpand [-a] [-t tabsize] [file...]
Runs on:
Neutrino
Options:
-a In addition to the default behavior of replacing leading spaces, translate
two to eight consecutive spaces immediately preceding a tab stop into a
tab. A tab stop is a column position that’s a multiple of eight column
positions.
-t tabsize (QNX Neutrino extension) Set the tab stops tabsize columns apart
(default is 8). The tabsize argument consists of a single positive
decimal integer.
Description:
The unexpand utility copies files or the standard input to the standard output,
translating each group of eight spaces at the beginning of a line into a tab character.
Any backspace characters in the input are copied to the output, and each causes the
column position count for tab calculations to be decremented; the count is never
decremented below zero.
Examples:
For the file sourcecode, convert every run of eight spaces at the beginning of a line
into a single tab:
unexpand sourcecode
Convert every run of two to eight spaces that precedes a tab stop into a single tab:
unexpand -a sourcecode
Convert every run of two to four spaces that precedes a tab stop into a single tab:
Exit status:
0 Successful completion.
See also:
expand
Syntax:
unifdef [-l] [-t] [-c] [[-Dsym] [-Usym] [-iDsym] [-iUsym]]... [file]
Runs on:
QNX Neutrino
Options:
-Dsym -Usym Specify which symbols to define or undefine respectively. The
lines inside those ifdefs are copied to the output or removed as
appropriate. The ifdef, ifndef, else, and endif lines
associated with sym are also removed. If an ifdef X occurs
nested inside another ifdef X, then the inside ifdef is treated
as if it were an unrecognized symbol.
-iDsym -iUsym Ignore the specified ifdefs. Specifies which ifdef symbols to
parse or not to parse for quotes and comments inside
respectively. Parsing is done by default, and the -t option
overrides these options.
Description:
The unifdef utility removes ifdef’ed lines from C or C++ code. You must specify
at least one of -D, -U, -iD, and -iU. This utility copies output to stdout, and takes its
input from stdin if you don’t specify a file argument.
See also:
indent
Syntax:
uniq [-c] [-d|-u] [-f fields] [-s chars]
[input_file [output_file]]
Deprecated syntax:
Runs on:
Neutrino
Options:
-n (deprecated, replaced by -f) Ignore the first n fields when doing
comparisons, where n is a number.
-c Precede each output line with the number of times the line occurred in
the input.
-f fields Ignore the first fields on each input line when doing comparisons,
where fields is a positive decimal integer. A field is a string of
nonblank characters separated from adjacent fields by blanks.
-s chars Ignore the first chars characters when doing comparisons, where chars
is a positive decimal integer. If specified in conjunction with the -f
option, the first chars characters after the first fields fields are ignored.
input_file The pathname of the input file. If you don’t specify any input files, the
standard input is used.
output_file The pathname of the output file. This name must differ from the name
of the input file. If you don’t specify an output file, the standard
output is used.
Description:
The uniq utility reads an input text file, comparing adjacent lines, and writes one copy
of each input line to the output. The second and succeeding copies of repeated
adjacent input lines aren’t written.
To obtain a report of unique lines in a file, the input file must be sorted prior to running
uniq.
Examples:
Look for repeated adjacent lines in datfile:
uniq datfile
Environment variables:
LC_TYPE The locale for character classification, used to determine the
characters constituting a blank in the current locale.
Exit status:
0 Success
Errors:
If output_file is created, it isn’t removed when an error occurs.
See also:
sort
Syntax:
unlink file
Runs on:
Neutrino
Options:
file The pathname of an existing file.
Description:
The unlink utility is a command-line interface to the unlink() function:
(void)unlink( file );
You need the appropriate permissions (typically write permission in the directory that
contains file) in order to use the unlink utility. In order to unlink a directory, you need
the appropriate permissions, and the filesystem must also allow it (see _PC_LINK_DIR
in the description of pathconf() in the QNX Neutrino Library Reference).
Exit status:
0 Successful completion.
See also:
link, ln, rm, rmdir
pathconf(), unlink() in the QNX Neutrino Library Reference
Syntax:
unzip [-Z] [-opts[modifiers]] file[.zip] [list]
[-x xlist] [-d exdir]
Runs on:
QNX Neutrino, Microsoft Windows
Targets:
x86 only
Options:
The options include:
-T Update the timestamp for the archive to match the latest timestamp
of the archive files.
-Z ZipInfo mode. If the first option on the command line is -Z, the
remaining options are taken as ZipInfo options.
-M Pipe all output through an internal pager that’s similar to the more command.
Description:
The unzip utility lists, tests, or extracts files from a ZIP archive. The default behavior
(with no options) is to extract into the current directory (and subdirectories below it)
all files from the specified ZIP archive. A companion program, zip, creates ZIP
archives; both programs are compatible with archives created by PKZIP and
PKUNZIP.
Examples:
Extract all members of the archive letters.zip into the current directory and
subdirectories below it, creating any subdirectories as necessary, using unzip:
unzip letters
unzip -j letters
Test letters.zip. Use the following command to print only a summary message
indicating whether the archive is all right or not:
Test all zipfiles in the current directory, and print only the summaries:
Extract all members of letters.zip whose names end in .tex, to standard output,
auto-convert to the local end-of-line convention, and pipe the output into more:
unzip -v
See whether decryption support was compiled with the files:
unzip -v
See the compiler that unzip used:
unzip -v
Environment variables:
UNZIP A set of default options for unzip. For example:
export UNZIP="-qq"
Exit status:
0 The operation succeeded.
2 A generic error in the zipfile format was detected, but processing may have
completed successfully anyway; a warning was generated in the process.
3 A severe error in the zipfile format was detected; processing probably failed
immediately.
4 unzip was unable to allocate memory for one or more buffers during program
initialization.
5 unzip was unable to allocate memory or unable to obtain a tty to read the
decryption password(s).
82 No files were found, due to bad decryption password(s). If even one file is
successfully processed, however, the exit status is 1.
See also:
freeze, gzip, pax, tar, zip
Backing Up and Recovering Data in the Neutrino User’s Guide
Syntax:
uptime
Runs on:
Neutrino
Options:
None.
Description:
The uptime utility displays the current local time, by the length of time that the
system has been running (in days, hours, and minutes, as appropriate), and the number
of users logged in.
See also:
date, time
Syntax:
usb [-b busno -d devno -N name] [-t] [-V] [-v]
Runs on:
Neutrino
Options:
-b busno Display devices on specific busno only.
Description:
The usb utility displays USB device configuration. As you repeat the number of -v
(verbose) options, you’ll get more levels of detail.
Examples:
Here’s some sample output from the command usb -vvv. Note that two USB devices
(an Ethernet card and a printer) are installed in this case.
USB (UHCI) v1.10, v1.00 DDK
Control, Interrupt, Bulk, Isoch, Low, High
Device Address : 1
Vendor : 0x0506 (3COM)
Product : 0x03e8 (3COM USB Network Interface (3C19250))
Device Release : r0.02
USB Spec Release : v1.00
Serial Number : 009004BB78F9
Class : 0x00 (Independent per interface)
Max PacketSize0 : 8
Languages : 0x0409 (English)
Configurations : 1
Configuration : 1
Attributes : 0x80 (Bus-powered)
Max Power : 110 mA
Interfaces : 1
Interface : 0 / 0
Class : 0x00 (Unknown)
Subclass : 0x00
Protocol : 0x00
Endpoints : 3 + Control
Endpoint : 0
Attributes : Control
Max Packet Size: 8
Endpoint : 1
Attributes : Bulk/IN
Max Packet Size: 64
Endpoint : 2
Attributes : Bulk/OUT
Max Packet Size: 64
Endpoint : 3
Attributes : Interrupt/IN
Max Packet Size: 8
Interval : 1 ms
Device Address : 2
Vendor : 0x04a9 (Canon)
Product : 0x1055 (BJC-85)
Device Release : r0.70
USB Spec Release : v1.10
Serial Number : 44OFBr
Class : 0x00 (Independent per interface)
Max PacketSize0 : 8
Languages : 0x0409 (English)
Configurations : 1
Configuration : 1
Attributes : 0x40 (Self-powered)
Max Power : 2 mA
Interfaces : 1
Interface : 0 / 0
Class : 0x07 (Printer)
Subclass : 0x01
Protocol : 0x02
Endpoints : 2 + Control
Endpoint : 0
Attributes : Control
Max Packet Size: 8
Endpoint : 1
Attributes : Bulk/OUT
Max Packet Size: 64
Endpoint : 2
Attributes : Bulk/IN
Max Packet Size: 64
See also:
devu-ehci.so, devu-ohci.so, devu-uhci.so, io-usb
Connecting Hardware in the Neutrino User’s Guide
Syntax:
use [-aeis] [-d directory] [-f filelist] files
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
-a Extract all usage information from the load module in its source
form, suitable for piping into usemsg.
-f filelist Read a list of files, one per line, from the specified filelist file, and
display information for each.
files One or more executable load modules or shell scripts that contain
usage messages.
Description:
The use utility displays a usage message for the specified executable programs or
shell scripts.
Regardless of your current terminal settings specified, the use utility automatically
includes a line break after 80 characters.
The use utility searches for files, using the default command search (PATH), and
displays the usage message (if any) that it finds in the load files or shell scripts.
If the LANG environment variable is set, a usage message of that language displays, if
available. Alternate language usage messages are not available within shell scripts.
However, it’s easy to edit shell script messages. While usage messages included with
standard versions of QNX Neutrino are in English only, it’s possible to add alternate
language usage messages by placing the revised usage message in a separate file, and
using the usemsg utility to insert the usage message in the executable in question.
#ifdef __USAGE
#%C thread_id
#Where:
# thread_id is the thread ID you want to act on
#endif
If the shell script is called foo, and you invoke use foo, the following message is
displayed:
foo thread_id
Where:
thread_id is the thread ID you want to act on
In the above shell script fragment, the message starts with:
#%C thread_id
and ends with:
Examples:
Display a usage message for the ls utility:
use ls
See also:
ksh, usemsg
Syntax:
usemsg [-c] [-i id[=value]] [-f info_file] loadfile [msgfile]
Runs on:
QNX Neutrino, Linux, Microsoft Windows
Options:
-c The usage message is contained in a C source program delimited by:
#ifdef __USAGE
...
#endif
Note that there are two underscores before USAGE.
-f filename Read filename for lines containing id=value pairs to import into
loadfile.
-i id=value Add the information tag id to loadfile with the specified value.
value doesn’t need to be specified for the DATE or NAME ids.
The DATE and NAME keys will be added automatically when any
other key is added.
id is translated into upper-case.
-l Use ldrel to add the specified usage message.
-o Use objcopy to add the specified usage message. This is the default
behavior.
The -o option is required if you’re running usemsg on a binary that has its data
segment before its code segment. Without the -o option, usemsg will corrupt these
reordered binaries.
-s string Import the usage message from the #ifdef string section in a C
source file. If string is omitted, __USAGE will be used.
If multiple -s options are specified, usemsg will search for them in
order and use the first string section found.
loadfile The name of an executable program to extract or insert a usage
message. The current PATH environment variable is searched to
locate loadfile.
msgfile A text file or a C source file containing a usage message (see -c). If
the msgfile name ends in .c, a C source is assumed. If present, this
argument is used as the name of the message file to insert into the
load file. If the msgfile argument isn’t present, the usage message is
read from the load file and printed to standard output.
Description:
The usemsg utility lets you examine or change the usage record contained within a
QNX Neutrino executable program. All utilities supplied with QNX Neutrino are
shipped with a usage message describing their options. This information is kept in a
resource record in the load file. Since this usage text isn’t loaded into memory when
the program is run, you can make it as large as 32K characters without affecting the
size of your program at runtime.
The use utility prints usage messages. For example:
use ls
use more
use pidin
Developers may use the usemsg utility to add usage messages to their programs.
Where digit is where to read the output from, either 1 (stdout) or 2 (stderr). The use
utility itself always prints to stdout but executables may print to stdout or stderr.
For example, if some_gnu_tool has an option --help that sends a help message to
stdout, add a line like this:
or
%1> %C --help
use some_gnu_tool
some_gnu_tool --help
%% A single %.
To extract the entire usage message, including all languages and the grammar control
sequences, name the loadfile and don’t specify a msgfile.
The %-command and %=language are both optional. If both are specified, the
%-command is followed by one or more %=language sections followed by another
%-command and another set of %=language sections. The following examples should
clarify the required nesting:
%=english
%C an English language message
%=french
%C a French language message
%-less
%C single language message for less
%-more
%-less
%=english
%C an English language message for less
%=french
%C a French language message for less
%-more
%=english
%C an English language message for more
%=french
%C a French language message for more
If multiple language usage messages are available, use employs the LANG
environment variable to select a language. If LANG isn’t defined or doesn’t match any
language present, then the first usage message is printed. Likewise, if multiple
command names are present, the command passed as an argument is used to select a
command. If no match occurs, the first usage message is printed.
Examples:
Insert a usage message from C source into myprog:
Extract the entire usage message for pidin, edit the message, then reinsert the
changed message:
See also:
use
Syntax:
uud [-n] [-d] [-s dir] [-t dir] input-file
Runs on:
Neutrino
Options:
-n Don’t check the line sequence.
-s dir The source directory for all input files. You must end the name of the
directory with a directory separator (i.e. a slash).
-t dir The target directory for all output files. You must end the name of the
directory with a directory separator (i.e. a slash).
input-file The name of the file to decode. If input-file is -, read from standard
input.
Description:
The uud utility decodes a file that was encoded using uue.
If the filename is in the form input-file.uaa (i.e. you used the -n to uue to break a file
into chunks), uud automatically includes the subsequent pieces.
See also:
uue
Syntax:
uudecode [-p | -o outfile] [file ...]
Runs on:
Neutrino
Options:
-o outfile Decode to outfile; otherwise uudecode recreates the original file.
Description:
The uudecode utility decodes a file that was encoded using uuencode.
See also:
uud, uue, uuencode
Syntax:
uue [-n] input_file [-]
Runs on:
Neutrino
Options:
-n The number of lines to put into each file.
Description:
The uue utility encodes a binary file as ASCII (e.g. for mailing). The encoding takes 3
bytes (24 bits) from the input file and renders them as 4 bytes in the output file.
By default, the output file is input_file.uue; if you specify a dash at the end of the
command, uue writes the encoded file to standard output.
If you want to read from standard input (e.g. a pipe), use uuencode instead of uue.
If you specify the -n option, uue writes the encoded file to input_file.uaa,
input_file.uab, and so on.
To decode the file, use uud.
See also:
uud, uudecode, uuencode
Syntax:
uuencode [-m] [file] name
Runs on:
Neutrino
Options:
-m Use the MIME Base64 encoding; otherwise use the uuencode historical
algorithm.
file The file that you want to encode. If you don’t specify a file, uuencode
reads from standard input.
name The name to embed in the encoded file for use by uudecode.
Description:
The uuencode utility encodes a binary file as ASCII (e.g. for mailing). The encoding
takes 3 bytes (24 bits) from the input file and renders them as 4 bytes in the output file.
By default, uuencode writes the encoded file to standard output. If you don’t specify
an input file, uuencode reads from standard input (unlike uue).
To decode the file, use uudecode.
See also:
uud, uudecode, uue
Syntax:
vi [options]... [+command] file...
Runs on:
Neutrino
Options:
See elvis for a full listing.
Description:
The vi utility is an interactive fullscreen editor that’s compatible with the
Unix/POSIX vi editor. The vi utility in QNX Neutrino is a link to elvis.
Contributing author:
Steve Kirkendall
See also:
ed, elvis, ctags, ped, qed, sed
Using Editors in the Neutrino User’s Guide
Linda Lamb, Learning the vi Editor, O’Reilly and Associates, 1990
Syntax:
view [options]... [+command] file...
Runs on:
Neutrino
Options:
See elvis for a full listing.
Description:
The view utility is an interactive fullscreen editor that’s compatible with the
Unix/POSIX vi editor. The view utility in QNX Neutrino is a link to elvis.
Contributing author:
Steve Kirkendall
See also:
elvis, ctags, qed, sed
Linda Lamb, Learning the vi Editor, O’Reilly and Associates, 1990
Name:
/etc/view.conf
Description:
The view.conf file is used to define the views of the MIB data that’s available to the
defined parties (/etc/party.conf) via a defined context (/etc/context.conf).
Here’s the search order that’s used to find this file:
2 /etc/view.conf
where:
viewsubtree A subtree in the MIB that includes the objects that the defined parties
should have access to.
viewmask Used with the instance of subtree to determine whether the object
identifier being specified is in the family of view subtrees.
For example:
All of the objects that reside under the subtree .iso.org.dod.internet.mgmt are
included in the view number 3.
See also:
snmpget, snmpgetnext, snmptest, snmptrapd, snmpwalk
Based on ISO IS 8824 (ASN.1), RFC 1065, RFC 1066, RFC 1067, RFC 1446
Syntax:
waitfor pathname [wait_time]
Runs on:
Neutrino
Options:
pathname The path to test.
wait_time The maximum number of seconds to wait for the file to appear. It can
include one decimal digit to specify tenths of a second. The default is
5.0 seconds.
Description:
The waitfor utility pauses temporarily until a stat() on the specified pathname
succeeds. It’s often used for synchronization, to allow a resource manager to perform
its startup functionality, and then for the process manager to proceed with the further
interpretation of the script file.
Native io-pkt and ported NetBSD drivers don’t put entries into the /dev/io-net
namespace, so a waitfor command for such an entry won’t work properly in
buildfiles or scripts. Use if_up -p instead; for example, instead of waitfor
/dev/io-net/en0, use if_up -p en0.
Syntax:
wc [-clw] [-ht] [file...]
Runs on:
Neutrino
Options:
-c Write to the standard output the number of bytes in each input file.
-l (“el”) Write to the standard output the number of lines in each input file.
-t (QNX Neutrino extension) Don’t display the totals when counting more than
one file.
-w Write to the standard output the number of words in each input file.
file The pathname of an input file. If no files are specified, the standard input is
used.
Description:
For each input file, the wc utility counts lines, words, and characters (bytes) in the file
and writes the results to the standard output. It considers a word to be a string of
characters delimited by white space.
If you don’t specify any options, wc writes counts of lines, words and characters, in
that order. If you specify one or more of the options -l, -w, or -c, the wc utility
reports only the information selected for the specified options. The order in which you
specify these options determines the order in which the number of lines, words, and
bytes are written.
If you specify more than one input file, wc also writes a total count for all named files,
for each option. You can specify the -t option to suppress the totals.
To get its line count, wc counts newline characters. If the last line of a file lacks the
newline terminator, it isn’t counted.
Exit status:
0 Success.
Syntax:
which [-afLls] program...
Runs on:
Neutrino
Options:
-a Find all occurrences of program in PATH.
-L Display the long format (as in ls -l) for each program found, displaying link
information if the file is a symlink.
-l (“el”) Display the long format (as in ls -l) for each program found.
Description:
The which utility searches for the specified programs. By default, which searches the
directories listed by your PATH environment variable, but if you specify the -s option,
it searches the directories specified by LD_LIBRARY_PATH and _CS_LIBPATH.
Examples:
Display the full pathname and long status for all versions of the ls utility found in
PATH:
which -alf ls
Display the pathname for the which utility:
which which
Locate the devg-flat.so shared object:
which -s devg-flat.so
Environment variables:
PATH A colon-separated list of directories to search for executables.
LD_LIBRARY_PATH
A colon-separated list of directories to search for shared libraries.
Exit status:
0 All input files were found.
See also:
ls, whence (builtin ksh command)
Syntax:
who [file]
who am I
Runs on:
Neutrino
Options:
file The file that contains information about the logged-in users. If you don’t
specify a file, the utility looks at /var/log/utmp.
Description:
The who utility displays information about the logged-in users:
• If you specify no arguments or a file, who displays a list of all logged-in users.
• If you specify who am I (or who am i), the utility displays the terminals you’re
logged into.
See also:
rwho
Syntax:
wpa_cli [-p path to ctrl sockets]
[-i ifname]
[-hvB] [-a action file]
[-P pid file] [command ... ]
Runs on:
Neutrino
Options:
-p path Change the path where control sockets should be found.
-i ifname Specify the interface that is being configured. By default, choose the
first interface found with a control socket in the socket path.
-a file Run in daemon mode executing the action file based on events from
wpa_supplicant. The specified file will be executed with the first
argument set to the interface name, and the second to CONNECT or
DISCONNECT, depending on the event.
Description:
The wpa_cli utility is a text-based front-end program for interacting with
wpa_supplicant. You can use it to query the current status, change the
configuration, trigger events, and request interactive user input.
The wpa_cli utility can show the current authentication status, selected security
mode, dot11 and dot1x MIBs, etc. In addition, it can configure some variables like
EAPOL state machine parameters and trigger events like reassociation and IEEE
802.1X logoff/logon.
The wpa_cli utility provides a user interface to request authentication information,
such as user name and password, if these aren’t included in the configuration. You can
use this to implement, for example, one-time passwords or generic token card
authentication where the authentication is based on a challenge-response that uses an
external device for generating the response.
You can configure the control interface of wpa_supplicant to allow non-root user
access (ctrl_interface_group in the configuration file). This makes it possible to
run wpa_cli with a normal user account.
The wpa_cli utilities supports interactive and command-line modes. Both modes
share the same command set, and the main difference is in interactive mode providing
access to unsolicited messages (event messages, user name/password requests).
If you don’t specify a command when you start wpa_cli, the utility goes into
interactive mode. You then enter commands at the wpa_cli prompt.
Supported commands
The wpa_cli utility currently supports the following commands:
disable_network network_id
disable a network
enable_network network_id
Enable a network.
get_capability eap/pairwise/group/key_mgmt/proto/auth_alg
Get capabilities.
interface [ifname]
Show interfaces or select the specified interface.
preauthenticate BSSID
Force preauthentication.
remove_network network_id
Remove a network.
save_config Save the current configuration.
select_network network_id
Select a network (disable others).
See also:
wpa_supplicant
WiFi Configuration Using WPA and WEP in the Core Networking User’s Guide
Syntax:
wpa_passphrase [ssid] [passphrase]
Runs on:
Neutrino
Options:
ssid The SSID whose passphrase should be derived.
passphrase Use this passphrase. If not included on the command line, it will be
read from standard input.
Description:
The wpa_passphrase utility precomputes PSK entries for network configuration
blocks of a wpa_supplicant.conf file.
See also:
wpa_supplicant
WiFi Configuration Using WPA and WEP in the Core Networking User’s Guide
Syntax:
wpa_supplicant [-BhKLNptuvW] [-b br_ifname]
[-C ctrl_interface] [-c config file] [-d[d]]
[-f output_file] [-g global ctrl_interface]
[-i ifname] [-P file] [-q[q]]
Runs on:
Neutrino
Options:
Most command-line options have global scope. Some are given per interface, and are
valid only if you’ve specified at least one -i option; otherwise they’re ignored. Option
groups for different interfaces must be separated by an -N option.
-C ctrl_interface The path to the ctrl_interface socket. (Per interface; used only if
-c is not).
-g global ctrl_interface
The path to the global ctrl_interface socket. If you specify this
option, you can omit the interface definitions.
-i ifname The interface to listen on. Multiple instances of this option can
be present, one per interface, separated by an -N option (see
below).
Description:
Wireless networks don’t require physical access to the network equipment in the same
way as wired networks. This makes it easier for unauthorized users to passively
monitor a network and capture all transmitted frames. In addition, unauthorized use of
the network is much easier. In many cases, this can happen even without the user’s
explicit knowledge, because the wireless LAN adapter may have been configured to
automatically join any available network.
Link-layer encryption can be used to provide a layer of security for wireless networks.
The original wireless LAN standard, IEEE 802.11, included a simple encryption
mechanism, WEP. However, that proved to be flawed in many areas, and networks
protected with WEP cannot be considered to be secure.
IEEE 802.1X authentication and frequently-changed dynamic WEP keys can be used
to improve the network security, but even that has inherited security issues, due to the
use of WEP for encryption. Wi-Fi Protected Access and IEEE 802.11i amendment to
the wireless LAN standard introduce a much-improved mechanism for securing
wireless networks. IEEE 802.11i-enabled networks that are using CCMP (an
encryption mechanism based on strong cryptographic algorithm AES) can finally be
called secure used for applications which require efficient protection against
unauthorized access.
The wpa_supplicant utility is an implementation of the WPA Supplicant
component, i.e., the part that runs in the client stations. It implements WPA key
negotiation with a WPA Authenticator and EAP authentication with Authentication
Server. In addition, it controls the roaming and IEEE 802.11
authentication/association of the wireless LAN driver.
The wpa_supplicant utility is designed to be a daemon that runs in the background
and acts as the backend component controlling the wireless connection. It supports
separate front-end programs and a sample text-based front-end, wpa_cli, is included
with wpa_supplicant.
Before wpa_supplicant can do its work, the network interface must be available.
That means that the physical device must be present and enabled, and the driver for the
device must have been loaded. The daemon exits immediately if the device isn’t
already available.
After wpa_supplicant has configured the network device, higher-level
configuration such as DHCP may proceed. There’s a variety of ways to integrate
5 If WPA-EAP: the master key is received from the IEEE 802.1X Supplicant.
Supported features
Supported WPA/IEEE 802.11i features:
• WPA-PSK (“WPA-Personal”)
- EAP-TTLS/PAP
- EAP-TTLS/CHAP
- EAP-SIM
- EAP-AKA
- EAP-PSK
- EAP-PAX
- LEAP (note: requires special support from the driver for IEEE 802.11
authentication)
The following methods are supported, but since they don’t generate keying
material, they can’t be used with WPA or IEEE 802.1X WEP keying:
- EAP-MD5-Challenge
- EAP-MSCHAPv2
- EAP-GTC
- EAP-OTP
Files:
The wpa_supplicant requires the following libraries and binaries be present:
You can’t use /dev/shmem because it isn’t possible to create a directory there.
See also:
wpa_cli, wpa_passphrase
wpa_supplicant.conf in the NetBSD documentation.
WiFi Configuration Using WPA and WEP in the Core Networking User’s Guide
Syntax:
xargs [-itx] [-n numargs] [-P n] [-s size]
[program [initial-arguments]]
Runs on:
QNX Neutrino, Microsoft Windows
Options:
-i (QNX Neutrino extension) Execute in “insert mode.” The
program is executed once for each item in standard input. Each
occurrence of {} in initial-arguments is replaced with the
argument read from standard input. If there are no occurrences
of {} in initial-arguments, the argument is appended to the
initial list.
Description:
The xargs utility uses character strings, read from standard input, to construct a
command line which it executes. The specified program and initial-arguments are
placed at the beginning of the command line, followed by some number of character
strings read. This process continues until the end of the file.
The utility executes a given program with initial-arguments one or more times using
the parameters read from standard input. The number of strings appended may be
limited by the -n option; the size of the command line may be limited by the -s
option.
The strings are separated by blanks or newlines, which may be embedded in the
strings by prefixing them with \ or enclosing them in quotes ("). To use the quote
character as itself, you must prefix it with a \.
The -i option causes the command to be executed for each string read. Instead of the
normal process of appending the string to the command buffer, the initial-arguments
are scanned, and every occurrence of {} is replaced by the string. If {} doesn’t occur
in initial-arguments, the string is appended to the command line and executed.
When a program is executed, it inherits standard output and standard error from
xargs. Standard input is set to the controlling tty.
The xargs utility always limits the total command buffer size to 4096 characters. The
following example may be used to verify the integrity of data files on a floppy disk
(mounted as /fd):
In the example above, find prints the name of each file on the mounted filesystem.
The xargs utility groups the filenames up for cksum to minimize the number of times
cksum must be executed. The diff utility is then used to verify that the calculated
checksums are the same as recorded in the check_file file.
It’s important to note that the following command:
achieves the same thing, but requires cksum to be reloaded once for each file in /fd.
Examples:
Use cmp to determine whether the files in the directory old_data are the same as the
files in the directory new_data:
Display the files in the current working directory, and all subdirectories, in two
columns:
Exit status:
0 All invocations of program completed successfully.
See also:
find
Syntax:
zap [-pv] file
zap [-pv] [-l|-u] directory
Runs on:
Neutrino
Options:
-l (“el”) List previously zapped files in the directory.
Description:
You should use zap to remove a file if:
The zap utility releases a file by clearing the directory entry for that file. The disk
blocks used by the file aren’t reclaimed. Therefore, if you use zap repeatedly, you’ll
reduce the total number of disk blocks available on the disk. You can reclaim these,
however, by running chkfsys when the system is idle.
Normally, you should use the rm or rmdir commands to release files or directories.
Previously zapped files may be listed in any specified directory using the -l option.
You can “unzap” or recover zapped files by using the -u option. The utility prompts
for each file that was zapped in the specified directory.
The file to be “unzapped” must have been initially removed via a zap command. Files
removed conventionally via rm or any other process which calls unlink() can’t be
restored by means of the zap -u command.
Examples:
Eliminate the directory entry for the file junk:
zap junk
Exit status:
0 Success.
Caveats:
To run zap you must have read and write permission for the block special file for the
filesystem containing the file being zapped. You must also have execute permission for
the zap utility. In a normally configured system this means you must be root to run
zap.
See also:
chkfsys, rm, rmdir
Backing Up and Recovering Data in the Neutrino User’s Guide
Syntax:
zcat [-hLV] [name...]
Runs on:
QNX Neutrino, Microsoft Windows
Options:
See gzip for a complete listing.
Description:
The zcat utility is part of the gzip suite. See gzip for a description.
This utility is subject to the GNU Public License (GPL). We’ve included it for use on
development systems.
Contributing author:
GNU
See also:
gzip
Syntax:
zip [-options] [-b path] [-t mmddyyyy] [-n suffixes]
[zipfile list] [-xi list]
Runs on:
QNX Neutrino, Microsoft Windows
Targets:
x86 only
Options:
-0 to -9 Regulate the speed of compression, where -0 indicates no
compression, -1 (“one”) indicates the fastest compression method
(less compression) and -9 indicates the slowest compression
method (optimal compression). The default compression level is
-6.
-b path Use the specified path for the temporary zip archive.
-D Don’t create entries in the zip file for directories. Directory entries
are created by default to allow their attributes to be saved in the
zip archive.
-F Fix the zip file. Use this option if some portions of the file are
missing.
-J Strip any prepended data (i.e. a SFX stub) from the file.
-j Junk the path to the file; store just the name of the saved file.
-m Move the specified files into the zip file and delete the target
directories/files.
-n suffixes Don’t attempt to compress files named with the suffixes indicated.
You can use either colons or semicolons to separate the suffixes.
-o Set the “last modified” time on the zip file to match the “last
modified” time on the zip archive entries.
-t mmddyyyy Don’t operate on files modified prior to the specified date, where
mm is the month, dd represents the day of the month, and yyyy is
the year.
-tt mmddyyyy Don’t operate on files modified after or at the specified date, where
mm is the month, dd represents the day of the month, and yyyy is
the year.
Description:
The zip utility is a compression and file-packaging utility. A companion program
(unzip), unpacks zip archives. The zip and unzip programs can work with
archives produced by PKZIP; PKZIP and PKUNZIP can work with archives produced
by the zip utility.
The zip utility is useful for packaging a set of files for distribution, for archiving files,
and for saving disk space by temporarily compressing unused files or directories.
This utility puts one or more compressed files into a single zip archive, along with
information about the files, such as name, path, date, time of last modification,
protection, and check information to verify file integrity.
You can use a single command to pack an entire directory structure into a zip archive.
Compression ratios of 2:1 to 3:1 are common for text files. The zip utility has one
compression method (deflation) and can also store files without compression; zip
automatically chooses the better of the two for each file to be compressed.
When zip is given the name of an existing zip archive, it replaces identically named
entries in the archive or adds entries for new names.
For example, if foo.zip exists and contains foo/file1 and foo/file2, and the
directory foo contains the files foo/file1 and foo/file3, then:
Examples:
Create an archive called stuff.zip, for example, and put all the files in the current
directory in it, in compressed form:
zip stuff *
The .zip suffix is added automatically, unless the archive name given contains a dot
already; this allows the explicit specification of other suffixes.
Because of filename substitution, files starting with “.” are not included; to include
these to the file:
zip stuff .* *
This command doesn’t include any subdirectories from the current directory.
This command creates the archive foo.zip, containing all the files and directories in
the directory foo that are contained within the current directory.
You may want to make a zip archive that contains the files in foo, without recording
the directory name foo. Use the -j option to leave off the paths:
If you’re short on disk space, you might not have enough room to hold both the
original directory and the corresponding compressed zip archive. In this case, you can
create the archive in steps using the -m option.
For example, if foo contains the subdirectories tom, dick, and harry, you can
perform these commands:
to create a directory called foo.zip. The first command creates the foo.zip
directory, and the next two commands add to it. As each zip command completes, the
last created archive is deleted, making room for the next zip command to function.
Environment variables:
ZIPOPT A set of default options for zip. For example:
export ZIPOPT="-D"
Exit status:
0 The operation succeeded.
3 A generic error in the zipfile format was detected, but processing may have
completed successfully anyway; a warning was generated in the process.
4 zip was unable to allocate memory for one or more buffers during program
initialization.
5 A severe error in the zipfile format was detected; processing probably failed
immediately.
See also:
freeze, gzip, pax, tar, unzip
Backing Up and Recovering Data in the Neutrino User’s Guide
This appendix describes most of the environment variables that are commonly used
under QNX Neutrino.
For general information about setting environment variables, see the Configuring Your
Environment chapter of the Neutrino User’s Guide; for specific information, see the
related utilities and programs.
A
ABLANG A language code (e.g. en_CA for Canadian English) that a
multilingual Photon application uses to determine what language
to display.
For more information, see the International Language Support
chapter of the Photon Programmer’s Guide; for the currently
supported codes, see
/usr/photon/appbuilder/languages.def.
B
BROADCAST The dhcp.client passes this environment variable to the
/etc/dhcp/dhcp-up script. It indicates the client broadcast
address that was obtained from the server.
C
CMD_INT Slinger uses this environment variable to determine the pathname or
name of the shell program used to interpret the string passed to the
SSI command, exec cmd.
For more information, see slinger in the Utilities Reference.
CONTENT_LENGTH
Slinger sets this environment variable, for use by CGI scripts. It
indicates the length of the attached information in the case of a
POST.
For more information, see slinger in the Utilities Reference.
CONTENT_TYPE
Slinger sets this environment variable, for use by CGI scripts. It
indicates the type of the attached information in the case of a POST.
For more information, see slinger in the Utilities Reference.
D
DISPLAY The name of the physical display on which to draw.
DL_DEBUG If this environment variable is set, the shared library loader displays
debugging information about the libraries as they’re opened. The
value can be a comma-separated list of the following:
• all — display all debug messages.
• help — display a help message, and then exit.
• reloc — display relocation processing messages.
• libs — display information about shared objects being opened.
• statistics — display runtime linker statistics.
• lazyload — print lazy-load debug messages.
• debug — print various runtime linker debug messages.
A value of 1 (one) is the same as all.
DOCUMENT_ROOT
Slinger sets this environment variable, for use by CGI scripts. It
indicates the location of data files. (Same as
HTTPD_ROOT_DIR.)
For more information, see slinger in the Utilities Reference.
DONT_USE_LINK_UNLINK
Indicates to lpr to use rename() instead of link() or unlink().
E
EDITOR The path of the editor you’d like to use by default.
EXINIT Default elvis option settings. If set, the contents of this environment
variable are executed on startup as a series of ex commands.
F
FILENAME The dhcp.client passes this environment variable to the
/etc/dhcp/dhcp-up script. It indicates the filename supplied
in the server response.
FORWARDED Slinger sets this environment variable, for use by CGI scripts. It
indicates the name of the proxy server through which the web
page is being processed.
For more information, see slinger in the Utilities Reference.
FROM Slinger sets this environment variable, for use by CGI scripts. It
indicates the name of the remote client user.
For more information, see slinger in the Utilities Reference.
G
GATEWAY The dhcp.client passes this environment variable to the
/etc/dhcp/dhcp-up script. It indicates the gateway that the
client is to use.
GATEWAY_INTERFACE
Slinger sets this environment variable, for use by CGI scripts. It
indicates the name and version of the Common Gateway Interface
served on Slinger.
For more information, see slinger in the Utilities Reference.
GNUTARGET Specifies the target (output file format) for GNU utilities. For
more information, see the Selecting the Target System appendix
of the Utilities Reference.
H
HOME Your current working directory when you first log in. It’s
specified as one of the fields for each user in /etc/passwd.
For more information, see passwd in the Utilities Reference.
HOSTALIASES The name of a file containing aliases for hosts. For more
information, see gethostbyname() in the Library Reference.
HTTPD_ROOT_DIR
The name of the directory where Slinger looks for data files.
The default is /usr/local/httpd.
For more information, see slinger in the Utilities Reference.
HTTPD_ROOT_DOC
The name of the root document (e.g. index.html) in Slinger.
For more information, see slinger in the Utilities Reference.
HTTPD_SCRIPTALIAS
The directory where Slinger looks for the CGI executables.
For more information, see slinger in the Utilities Reference.
HTTP_ACCEPT Slinger sets this environment variable, for use by CGI scripts.
It indicates the MIME types that the client accepts, as given by
HTTP headers.
For more information, see slinger in the Utilities Reference.
HTTP_USER_AGENT
Slinger sets this environment variable, for use by CGI scripts.
It indicates the browser that the client is using to send requests.
For more information, see slinger in the Utilities Reference.
I
INTERFACE The dhcp.client passes this environment variable to the
/etc/dhcp/dhcp-up script. It indicates the interface that was
configured (e.g. en0).
J
J9PLUGIN_ARGS
Arguments passed to Browser Java plugins.
L
LANG The locale to use for the locale categories.
LDEMULATION Specifies the linker emulation. For more information, see the
Selecting the Target System appendix of the Utilities
Reference.
LD_BIND_NOW Affects lazy-load dependencies due to full symbol resolution.
Typically, it forces the loading of all lazy-load dependencies
(until all symbols have been resolved).
LD_DEBUG A synonym for DL_DEBUG. If you set both DL_DEBUG
and LD_DEBUG, then DL_DEBUG takes precedence.
LD_DEBUG_OUTPUT
The name of a file in which the dynamic linker writes its
output. By default, output is written to stderr.
LD_LIBRARY_PATH
A path to search for shared libraries for a native linker. For
more information, see ld in the Utilities Reference
LD_PRELOAD A list of full paths to the shared libraries on an ELF system
that you want to load before loading other libraries. Use a
colon (:) to separate the libraries in this list. You can use this
environment variable to add or change functionality when you
run a program. For setuid or setgid ELF binaries, only
libraries in the standard search directories that are also setuid
will be loaded. See ld in the Utilities Reference, and dlopen()
in the QNX Neutrino Library Reference.
LESSEDIT The editor prototype string (used for the v command in less).
LOCALDOMAIN The local domain name. For more information, see res_init()
in the Library Reference.
M
MAKEFLAGS A set of default options for make.
MALLOC_OPTIONS
Controls how calloc(), malloc(), and realloc() behave if you
specify a size of 0 (or a value of 0 for the n argument to calloc()).
The V (“System V”) and R (“use the realloc() behavior of QNX
Neutrino 6.4.0 and earlier”) columns below indicate how the
functions behave if the value of MALLOC_OPTIONS includes
that letter:
Function Default V R
calloc(n, 0) Non-NULL NULL No effect
malloc(0) Non-NULL NULL No effect
realloc(NULL, 0) Non-NULL NULL No effect
realloc(non-NULL, 0) Non-NULL NULL NULL
N
NAMESERVER1, NAMESERVER2
The dhcp.client passes these environment variables to the
/etc/dhcp/dhcp-up script. They indicate the nameservers that
the client is to use.
NAME_MAX The maximum permitted length of a component of a pathname.
NETMASK The dhcp.client passes this environment variable to the
/etc/dhcp/dhcp-up script. It indicates the client netmask that
was obtained from the server.
O
OPTIONx The dhcp.client passes these additional environment variables
(where x is the option number) to the /etc/dhcp/dhcp-up script.
P
PATH A colon-separated list of directories that are searched when the
shell looks for commands and .’d files. An empty string
resulting from a leading or trailing colon, or two adjacent
colons is treated as a ., the current directory.
For more information, see ksh in the Utilities Reference.
PATH_INFO Slinger sets this environment variable, for use by CGI scripts.
It indicates extra path information sent.
For more information, see slinger in the Utilities Reference.
PATH_MAX The maximum permitted length of a pathname.
PATH_TRANSLATED
Slinger sets this environment variable, for use by CGI scripts.
It’s the same as the PATH_INFO appended to the pathname in
HTTPD_ROOT_DIR.
For more information, see slinger in the Utilities Reference.
PHEXIT_DISABLE
Set this environment variable to turn off the Photon Login
dialog’s Exit button so that users won’t be able to exit to text
mode.
For more information, see phlogin in the Utilities Reference.
PHFONT The registered name of the font server (e.g. /dev/phfont).
For more information, see ph in the Utilities Reference.
PHFONT_USE_EXTERNAL
If this environment variable exists, io-graphics runs the
font manager as a separate process (see phfont) instead of
using phfont.so. You should set this environment variable
for systems that have remote clients accessing font services on
the host machine (e.g. phindows, phditto).
PHGFX The full command that you want the ph script to use instead of
the default commands to start the graphics driver.
PHINPUT The full command that you want the ph script to use instead of
the default commands to start the input driver.
PHINSTANCE The number of times that Photon has been instantiated. For
more information, see phlogin in the Utilities Reference.
PHOTON_PATH The name of the root directory containing Photon files (usually
/usr/photon). For more information, see ph in the Utilities
Reference.
PHWM The name of the Window Manager to start when you start
Photon. For more information, see ph in the Utilities
Reference.
PWM_PRINTSCRN_APP
The application to start when the Print Scrn key is pressed. The
default is snapshot.
PYTHONINSPECT
Inspect interactively after running the Python script, and force
prompts, even if stdin doesn’t appear to be a terminal.
PYTHONOPTIMIZE
Optimize the generated Python byte code.
PYTHONSTARTUP
The file to execute on interactive startup of Python (no default).
PYTHONUNBUFFERED
Use unbuffered binary for stdout and stderr. See the Python
documentation for details on internal buffering.
PYTHONVERBOSE
Make Python be verbose (trace import statements).
Q
QCC_CONF_PATH
The name of the directory that contains the configuration files
for qcc.
QNX_HELP_PATH
The location of the top-level QNX help. This environment
variable is used by helpviewer to locate help topics.
QNX_HELP_HOME_PAGE
The location of the “home page” for helpviewer.
QUERY_STRING Slinger sets this environment variable, for use by CGI scripts. It
indicates the raw query string sent from the remote client.
For more information, see slinger in the Utilities Reference.
R
REFERER Slinger sets this environment variable, for use by CGI scripts. It
indicates the URL of the HTML page that referred the remote client
to this web page.
For more information, see slinger in the Utilities Reference.
REMOTE_ADDR
Slinger sets this environment variable, for use by CGI scripts. It
indicates the IP address of the remote client.
For more information, see slinger in the Utilities Reference.
REMOTE_HOST
Slinger sets this environment variable, for use by CGI scripts. It
indicates the hostname of the remote client.
For more information, see slinger in the Utilities Reference.
REMOTE_IDENT
Slinger sets this environment variable, for use by CGI scripts. It
indicates the remote user name if supporting RFC 931 identification.
For more information, see slinger in the Utilities Reference.
REMOTE_PORT
Slinger sets this environment variable, for use by CGI scripts. It
indicates the port of the remote client.
For more information, see slinger in the Utilities Reference.
REMOTE_USER
Slinger sets this environment variable, for use by CGI scripts. It
indicates the user name used to validate authentication from the
remote client.
For more information, see slinger in the Utilities Reference.
REQUEST_METHOD
Slinger sets this environment variable, for use by CGI scripts. It
indicates the method by which the current web page was requested
(GET or POST).
For more information, see slinger in the Utilities Reference.
S
SCRIPT_NAME Slinger sets this environment variable, for use by CGI scripts.
It indicates the name of the script being executed.
For more information, see slinger in the Utilities Reference.
SERVER_ADMIN Slinger sets this environment variable, for use by CGI scripts.
It indicates the contact information of the administrator of
Slinger specified by Slinger’s -a option.
For more information, see slinger in the Utilities Reference.
SERVER_NAME Slinger sets this environment variable, for use by CGI scripts.
It indicates the name of the computer where Slinger is running.
T
TERM The terminal type.
TERMINFO The name of the directory for terminfo files; see tic in the Utilities
Reference.
TMPDIR The name of a directory where utilities can create temporary files.
U
USER The userid you used to login; the same as LOGNAME.
In this appendix. . .
Target selection 1991
Architecture selection 1992
Linker emulation selection 1993
This appendix describes how you can specify targets and architectures for the ELF
utilities.
The development tools automatically take care of this — you’ll probably never need to
worry about it.
You can specify three aspects of the target system to the utilities that work on ELF
files, each in several ways:
• linker emulation (which applies to the linker only) — a “personality” that specifies
default values for the target system.
In the following summaries, the lists of ways to specify values are in order of
decreasing precedence; the ways listed first override those listed later.
Target selection
A target is an object file format. A given target may be supported for multiple
architectures (see “Architecture selection”). A target selection may also have
variations for different operating systems or architectures.
The command to list valid target values is objdump -i (the first column of output
contains the relevant information). Some sample values are: elf32-i386,
elf32-littlemips, and elf32-powerpc.
Here’s how to specify the target for the ELF utilities:
ld Input target:
1 -b command-line option
2 TARGET script command (see “Option Commands” in
Using LD in the full online GNU documentation)
3 GNUTARGET environment variable
4 Default target of the selected linker emulation (see “Linker
emulation selection,” below)
Output target:
1 --oformat command-line option
2 OUTPUT_FORMAT script command (see “Option
Commands” in Using LD in the full online GNU
documentation)
3 Linker input target (see above).
Architecture selection
An architecture is a type of CPU on which an object file is to run. Its name may
contain a colon, separating the name of the processor family from the name of the
particular CPU.
The command to list valid architecture values is objdump -i. Sample values include
powerpc:commonand mips.
Here’s how to specify the architecture for the GNU utilities:
1 -m command-line option
In this appendix. . .
What’s new in the QNX Software Development Platform 6.5.0? 1997
What’s new in the QNX Software Development Platform 6.4.1? 2010
What’s new in the QNX Software Development Platform 6.4.0? 2019
What’s new in QNX Momentics 6.3.2? 2033
What’s new in the QNX Neutrino Core OS 6.3.2? 2035
What’s new in QNX Momentics 6.3.0 Service Pack 2? 2036
What’s new in QNX Momentics 6.3.0 Service Pack 1? 2037
What’s new in QNX Momentics 6.3.0? 2039
What’s new in QNX Momentics 6.2.1? 2043
This appendix describes the updates to this document in the following releases:
• New entries
• Deprecated content
• Changed content
• Errata
New entries
bison General-purpose parser generator (GNU)
devh-microtouch.so
Driver for Microtouch EXII USB touch devices
dnssec-dsfromkey
DNSSEC Delegation Signer resource record generation tool
dnssec-keyfromlabel
DNSSEC key generation tool
fontinfo A utility for displaying information about a font family.
m4 Macro processor (GNU)
mkbuild Build one or more IDE projects
mkcldr Convert CLDR text file to binary data for libqdb_cldr.so
/etc/moduli System moduli file for sshd
pci-bios-v2 Provide support for the PCI BIOS and Message Signaled
Interrupts (MSI).
pps Persistent Publish/Subscribe manager (QNX Neutrino)
scp Secure copy (remote file copy program)
sftp Secure file transfer program
sftp-server SFTP server subsystem
ssh OpenSSH SSH client: remote login program
ssh-add Add RSA or DSA identities to the authentication agent
ssh-agent Authentication agent
ssh-keygen Authentication key generation, management, and conversion
ssh-keyscan Gather SSH public keys
ssh-keysign SSH helper program for host-based authentication
˜/.ssh/ssh_config, /etc/ssh/ssh_config
OpenSSH SSH client configuration files
sshd OpenSSH SSH daemon
/etc/ssh/sshd_config
OpenSSH SSH daemon configuration file
startup-* options Generic options for startup programs (QNX Neutrino)
Deprecated content
• deva-ctrl-cs46xx.so
• rftp
• rtelnet
Changed content
applypatch By default, applypatch now installs the host-side files only
for the current host OS. There’s a new -H option that makes
applypatch install the host-side files for all host OSs.
devc-pty The pseudo-tty manager can now support up to 256 ptys, using
the naming scheme:
• pty[p-zP-T][0-9a-f] for the master device
• tty[p-zP-T][0-9a-f] for the slave device
devc-serpci The boards that this driver supports must use PCI I/O space for
the registers, and the ports must be contiguous in memory.
devf-generic, devf-ram
• We’ve added more information about controlling timestamps
with the -u option.
• The entry for devf-generic now includes a section that
describes the information that the driver produces when you
ask for verbose output.
devg-radeon.so If you use devg-radeon.so with two cards that have the same
vendor and device IDs, the driver fails.
devg-svga.so, devg-vesabios.so
These are “safe”, generic graphics drivers. However, they can
negatively impact the timing of a system and affect realtime
operations. We recommended you use an accelerated driver
instead, if at all possible.
devn-tigon3.so This network driver on the Dell PowerEdge 850 board runs only
up to 100 Mbit/s, and not 1000 Mbit/s. Other boards work well
at 1000 Mbit/s.
devnp-* Native io-pkt and ported NetBSD drivers don’t put entries
into the /dev/io-net namespace, so a waitfor command for
such an entry won’t work properly in buildfiles or scripts. Use
if_up -p instead; for example, instead of waitfor
/dev/io-net/en0, use if_up -p en0.
devnp-axe.so • The version of this driver that we ship is compiled for x86
only. If you want to use it on other platforms, download the
source code for it from Foundry27.
• The USB-Ethernet dongle sometimes drops packets when
used on slow systems or with UHCI. If you encounter
problems with this driver, use the legacy devn-asix.so
driver instead.
devnp-bcm1250.so, devnp-e1000.so, devnp-mpc85xx.so,
devnp-rtl8169.so, devnp-speedo.so
These drivers no longer accept the promiscuous option
because promiscuous mode is controlled by the stack itself. To
enable promiscuous mode, use a BIOCPROMISC ioctl()
command; there’s currently no way to do this from the
command line.
devnp-e1000.so, devnp-i82544.so
The SQE (Squelch Test Errors) counter isn’t applicable to these
drivers, so they use it to track the number of internal Rx FIFO
overruns, instead of counting them with the number of packets
lost because they ran out of descriptors.
The blacklist for the verify option now includes some bad
ISO9660:1999 SVD-mastering utilities.
fsysinfo Some of the statistics that this utility displays have changed,
because of the changes to io-blk.so (see below).
gf-calib • There’s a new -g option that lets you specify the GFI input
group to attach to.
ham To stop the HAM, you must use either the ham_stop() function
(see the High Availability Framework Developer’s Guide) or the
hamctrl utility.
hogs This utility gives you a rough idea of what’s happening in your
system. The documentation now describes the limitations on the
data.
! CAUTION: This could cause problems with scripts that assume that the shell never
matches these names.
link This utility now creates a hard link instead of a symbolic one.
lsm-qnet.so Once Qnet has a domain, you can’t set Qnet to not use a
domain; you can only change the domain.
mkdir Note that not all filesystems support the creation of directories.
mkefs, mketfs These utilities now support a mountperms attribute that you
can use in a buildfile to specify the permissions to use for
mountpoints. The default permissions are 0777 for mkefs, and
0755 for mketfs.
phs-to-* These utilities send any error messages to slogger; some may
also send messages to standard error.
phs-to-escp2 This entry now lists the models of printers that the utility
supports.
syslogd The documentation now explains when the log entry includes a
host name, and when it includes nto (indicating the local host).
tail If you use both -c and the deprecated -l option, the order of
the options is important.
unzip, zip We’ve updated zip to Info-Zip version 3.0, and unzip to
version 6.0. These versions provide large file support.
We’ve documented the -P option, which you can use to specify
a password to use to encrypt and unencrypt archive entries.
The versions of these utilities that we ship are for x86 targets
only. We don’t ship them for Linux hosts.
Errata
applypatch Invoke this utility as applypatch, not applypatch.py.
devb-umass, devh-egalax.so, devh-microtouch.so, devh-touchintl.so,
devh-usb.so, devn-asix.so, devu-kbd, devu-mouse, devu-prn
The default USB stack is /dev/io-usb/io-usb, not
/dev/usb.
gf-calib The option for specifying the layer index is -l (“el”), not -I.
mkdir The syntax for this utility isn’t the same on Windows as on QNX
Neutrino.
mkifs • We’ve corrected the example for the raw attribute: you don’t
need to specify this attribute in order to keep PhAB resources
in an executable.
• For MIPS targets, you need to create a symbolic link to
/proc/boot/libc.so.3 called ldqnx.so.3 instead of
ldqnx.so.2.
• New entries
• Deprecated content
• Changed content
• Errata
New entries
applypatch Install or uninstall a patch (QNX Neutrino)
devnp-rtl8169.so
Driver for Realtek 8169 Gigabit Ethernet controllers
ed Text editor
WARNING: Running this utility will destroy your current installation of QNX
Neutrino. The only reason we ship finstall is to allow customers to create a
custom installer boot image. This will likely happen only under the direction of
our support staff.
fs-mac.so Shared object that supports Apple Macintosh HFS (Hierarchical
File System) and HFS Plus (QNX Neutrino)
fs-nt.so Shared object that supports the Windows NT filesystem (QNX
Neutrino)
getty Set terminal modes for system access (NetBSD)
host DNS lookup utility
indent Format C source
ldd List the shared libraries that a program requires (Unix)
ln-w Create a “link” on Windows
lwresd Lightweight resolver daemon
mcs Manipulate the comment section of an object file
named-checkconf Tool for checking the syntax of a named configuration file
named-compilezone
Tool for converting a zone file
nsupdate Dynamic DNS update utility
op Run a command as someone else
patch Use the output from diff et al. to update a file (GNU)
qbinaudit Compare binaries to the officially distributed versions (QNX
Neutrino)
rndc Name server control utility
rndc-confgen Key-generation tool for rndc
rndc.conf Configuration file for rndc
showlicense Display the type of QNX license that’s currently active (QNX
Neutrino)
top Display system usage (Unix)
unifdef Remove ifdef’ed C/C++ lines
Deprecated content
devn-rtl8169.so
Replaced by devnp-rtl8169.so.
procnto-900-smp
Microkernel for PowerPC 900 series SMP processors.
Changed content
cam-disk.so It’s possible to specify a starting device number in the name=
option.
CAUTION: Specify device numbers only on a closed system where you know all the
chkfsys There’s a new -x option that makes chkfsys exit with detailed
error codes. Without this option, an exit status of 0 doesn’t
indicate that no problems were found with the filesystem(s).
cron There’s a new -s option that makes cron poll for jobs every
minute (to compensate for clock skew).
devb-ram The default amount of cache for a block I/O driver (15% of
system RAM) is too high for devb-ram; you should use the blk
cache=... option to reduce it.
devc-con, devc-con-hid
These managers support international keyboard layouts. You can
use the supplied US-101 or DE-102 (German) layout, or you can
define your own layout.
diskboot There’s a new -u option that you can use to override the options
passed to io-usb.
fs-qnx6.so The Power-Safe filesystem was designed for and is intended for
traditional rotating hard disk drive media. It can’t guarantee
power-safe robustness if the drive can’t ensure that data is flushed
to the storage medium. For more information, see “Required
properties of the device” in the entry for fs-qnx6.so.
case=asis|lower|upper
Control the case used to display ISO-9660
filenames.
format=list Set both the list of disk formats to support, as well
as the order in which they should be probed.
info=path The first character of the path can be + or -, and
this controls whether empty entries (metadata
descriptors not given a value) are shown in the
directory or not, respectively.
perms=[file_permissions][:directory_permissions]
The permissions to use for ISO9660 files,
directories, or both.
This filesystem also has a new vcd=num option that you can use
to set the number of raw VCD 2352-byte deblocking buffers.
fsysinfo The output now includes statistics about the number of pages
mapped in and released by the heap-allocation subsystem.
ftp We’re using a newer version of ftp, so we’ve updated the link to
the NetBSD documentation.
io-blk.so • We now explain how you can use the naming= option to
specify the naming scheme for devices and partitions.
! CAUTION: Use something other than the default (0#) scheme only on closed
systems, and at your own risk.
• We’ve updated the options:
- delwri — now specifies the delay time for delayed writes
on fixed and removable media.
- enumpart — set the order for enumerating disk partitions.
- hash — removed.
- nora — replaced by ra.
- priority — set the priority of periodic filesystem
callouts.
- ra — set the minimum and maximum size of the
read-ahead buffers.
- [no]rmv — don’t/do allow invalid mounts on removable
media (re-insert).
io-usb You can use the -P option to specify the priority of the server.
mkefs • You can specify a value of none for the filter attribute.
• You can use the -c option to specify a directory in which to
cache compressed files.
mketfs You can specify a value of none for the filter attribute.
mkifs • You can specify a value of none for the filter attribute.
• If you turn compression on with the +compress attribute, you
can optionally specify the algorithm by number.
mksbp This entry now describes how to build a System Builder project
that’s inside a workspace or just logically linked to one.
/etc/named.conf
Updated to reflect BIND9.
nfsd If you change the exports file, you can make nfsd aware of the
changes by either restarting it, or by sending it a SIGHUP signal.
ntpd, ntpdate For information about the associated configuration files, see
ntp.conf and ntp.keys in the FreeBSD documentation.
pci-bios All PCI servers have an -x option that prevents the server from
removing devices from the PCI bus while enumerating them.
QWinCfg Click the Show Packages.. button to display a list of the QNX
packages that you’ve installed on your system.
setkey We’ve updated the list of supported algorithms. This utility now
supports the 3des-deriv encryption algorithm.
tail The options for this utility now conform to POSIX; to copy a
given number of bytes, use the -c number option.
tftp There’s a new -e option and port argument, and several new
commands:
• blksize blk-size
• tout
• tsize
GNU binutils ( addr2line, ar, c++filt, gprof, ld, nm, objcopy, objdump,
ranlib, readelf, size, strings, strip)
For detailed documentation about these utilities, see the GNU
website at http://www.gnu.org/.
Errata
arp We’ve updated the documentation to reflect the currant usage
message.
devnp-i82544.so
• The default for the irq_thresh option is 9000.
• The default for the transmit option is 4096.
• This driver doesn’t support the promiscuous option; the
only way to enable promiscuous mode is by issuing an ioctl()
command.
devnp-mpc85xx.so, devnp-mpcsec.so
These drivers are shipped only with the BSPs that need them.
/etc/inetd.conf
A server doesn’t need to explicitly leave the master socket open
when it exits.
ldrel The -S option adds a note that specifies the maximum (not
minimum) stack size. If you don’t specify -L, the stack is
specified as non-lazy.
ntomulti-* variants
We’ve removed references to the ntomulti-* variants (which
we no longer ship) of addr2line, ar, gprof, nm, objcopy,
objdump, size, strings, and strip.
pppd Some of the options aren’t specific to QNX Neutrino, but aren’t
described in the NetBSD documentation.
uesh Starting in QNX SDP 6.4.0, uesh can accept a script file as an
argument. The micro-embedded shell doesn’t support filename
expansion, so * and ? aren’t special characters.
• New entries
• Deprecated content
• Changed content
• Errata
New entries
ap Create, modify, and query adaptive partitions for the thread
scheduler and memory allocator.
devh-touchintl.so
Driver for USB Touch International touch devices
devn-micrel8841.so
Driver for Micrel 8841 (1 port) or 8842 (2 port) Ethernet
controllers
devnp-axe.so Driver for USB (2.0) Ethernet adapters based on the ASIX
AX88172 chip
devnp-bcm1250.so
Driver for Broadcom BCM1250 10/100/1000 Mbit Ethernet
controllers
devnp-bcm43xx.so
Driver for the Broadcom-based 802.11b/g wireless Ethernet
controller
devnp-i82544.so Driver for Intel 82540, 82544, 82545, 82546, and 82547 Gigabit
Ethernet LAN adapters
devnp-mpc85xx.so
Driver for Freescale MPC85XX TSEC Ethernet controllers
devnp-ral.so, devnp-ural.so
Driver for wireless adapters based on the Ralink RT2500,
RT2501, RT2600, and RT2500USB chipsets
devnp-rum.so Driver for USB 2.0 wireless adapters based on the Ralink
RT2501USB and RT2601USB chipsets
devnp-speedo.so Driver for Intel 82557, 82558, and 82559 Fast Ethernet LAN
adapters
ifwatchd Watch for addresses added to or deleted from interfaces and call
up/down-scripts for them
lsm-pf-v4.so, lsm-pf-v6.so
Provide IP filter services
/etc/nsswitch.conf
Name-service switch configuration file. This file replaces the
lookup keyword in /etc/resolv.conf.
paste Merges lines of input files, and writes the resulting lines to
standard output. (POSIX)
pfctl Control the packet filter (PF) and network address translation
(NAT) device
tracelogger We’ve added the -A, -c, -P, and -R options and updated the
descriptions of the other options.
Deprecated content
continued. . .
• We’ve deleted the entries for the following drivers, some of which are for
unsupported or obsolete boards:
- deva-ctrl-cyberpro5.so
- deva-ctrl-tahoe.so
- devb-aha2
- devb-aha4
- devb-aha7
- devb-amd
- devb-ncr8
- devc-amctap, devc-tamctap
- devc_amctap_host
- devc-hspi
- devc-netrom540, devc-tnetrom540
- devc-ser2681, devc-tser2681
- devc-ser403, devc-tser403
- devc-ser8250-ixp2400, devc-tser8250-ixp2400
- devc-serdsiu, devc-tserdsiu
- devc-sergt64260
- devc-serppc800, devc-tserppc800
- devc-serpsc
- devc-sersci
- devc-tcon
- devc-tser8250
- devc-tserzscc
- devg-banshee.so
- devg-igs5000.so
- devg-mach64.so
- devg-matrox.so
- devg-mq200.so
- devg-neomagic.so
- devg-orchid.so
- devg-pxa250.so
- devg-q2sd.so
- devg-ravin.so
- devg-rotate90.so
- devg-rotate270.so
- devg-rpxlite.so
- devg-s3.so
- devg-sa1110.so
- devg-stpc.so
- devg-vga.so
- devgt-iographics
- devi-ahl
- devi-carrol
- devn-artesyn.so
- devn-bcm43xx.so
- devn-cpci-mcp750.so
- devn-eepro.so
- devn-el589.so
- devn-gt64260.so
- devn-klsi.so
- devn-lance.so
- devn-ne2000-403.so
- devn-ns83815.so
- devn-orinoco.so
- devn-ppc405.so
- devn-ppc800-ads.so
- devn-ppc800-cllf.so
- devn-ppc800-mbx.so
- devn-ppc800-rpxlite.so
- devn-ppc8260.so
- devn-ppc860_mii.so
- devn-prism.so
- devn-rlan2.so
- devn-tulip-p5064.so
- devn-wd.so
- pci-artesyn440
- pci-artesyn750fx
- pci-brh
- pci-cpc700
- pci-ixc1100
- pci-ixp2400
- pci-mpc8266
- pci-p5064
- pci-ppc440rb
- pci-raven
- pci-sandpoint
- pci-yellowknife
- startup-403evb
- startup-603evb
- startup-79s465
- startup-800fads
- startup-8260ads
- startup-artesyn
- startup-artesyn750fx
- startup-aspen
- startup-bigsur
- startup-cpci-6750
- startup-ddb-vrc5074
- startup-integrator
- startup-malta
- startup-mbx800
- startup-mcp750
- startup-mcpn765
- startup-mtx600
- startup-mvme
- startup-mvp
- startup-p5064
- startup-rpx-lite
- startup-sa1100-mm
- startup-sa1110-db
- startup-sandpoint
- startup-sengine
- startup-vme603
- startup-vr41xx
- startup-walnut
• We’ve removed the entries for board-specific devf-* drivers. All the flash
filesystem drivers use the same options as devf-generic.
Changed content
cam-cdrom.so, cam-disk.so, cam-optical.so
We’ve documented the retries, timeout, and verbose
options.
devf-generic, devf-ram
The maximum number of threads that you can specify with the
-t option has increased from 4 to 100.
devn-speedo.so We’ve added the probe_phy option, which you can use to
enable or disable the probing of the PHY device.
dumper There’s a new -z option that makes dumper compress the core
files.
• codepage — these names are also used for the volume label
• compat — supports a value of os2
• fat — new
ftp, ftpd We now use the NetBSD 4.0 version of these programs, although
ftpd also supports the -n option that was added after version
4.0.
gzip You can now use gzip to compress or expand files in a RAM
filesystem (/dev/shmem), but you need to specify the -f option.
ksh You can now use the Tab key to complete the names of files and
commands.
mkifs • We’ve added the cpu modifier to the description of script files.
• The /usr/lib/ldqnx.so.2 symbolic link should now
point to /proc/boot/libc.so.3, and you should include
libc.so.2 in the list of binaries before libc.so.
• The documentation now describes the -s option and the
+|-page_align attribute.
• We’ve updated the default linker specification.
pppd For information about this daemon (including exit codes), see the
NetBSD documentation. We’ve documented the options that are
specific to Neutrino.
pidin We’ve added more details about the information that the fds
shorthand gives.
pppoed This binary is now simply a shim layer that phdialer uses to
dial up PPPOE.
procnto* • If you’re using an SMP version of procnto, you can use the
appropriate startup-* command’s -P option to specify the
maximum number of CPUs to activate.
• There’s a new procnto-v6 version of the kernel that
supports ARMv6 processors.
• There are new procnto-900 and procnto-900-smp
versions of the kernel that support PowerPC 900 series
processors.
• New options:
- -en and -eo — control the value of EALREADY, which is
changing so that it will be POSIX-compliant. For more
information, see “Changes to EALREADY” in the entry for
errno in the Neutrino Library Reference.
- -mP — turn on full allocation of high memory for all
processes. This is mostly useful only for testing.
- -m˜P — make sure that all anonymous allocation occurs
below the 4 GB mark (the default).
qconfig This utility doesn’t list the installed packages in any particular
order.
rtsold This daemon now has an -a option that lets you autoprobe the
outgoing interface.
rwhod This daemon now has -i and -u options for setting the broadcast
interval and the user to run as.
slay If you change the runmask for a process, the processor for
blocked threads doesn’t change until the threads become
unblocked (or never if the threads remain blocked).
slogger There’s a new -c option that you can use to open the log file with
O_SYNC to forcibly commit the logged events to the disk.
tftpd We now use the NetBSD 3.0 version of this daemon, so the
options have changed.
which We’ve added the -s option, which makes the utility search for
shared objects in the directories identified by the
LD_LIBRARY_PATH environment variable and the
_CS_LIBPATH configuration string.
Errata
calib We’ve corrected the list of options.
chkfsys This utility doesn’t prevent itself from operating when files are open
for writing on the drive.
crontab If you want the output from your commands, redirect it to a file.
devf-* • If you specify the -V option, the driver displays the filesystem and
MTD version information, and then exits.
• The bwidth and ileave values for the -s option must be powers of
2, but you don’t specify them as powers of 2. For example, if the
width of the data bus is 8, specify a bwidth of 8, not 3 (for 23 ).
lpr The printer argument to the -P option must be a printer name that’s
defined in /etc/printcap.
mkifs • You can use mkifs to build nonbootable images. For an example,
see the Making Multiple Images technote.
• You have to specify both image and ram file attributes if you want
to create the image in ROM/FLASH; otherwise the process
manager assumes that the image is in RAM.
• The mkifs utilities no longer strips the QNX_Phab (Photon
resources), QNX_usage (usage message), and QNX_info (build
properties) sections by default. You can use the -s option to
specify additional sections not to be stripped.
• Startup code can be decompressed in place.
• Attributes that you specify with attr=image_attribute in the
bootfile are processed after the -l (“el”) command-line options
and the buildfile, but you normally use the ? prefix on the
image_attribute, so that it doesn’t override anything explicitly set
by the -l option or the buildfile.
ntpd After the machine has synchronized to a NTP server, the operating
system time gets synchronized and corrected from time to time. This
doesn’t set the hardware clock; you can use the rtc utility to set the
time on the chip.
pidin If you use pidin thread or pidin -F%h to display the thread
names, and a thread doesn’t have a name, pidin displays the thread’s
ID (tid) instead.
renice This utility changes the priority of all the threads in the specified
process or processes.
• New entries
• Changed content
• Errata
New entries
devb-umass • There’s a new iface= option for specifying the interface
number of the device.
• There’s a new ignore_csw option that makes the driver
ignore the Command Status Wrapper.
devg-carmine.so
Graphics driver for Fujitsu Carmine chipsets
devg-extreme2.so
Graphics driver for Intel Extreme2 chipsets
devn-rtl8150.so
Driver for SMC2208 USB/Ethernet adapters
startup-bios The -I option is now documented. You can use this option to
specify the highest-priority hardware interrupt.
use There’s a new -s option that you can use to display the version
numbers of the source used in the executable.
Changed content
devc-sersci Added the default values for the -r option for SH7770 and
SH7780.
flashctl This utility rounds the values of the -o and -l (“el”) options down
to the nearest block bound. If the range specified exceeds the
partition size, it’s rounded down to fit. If you use the -v option,
flashctl displays what the values have been rounded to.
mkifs This entry now describes the main bootfiles, including raw.boot,
elf.boot, binary.boot, and srec.boot; see the “Bootfile”
section.
You might need to use the perms attribute to specify execute,
setuid, and setgid permissions if you’re running mkifs on a
Windows host.
mount Added the before and after options, and added io-usb to the
table of mount types.
pidin The CPU usage that pidin times reports are approximate, and
can be inaccurate.
setuid utilities The following utilities need to have the setuid bit set in their
permissions: crontab; dhcp.client; fontsleuth;
input-cfg; inputtrap; login; lpr; lprq; lprrm; netstat;
newgrp; passwd; phfont; phgrafx; phlocale; Photon;
phshutdown; phuser; ping; ping6; pppd; pppoed;
qnxinstall; rcp; rlogin; rsh; su; traceroute;
traceroute6.
Errata
devf-* We’ve corrected the description of the -r option for the devf-*
drivers. You should always specify this option, unless you’re
debugging a problem concerning filesystem corruption.
show_vesa You must log in as root and be in text mode — not Photon — to run
this utility. This utility doesn’t have any options.
stty The stty under Neutrino doesn’t support the lkhflow or lksflow
option.
• New entries
• Changed content
• Errata
New entries
aps Manage adaptive scheduler partitions
Changed content
devb-ram Added address, blksize, and nodinit to the list of ram options.
mkifs Now includes the module attribute for loading optional modules into
procnto.
on Now includes -C, -i, and -R options for specifying the runmask for
the new process.
startup-* Now include a -F option to control the flags field in the cpuinfo
section of the system page.
qconfig Added the -a, -b, and -p options.
Errata
dcheck Corrected the name of the .bad_blks file.
passwd The second field of entries in the /etc/passwd file is an x. It represents
the group password, which Neutrino doesn’t support.
• New entries
• Changed content
• Errata
New entries
addr2line Convert addresses into line number/file name pairs
bindres Bind widget resources into an executable
c++filt Demangle C++ and Java symbols
g++ Compile a program
mq A new server to manage POSIX message queues. This is an alternate
implementation that uses asynchronous messages
phfind Photon file search utility
ranlib Index an archive
Changed content
devg-* Changed the -amode option in all the devg-* driver docs to
mode_opt
tracelogger Now accepts control commands through its device, devctl() and
pulses, and has a new option (-c).
usemsg %1> and %2> macros fixed (were previously documented as %0>
and %1>).
usemsg also uses objcopy by default instead of ldrel.
Errata
io-blk.so If you don’t specify a full path for the device in the automount
option, io-blk.so uses the value of its devdir option as a prefix.
• New entries
• Changed content
New entries
dumpefs Dump an embedded filesystem
Changed content
bootpd Now included in the Neutrino runtime.
phfont Added the new -b option to save font usage information to a file.
• New entries
• Deleted entries
• Changed content
• Errata
New entries
bkgdmgr Photon background manager
devc-ser8250-ixp2400
Serial driver for Intel IXP425 BSP
devg-rotate90.so
Transform module used for graphics rotation
devg-rotate270.so
Transform module used for graphics rotation
devu-ehci.so Driver for Enhanced Host Controller Interface (EHCI) for USB
2.0
devu-ohci.so Driver for Open Host Controller Interface (OHCI) for USB 2.0
devu-uhci.so Driver for Universal Host Controller Interface (UHCI) for USB
2.0
ipfs Save and restore information for NAT and stat tables
lsm-ipfilter-*.so
Provide IP filter services
npm-qnet-compat.so
Native QNX Neutrino network manager — compatible version
npm-qnet-l4_lite.so
Lightweight version of native QNX Neutrino network manager
npm-tcpip-v6.so The full TCP/IP stack for IPv6 packets (QNX Neutrino)
ntpdate Set the local time and date by polling NTP servers
startup-artesyn750fx
Startup for the Artesyn PM/PPC 750FX evaluation board
Deleted entries
cl-installer Use qnxinstall instead.
plaympegaudio_noph
Deprecated; replaced by playaudio
devg-chips-hiqv.so
This driver is deprecated.
Changed content
devp-pccard Added new options to the documentation.
io-graphics There are several changes to the documentation for this utility,
including a description of crtc-settings file support, a new
command line syntax, and a description of the configuration file
and multiple display support.
phlogin Described a configuration file for your shell to run as a login shell.
savercfg Added new GUI, which includes the option to use the system
password, and power saver options. The location of the
saver.cfg file has also changed.
Errata
ksh Deleted the -F option.
• New entries
• Deleted entries
• Changed content
• Errata
New entries
addvariant Add a new OS/CPU/VARIANT directory structure to a source
tree
devc_amctap_host
Windows host server for devc-amctap
Deleted entries
ci Check in RCS revisions (UNIX)
Changed content
devb-eide Added the lba48 option.
devg-radeon.so
The DVI (digital video interface) is enabled by default, so you can
connect LCD panels to your Radeon cards. The only requirement is
that you connect the LCD to the DVI connector at boot time so the
video BIOS can set up the digital output.
devn-* The verbose option has been standardized and its output now goes
to slogger (view using sloginfo).
mkifs Clarified the type note and added the dperms attribute
ph You can now use the PHGFX and PHINPUT environment variables
to specify the commands that you want to use to start the graphics
and input drivers.
pidin Added the irqs, net, rc, and timers shorthand names.
Errata
phshutdown, shutdown
Corrected SIGPWR to SIGTERM
A20 gate
On x86-based systems, a hardware component that forces the A20 address line on the
bus to zero, regardless of the actual setting of the A20 address line on the processor.
This component is in place to support legacy systems, but the QNX Neutrino OS
doesn’t require any such hardware. Note that some processors, such as the 386EX,
have the A20 gate hardware built right into the processor itself — our IPL will disable
the A20 gate as soon as possible after startup.
adaptive
Scheduling policy whereby a thread’s priority is decayed by 1. See also FIFO, round
robin, and sporadic.
adaptive partitioning
A method of dividing, in a flexible manner, CPU time, memory, file resources, or
kernel resources with some policy of minimum guaranteed usage.
atomic
Of or relating to atoms. :-)
In operating systems, this refers to the requirement that an operation, or sequence of
operations, be considered indivisible. For example, a thread may need to move a file
position to a given location and read data. These operations must be performed in an
atomic manner; otherwise, another thread could preempt the original thread and move
the file position to a different location, thus causing the original thread to read data
from the second thread’s position.
attributes structure
Structure containing information used on a per-resource basis (as opposed to the
OCB, which is used on a per-open basis).
This structure is also known as a handle. The structure definition is fixed
(iofunc_attr_t), but may be extended. See also mount structure.
bank-switched
A term indicating that a certain memory component (usually the device holding an
image) isn’t entirely addressable by the processor. In this case, a hardware component
manifests a small portion (or “window”) of the device onto the processor’s address
bus. Special commands have to be issued to the hardware to move the window to
different locations in the device. See also linearly mapped.
block-integral
The requirement that data be transferred such that individual structure components are
transferred in their entirety — no partial structure component transfers are allowed.
In a resource manager, directory data must be returned to a client as block-integral
data. This means that only complete struct dirent structures can be returned —
it’s inappropriate to return partial structures, assuming that the next _IO_READ
request will “pick up” where the previous one left off.
bootable
An image can be either bootable or nonbootable. A bootable image is one that
contains the startup code that the IPL can transfer control to.
bootfile
The part of an OS image that runs the startup code and the Neutrino microkernel.
budget
In sporadic scheduling, the amount of time a thread is permitted to execute at its
normal priority before being dropped to its low priority.
buildfile
A text file containing instructions for mkifs specifying the contents and other details
of an image, or for mkefs specifying the contents and other details of an embedded
filesystem image.
canonical mode
Also called edited mode or “cooked” mode. In this mode the character device library
performs line-editing operations on each received character. Only when a line is
“completely entered” — typically when a carriage return (CR) is received — will the
line of data be made available to application processes. Contrast raw mode.
channel
A kernel object used with message passing.
In QNX Neutrino, message passing is directed towards a connection (made to a
channel); threads can receive messages from channels. A thread that wishes to receive
messages creates a channel (using ChannelCreate()), and then receives messages from
that channel (using MsgReceive()). Another thread that wishes to send a message to
the first thread must make a connection to that channel by “attaching” to the channel
(using ConnectAttach()) and then sending data (using MsgSend()).
chid
An abbreviation for channel ID.
CIFS
Common Internet File System (aka SMB) — a protocol that allows a client
workstation to perform transparent file access over a network to a Windows 95/98/NT
server. Client file access calls are converted to CIFS protocol requests and are sent to
the server over the network. The server receives the request, performs the actual
filesystem operation, and sends a response back to the client.
CIS
Card Information Structure — a data block that maintains information about flash
configuration. The CIS description includes the types of memory devices in the
regions, the physical geometry of these devices, and the partitions located on the flash.
coid
An abbreviation for connection ID.
combine message
A resource manager message that consists of two or more messages. The messages are
constructed as combine messages by the client’s C library (e.g. stat(), readblock()),
and then handled as individual messages by the resource manager.
The purpose of combine messages is to conserve network bandwidth and/or to provide
support for atomic operations. See also connect message and I/O message.
connect message
In a resource manager, a message issued by the client to perform an operation based
on a pathname (e.g. an io_open message). Depending on the type of connect
message sent, a context block (see OCB) may be associated with the request and will
be passed to subsequent I/O messages. See also combine message and I/O message.
connection
A kernel object used with message passing.
Connections are created by client threads to “connect” to the channels made available
by servers. Once connections are established, clients can MsgSendv() messages over
them. If a number of threads in a process all attach to the same channel, then the one
connection is shared among all the threads. Channels and connections are identified
within a process by a small integer.
The key thing to note is that connections and file descriptors (FD) are one and the
same object. See also channel and FD.
context
Information retained between invocations of functionality.
When using a resource manager, the client sets up an association or context within the
resource manager by issuing an open() call and getting back a file descriptor. The
resource manager is responsible for storing the information required by the context
(see OCB). When the client issues further file-descriptor based messages, the resource
manager uses the OCB to determine the context for interpretation of the client’s
messages.
cooked mode
See canonical mode.
core dump
A file describing the state of a process that terminated abnormally.
critical section
A code passage that must be executed “serially” (i.e. by only one thread at a time).
The simplest from of critical section enforcement is via a mutex.
deadlock
A condition in which one or more threads are unable to continue due to resource
contention. A common form of deadlock can occur when one thread sends a message
to another, while the other thread sends a message to the first. Both threads are now
waiting for each other to reply to the message. Deadlock can be avoided by good
design practices or massive kludges — we recommend the good design approach.
device driver
A process that allows the OS and application programs to make use of the underlying
hardware in a generic way (e.g. a disk drive, a network interface). Unlike OSs that
require device drivers to be tightly bound into the OS itself, device drivers for QNX
Neutrino are standard processes that can be started and stopped dynamically. As a
result, adding device drivers doesn’t affect any other part of the OS — drivers can be
developed and debugged like any other application. Also, device drivers are in their
own protected address space, so a bug in a device driver won’t cause the entire OS to
shut down.
DNS
Domain Name Service — an Internet protocol used to convert ASCII domain names
into IP addresses. In QNX native networking, dns is one of Qnet’s builtin resolvers.
dynamic bootfile
An OS image built on the fly. Contrast static bootfile.
dynamic linking
The process whereby you link your modules in such a way that the Process Manager
will link them to the library modules before your program runs. The word “dynamic”
here means that the association between your program and the library modules that it
uses is done at load time, not at linktime. Contrast static linking. See also runtime
loading.
edge-sensitive
One of two ways in which a PIC (Programmable Interrupt Controller) can be
programmed to respond to interrupts. In edge-sensitive mode, the interrupt is
“noticed” upon a transition to/from the rising/falling edge of a pulse. Contrast
level-sensitive.
edited mode
See canonical mode.
EOI
End Of Interrupt — a command that the OS sends to the PIC after processing all
Interrupt Service Routines (ISR) for that particular interrupt source so that the PIC can
reset the processor’s In Service Register. See also PIC and ISR.
EPROM
Erasable Programmable Read-Only Memory — a memory technology that allows the
device to be programmed (typically with higher-than-operating voltages, e.g. 12V),
with the characteristic that any bit (or bits) may be individually programmed from a 1
state to a 0 state. To change a bit from a 0 state into a 1 state can only be accomplished
by erasing the entire device, setting all of the bits to a 1 state. Erasing is accomplished
by shining an ultraviolet light through the erase window of the device for a fixed
period of time (typically 10-20 minutes). The device is further characterized by having
a limited number of erase cycles (typically 10e5 - 10e6). Contrast flash and RAM.
event
A notification scheme used to inform a thread that a particular condition has occurred.
Events can be signals or pulses in the general case; they can also be unblocking events
or interrupt events in the case of kernel timeouts and interrupt service routines. An
event is delivered by a thread, a timer, the kernel, or an interrupt service routine when
appropriate to the requestor of the event.
FD
File Descriptor — a client must open a file descriptor to a resource manager via the
open() function call. The file descriptor then serves as a handle for the client to use in
subsequent messages. Note that a file descriptor is the exact same object as a
connection ID (coid, returned by ConnectAttach()).
FIFO
First In First Out — a scheduling policy whereby a thread is able to consume CPU at
its priority level without bounds. See also adaptive, round robin, and sporadic.
flash memory
A memory technology similar in characteristics to EPROM memory, with the
exception that erasing is performed electrically instead of via ultraviolet light, and,
depending upon the organization of the flash memory device, erasing may be
accomplished in blocks (typically 64 KB at a time) instead of the entire device.
Contrast EPROM and RAM.
FQNN
Fully Qualified Node Name — a unique name that identifies a QNX Neutrino node on
a network. The FQNN consists of the nodename plus the node domain tacked together.
garbage collection
Aka space reclamation, the process whereby a filesystem manager recovers the space
occupied by deleted files and directories.
HA
High Availability — in telecommunications and other industries, HA describes a
system’s ability to remain up and running without interruption for extended periods of
time.
handle
A pointer that the resource manager base library binds to the pathname registered via
resmgr_attach(). This handle is typically used to associate some kind of per-device
information. Note that if you use the iofunc_*() POSIX layer calls, you must use a
particular type of handle — in this case called an attributes structure.
image
In the context of embedded QNX Neutrino systems, an “image” can mean either a
structure that contains files (i.e. an OS image) or a structure that can be used in a
read-only, read/write, or read/write/reclaim FFS-2-compatible filesystem (i.e. a flash
filesystem image).
inherit mask
A bitmask that specifies which processors a thread’s children can run on. Contrast
runmask.
interrupt
An event (usually caused by hardware) that interrupts whatever the processor was
doing and asks it do something else. The hardware will generate an interrupt whenever
it has reached some state where software intervention is required.
interrupt handler
See ISR.
interrupt latency
The amount of elapsed time between the generation of a hardware interrupt and the
first instruction executed by the relevant interrupt service routine. Also designated as
“Til ”. Contrast scheduling latency.
I/O message
A message that relies on an existing binding between the client and the resource
manager. For example, an _IO_READ message depends on the client’s having
previously established an association (or context) with the resource manager by
issuing an open() and getting back a file descriptor. See also connect message,
context, combine message, and message.
I/O privileges
A particular right, that, if enabled for a given thread, allows the thread to perform I/O
instructions (such as the x86 assembler in and out instructions). By default, I/O
privileges are disabled, because a program with it enabled can wreak havoc on a
system. To enable I/O privileges, the thread must be running as root, and call
ThreadCtl().
IPC
Interprocess Communication — the ability for two processes (or threads) to
communicate. QNX Neutrino offers several forms of IPC, most notably native
messaging (synchronous, client/server relationship), POSIX message queues and pipes
(asynchronous), as well as signals.
IPL
Initial Program Loader — the software component that either takes control at the
processor’s reset vector (e.g. location 0xFFFFFFF0 on the x86), or is a BIOS extension.
This component is responsible for setting up the machine into a usable state, such that
the startup program can then perform further initializations. The IPL is written in
assembler and C. See also BIOS extension signature and startup code.
IRQ
Interrupt Request — a hardware request line asserted by a peripheral to indicate that it
requires servicing by software. The IRQ is handled by the PIC, which then interrupts
the processor, usually causing the processor to execute an Interrupt Service Routine
(ISR).
ISR
Interrupt Service Routine — a routine responsible for servicing hardware (e.g. reading
and/or writing some device ports), for updating some data structures shared between
the ISR and the thread(s) running in the application, and for signalling the thread that
some kind of event has occurred.
kernel
See microkernel.
level-sensitive
One of two ways in which a PIC (Programmable Interrupt Controller) can be
programmed to respond to interrupts. If the PIC is operating in level-sensitive mode,
the IRQ is considered active whenever the corresponding hardware line is active.
Contrast edge-sensitive.
linearly mapped
A term indicating that a certain memory component is entirely addressable by the
processor. Contrast bank-switched.
message
A parcel of bytes passed from one process to another. The OS attaches no special
meaning to the content of a message — the data in a message has meaning for the
sender of the message and for its receiver, but for no one else.
Message passing not only allows processes to pass data to each other, but also
provides a means of synchronizing the execution of several processes. As they send,
receive, and reply to messages, processes undergo various “changes of state” that
affect when, and for how long, they may run.
microkernel
A part of the operating system that provides the minimal services used by a team of
optional cooperating processes, which in turn provide the higher-level OS
functionality. The microkernel itself lacks filesystems and many other services
normally expected of an OS; those services are provided by optional processes.
mount structure
An optional, well-defined data structure (of type iofunc_mount_t) within an
iofunc_*() structure, which contains information used on a per-mountpoint basis
(generally used only for filesystem resource managers). See also attributes structure
and OCB.
mountpoint
The location in the pathname space where a resource manager has “registered” itself.
For example, the serial port resource manager registers mountpoints for each serial
multicore system
A chip that has one physical processor with multiple CPUs interconnected over a
chip-level bus.
mutex
Mutual exclusion lock, a simple synchronization service used to ensure exclusive
access to data shared between threads. It is typically acquired (pthread_mutex_lock())
and released (pthread_mutex_unlock()) around the code that accesses the shared data
(usually a critical section). See also critical section.
name resolution
In a QNX Neutrino network, the process by which the Qnet network manager converts
an FQNN to a list of destination addresses that the transport layer knows how to get to.
name resolver
Program code that attempts to convert an FQNN to a destination address.
nd
An abbreviation for node descriptor, a numerical identifier for a node relative to the
current node. Each node’s node descriptor for itself is 0 (ND_LOCAL_NODE).
NDP
Node Discovery Protocol — proprietary QNX Software Systems protocol for
broadcasting name resolution requests on a QNX Neutrino LAN.
network directory
A directory in the pathname space that’s implemented by the Qnet network manager.
Neutrino
Name of an OS developed by QNX Software Systems.
NFS
Network FileSystem — a TCP/IP application that lets you graft remote filesystems (or
portions of them) onto your local namespace. Directories on the remote systems
appear as part of your local filesystem and all the utilities you use for listing and
managing files (e.g. ls, cp, mv) operate on the remote files exactly as they do on your
local files.
NMI
Nonmaskable Interrupt — an interrupt that can’t be masked by the processor. We
don’t recommend using an NMI!
node domain
A character string that the Qnet network manager tacks onto the nodename to form an
FQNN.
nodename
A unique name consisting of a character string that identifies a node on a network.
nonbootable
A nonbootable OS image is usually provided for larger embedded systems or for small
embedded systems where a separate, configuration-dependent setup may be required.
Think of it as a second “filesystem” that has some additional files on it. Since it’s
nonbootable, it typically won’t contain the OS, startup file, etc. Contrast bootable.
OCB
Open Control Block (or Open Context Block) — a block of data established by a
resource manager during its handling of the client’s open() function. This context
block is bound by the resource manager to this particular request, and is then
automatically passed to all subsequent I/O functions generated by the client on the file
descriptor returned by the client’s open().
package filesystem
A virtual filesystem manager that presents a customized view of a set of files and
directories to a client. The “real” files are present on some medium; the package
filesystem presents a virtual view of selected files to the client.
partition
A division of CPU time, memory, file resources, or kernel resources with some policy
of minimum guaranteed usage.
pathname prefix
See mountpoint.
persistent
When applied to storage media, the ability for the medium to retain information across
a power-cycle. For example, a hard disk is a persistent storage medium, whereas a
ramdisk is not, because the data is lost when power is lost.
Photon microGUI
The proprietary graphical user interface built by QNX Software Systems.
PIC
Programmable Interrupt Controller — hardware component that handles IRQs. See
also edge-sensitive, level-sensitive, and ISR.
PID
Process ID. Also often pid (e.g. as an argument in a function call).
POSIX
An IEEE/ISO standard. The term is an acronym (of sorts) for Portable Operating
System Interface — the “X” alludes to “UNIX”, on which the interface is based.
preemption
The act of suspending the execution of one thread and starting (or resuming) another.
The suspended thread is said to have been “preempted” by the new thread. Whenever
a lower-priority thread is actively consuming the CPU, and a higher-priority thread
becomes READY, the lower-priority thread is immediately preempted by the
higher-priority thread.
prefix tree
The internal representation used by the Process Manager to store the pathname table.
priority inheritance
The characteristic of a thread that causes its priority to be raised or lowered to that of
the thread that sent it a message. Also used with mutexes. Priority inheritance is a
method used to prevent priority inversion.
priority inversion
A condition that can occur when a low-priority thread consumes CPU at a higher
priority than it should. This can be caused by not supporting priority inheritance, such
that when the lower-priority thread sends a message to a higher-priority thread, the
higher-priority thread consumes CPU on behalf of the lower-priority thread. This is
solved by having the higher-priority thread inherit the priority of the thread on whose
behalf it’s working.
process
A nonschedulable entity, which defines the address space and a few data areas. A
process must have at least one thread running in it — this thread is then called the first
thread.
process group
A collection of processes that permits the signalling of related processes. Each process
in the system is a member of a process group identified by a process group ID. A
newly created process joins the process group of its creator.
process group ID
The unique identifier representing a process group during its lifetime. A process group
ID is a positive integer. The system may reuse a process group ID after the process
group dies.
process ID (PID)
The unique identifier representing a process. A PID is a positive integer. The system
may reuse a process ID after the process dies, provided no existing process group has
the same ID. Only the Process Manager can have a process ID of 1.
pty
Pseudo-TTY — a character-based device that has two “ends”: a master end and a
slave end. Data written to the master end shows up on the slave end, and vice versa.
These devices are typically used to interface between a program that expects a
character device and another program that wishes to use that device (e.g. the shell and
the telnet daemon process, used for logging in to a system over the Internet).
pulses
In addition to the synchronous Send/Receive/Reply services, QNX Neutrino also
supports fixed-size, nonblocking messages known as pulses. These carry a small
payload (four bytes of data plus a single byte code). A pulse is also one form of event
that can be returned from an ISR or a timer. See MsgDeliverEvent() for more
information.
Qnet
The native network manager in QNX Neutrino.
QoS
Quality of Service — a policy (e.g. loadbalance) used to connect nodes in a
network in order to ensure highly dependable transmission. QoS is an issue that often
arises in high-availability (HA) networks as well as realtime control systems.
RAM
Random Access Memory — a memory technology characterized by the ability to read
and write any location in the device without limitation. Contrast flash and EPROM.
raw mode
In raw input mode, the character device library performs no editing on received
characters. This reduces the processing done on each character to a minimum and
provides the highest performance interface for reading data. Also, raw mode is used
with devices that typically generate binary data — you don’t want any translations of
the raw binary stream between the device and the application. Contrast canonical
mode.
replenishment
In sporadic scheduling, the period of time during which a thread is allowed to
consume its execution budget.
reset vector
The address at which the processor begins executing instructions after the processor’s
reset line has been activated. On the x86, for example, this is the address 0xFFFFFFF0.
resource manager
A user-level server program that accepts messages from other programs and,
optionally, communicates with hardware. QNX Neutrino resource managers are
responsible for presenting an interface to various types of devices, whether actual (e.g.
serial ports, parallel ports, network cards, disk drives) or virtual (e.g. /dev/null, a
network filesystem, and pseudo-ttys).
In other operating systems, this functionality is traditionally associated with device
drivers. But unlike device drivers, QNX Neutrino resource managers don’t require
any special arrangements with the kernel. In fact, a resource manager looks just like
any other user-level program. See also device driver.
RMA
Rate Monotonic Analysis — a set of methods used to specify, analyze, and predict the
timing behavior of realtime systems.
round robin
A scheduling policy whereby a thread is given a certain period of time to run. Should
the thread consume CPU for the entire period of its timeslice, the thread will be placed
at the end of the ready queue for its priority, and the next available thread will be made
READY. If a thread is the only thread READY at its priority level, it will be able to
consume CPU again immediately. See also adaptive, FIFO, and sporadic.
runmask
A bitmask that indicates which processors a thread can run on. Contrast inherit mask.
runtime loading
The process whereby a program decides while it’s actually running that it wishes to
load a particular function from a library. Contrast static linking.
scheduling latency
The amount of time that elapses between the point when one thread makes another
thread READY and when the other thread actually gets some CPU time. Note that this
latency is almost always at the control of the system designer.
Also designated as “Tsl ”. Contrast interrupt latency.
scoid
An abbreviation for server connection ID.
session
A collection of process groups established for job control purposes. Each process
group is a member of a session. A process belongs to the session that its process group
belongs to. A newly created process joins the session of its creator. A process can alter
its session membership via setsid(). A session can contain multiple process groups.
session leader
A process whose death causes all processes within its process group to receive a
SIGHUP signal.
software interrupts
Similar to a hardware interrupt (see interrupt), except that the source of the interrupt
is software.
sporadic
A scheduling policy whereby a thread’s priority can oscillate dynamically between a
“foreground” or normal priority and a “background” or low priority. A thread is given
an execution budget of time to be consumed within a certain replenishment period.
See also adaptive, FIFO, and round robin.
startup code
The software component that gains control after the IPL code has performed the
minimum necessary amount of initialization. After gathering information about the
system, the startup code transfers control to the OS.
static bootfile
An image created at one time and then transmitted whenever a node boots. Contrast
dynamic bootfile.
static linking
The process whereby you combine your modules with the modules from the library to
form a single executable that’s entirely self-contained. The word “static” implies that
it’s not going to change — all the required modules are already combined into one.
thread
The schedulable entity under QNX Neutrino. A thread is a flow of execution; it exists
within the context of a process.
tid
An abbreviation for thread ID.
timer
A kernel object used in conjunction with time-based functions. A timer is created via
timer_create() and armed via timer_settime(). A timer can then deliver an event,
either periodically or on a one-shot basis.
timeslice
A period of time assigned to a round-robin or adaptive scheduled thread. This period
of time is small (on the order of tens of milliseconds); the actual value shouldn’t be
relied upon by any program (it’s considered bad design).
TLB
An abbreviation for translation look-aside buffer. To maintain performance, the
processor caches frequently used portions of the external memory page tables in the
TLB.
TLS
An abbreviation for thread local storage.
basename 29 binding
bc 31 resources
BCM1250 10/100/1000 Mbit Ethernet controllers bindres 40
(devnp-bcm1250.so) 435 bindres 40
BCM440x 10/100 Ethernet controllers BIOS
(devnp-bce.so) 433 PCI support for (pci-bios,
BCM570X pci-bios-v2) 1265
network driver (devn-tigon3.so) 420 resources, seeding (seedres) 1657
BDF fonts, converting to Photon (bdftophf2) startup for PC-compatible systems with
39 (startup-bios,
bdftophf2 39 startup-bios-32) 1788
bench calculator (bc) 31 bios_nokbd.boot 1111
Berkeley Packet Filter (BPF) bios.boot 1111
usingioctl_socket() instead ofioctl() 1280 bios16m.boot 1111
bg (ksh builtin) 946 bison 41
binaries, comparing to official QNX versions bitmap printer driver (phs-to-bmp) 1416
1533 bkgdmgr 42
Binary Data Format See BDF block
binary.boot 1111 configuration file 604, 605
bind (ksh builtin) 946 block I/O support (io-blk.so) 888
BIND 9 blocked threads 1442
DNS Secure blocks
Delegation Signer resource record checking for bad (dcheck) 142
generation tool (dnssec-dsfromkey) patching (spatch) 1763
558 board support packages
key generation tool setting up (setupbsp) 1669
(dnssec-keyfromlabel) 559 bookmarks 836
key-generation tool (dnssec-keygen) boot image 1498
560 boot loader, writing to a disk 555
zone-signing tool (dnssec-signzone) boot time
561 improving 1494
dynamic update utility (nsupdate) 1196 setting 1783
lightweight resolver daemon (lwresd) bootfiles 1110, 1115
1026 booting
lookup utilities time since (uptime) 1929
dig 542 booting (diskboot) 550
host 841 bootpd 44
name server control utility (rndc) 1600 bootptab 46
configuration file (rndc.conf) 1602 bound multiprocessing (BMP) 1113, See also
key-generation tool (rndc-confgen) runmasks
1601 BPF (Berkeley Packet Filter)
server (named) 1159 usingioctl_socket() instead ofioctl() 1280
configuration file 1162 brackets, meaning of in syntax line 3
syntax checker for named configuration files brconfig 51
(named-checkconf) 1160 break (ksh builtin) 946
zone files, named 1161 bridge
PATH 628, 630, 634, 934, 994, 1543, QNX_CONFIGURATION 1545, 1565
1564, 1691, 1693, 1702, 1704, 1912, QNX_HOST 1543, 1564, 1984
1932, 1935, 1948, 1961, 1981 QNX_TARGET 557, 1543, 1564, 1984
PATH_INFO 1704, 1981 QUERY_STRING 1704, 1984
PATH_TRANSLATED 1704, 1981 QUERY_STRING_UNESCAPED 1692
PH_WFRAME_STYLE 1524 QUOTING_STYLE 1253, 1254
PHEXIT_DISABLE 1345, 1395, 1981 RANDOM 935
PHFONT 1345, 1365, 1370, 1981 REFERER 1704, 1984
PHFONT_USE_EXTERNAL 1982 REMOTE_ADDR 1704, 1985
PHFONTMEM 1982 REMOTE_HOST 1704, 1985
PHFONTOPTS 1345, 1982 REMOTE_IDENT 1704, 1985
PHGFX 1345, 1982 REMOTE_PORT 1704, 1985
PHINPUT 1346, 1982 REMOTE_USER 1704, 1985
PHINSTANCE 1982 REPLY 935
PHOTON 1346, 1402, 1982 REQUEST_METHOD 1704, 1985
PHOTON_PATH 1096, 1346, 1513, RESCONF 1985
1515, 1982 SCRIPT_NAME 1704, 1985
PHOTON2_PATH 1982 SECONDS 935
PHOTONOPTS 1982 SERVER 489, 1985
PHSTART 1982 SERVER_ADMIN 1690, 1704, 1986
PHTK_PATH 1982 SERVER_NAME 1704, 1986
PHWM 1346, 1982 SERVER_PORT 1704, 1986
PHWMEXIT 1524, 1982 SERVER_PROTOCOL 1704, 1986
PHWMOPTS 1346, 1524, 1982 SERVER_ROOT 1705, 1986
POSIX_STRICT 106, 110, 1012, 1014, SERVER_SOFTWARE 1705, 1986
1136, 1137, 1983 setting (env) 625
POSIXLY_CORRECT 934, 1983 SHELL 598, 634, 984, 994, 1912, 1986
PPID 934 SMICINCL 1716, 1986
PRINTER 1002, 1983 SNMPCONFIGFILE 1724, 1986
PROCESSOR 1110, 1125, 1983 SOCKET 1263, 1986
PS1, PS2, PS3, PS4 934 SOCKS_NS 1986
PTERMPAL 1514, 1515, 1983 SOCKS_SERVER 1756, 1757, 1986
PTERMRC 1513, 1515, 1983 SUFFIX 1986
PWD 934 SYSLOG 992, 1816, 1987
PWM_PRINTSCRN_APP 1524, 1719, SYSNAME 1987
1983 TERM 601, 634, 984, 994, 1137, 1508,
PYTHONCASEOK 1531 1515, 1593, 1765, 1912, 1987
PYTHONDEBUG 1531 TERMINFO 1877, 1987
PYTHONHOME 1531 TMOUT 935
PYTHONINSPECT 1532 TMPDIR 634, 935, 984, 1912, 1987
PYTHONOPTIMIZE 1532 TZ 140, 634, 1014, 1705, 1884, 1912,
PYTHONPATH 1532 1987
PYTHONSTARTUP 1532 UNZIP 1927
PYTHONUNBUFFERED 1532 USER 1987
PYTHONVERBOSE 1532 USERNAME 994
QCC_CONF_PATH 1542, 1984 VISUAL 935
scheduling information, displaying 1442, TMPDIR 634, 935, 984, 1912, 1987
1444, 1446, 1449 TOC files (helpviewer) 832
stack size, minimum Tolapai 80579 Gigabit Ethernet controllers
(_SC_THREAD_STACK_MIN) 796 (devnp-i80579.so) 445
state, displaying 1442 top 1882
times, displaying 1450 topic files (helpviewer) 832, 835
tic 1876 topological sorting of directed graphs 1906
tick size, changing 22 touch 1883
tickets 1280 touch devices
TIGON3 (BCM570X) Ethernet controller managing
(devn-tigon3.so) 420 devh-egalax.so 339
time 1878 devh-microtouch.so 341
time of day devh-touchintl.so 347
displaying and setting (date) 137 Touch International touch devices
setting (ntpdate) 1202 (devh-touchintl.so) 347
setting or getting from realtime clock (rtc) touchscreens
1634 calibrating (calib) 59
synchronizing with IP servers (ntpd) 1197 calibrating (gf-calib) 800
time since booting (uptime) 1929 input manager
time zone Dyna (devi-dyna) 351
_CS_TIMEZONE 795, 1661 Elographics (devi-elo) 353
name, maximum length of 796 Microtouch (devi-microtouch) 364
setting Semtech (devi-semtech) 367
phlocale 1391 Zytronic (devi-zytronic) 369
setconf 1661 tr 1886
time, execution, displaying for a process or thread TraceEvent() 1889
pidin 1450 tracelogger 1889
time 1878 traceprinter 1893
times (ksh builtin) 957 traceroute 1898
timers traceroute6 1903
displaying for a process 1442 traces, instrumented kernel
flags 1449 displaying (traceprinter) 1893
maximum number of overruns storing (tracelogger) 1889
(_SC_DELAYTIMER_MAX) 795 transcript of a terminal session (script) 1649
times (ksh builtin) 957 Transmit Segmentation Offload (TSO) 448
timestamps Transparent Distributed Processing (TDP) 1019
changing (touch) 1883 Transport Layer Security (TLS) 1239
comparing trap (ksh builtin) 957
find -fmnewer 673 Trident 4DWave, audio driver for
ksh test -nt and -ot 955 (deva-ctrl-4dwave.so) 150
TIMEZONE 1393 troubleshooting See also debugging
tinit 1880 network 1167
tiny ping 1457
webserver (slinger) 1690 ping6 1462
titles, alignment in window frames 1521, 1527 traceroute 1898
TMOUT 935 traceroute6 1903
2116 Index