c library reference - qnx reference for qnx neutrino 6.3 2005, qnx software systems ltd. qnx...
TRANSCRIPT
-
C LIBRARY REFERENCE
Q N X N E U T R I N O R T O S V 6 .3
-
QNX Neutrino Realtime
Operating SystemLibrary Reference
For QNX Neutrino 6.3
2005, QNX Software Systems Ltd.
-
QNX Software Systems Ltd.175 Terence Matthews CrescentKanata, OntarioK2M 1W8CanadaVoice: +1 613 591-0931Fax: +1 613 591-3579Email: [email protected]: http://www.qnx.com/
1996 2005, QNX Software Systems Ltd. All rights reserved.
Third-party copyright notices
All appropriate copyright notices for third-party software are published in this manual in an appendix called Third-Party CopyrightNotices.
Publishing history
December 1996 First edition
July 1997 Second edition
August 1999 Third edition
July 2004 Fourth edition
Electronic edition published February 2005.
Technical support options
To obtain technical support for any QNX product, visit the Technical Support section in the Services area on our website(www.qnx.com). Youll find a wide range of support options, including our free web-based Developer Support Center.
QNX, Momentics, Neutrino, and Photon microGUI are registered trademarks of QNX Software Systems Ltd. in certain jurisdictions. All other trademarks and
trade names belong to their respective owners.
Printed in Canada.
Part Number: 002505
-
Contents
About This Reference liTypographical conventions liii
What youll find in this guide lv
Whats new in QNX Neutrino 6.3.0 Service Pack 1 lv
New content lv
Changed content lvi
Errata lviii
Whats new in QNX Neutrino 6.3.0 lix
New content lix
Whats new in QNX Neutrino 6.2.1 lx
New content lx
Changed content lxi
Errata lxi
Whats new in QNX Neutrino 6.2 lxiii
New Content lxiii
Deprecated Content lxvi
Errata lxvi
Whats new in the QNX Neutrino 6.1.0 docs lxvi
New content lxvii
Deprecated content lxviii
Summary of Functions 1Summary of function categories 3
Asynchronous I/O functions 6
Atomic functions 7
February 1, 2005 Contents iii
-
2005, QNX Software Systems Ltd.
Character manipulation functions 8
Conversion functions 9
Directory functions 12
Dispatch interface functions 13
File manipulation functions 17
IPC functions 19
Hardware functions 25
Math functions 27
Memory allocation functions 33
Memory manipulation functions 34
Message queue functions 36
Multibyte character functions 37
QNX Neutrino-specific IPC functions 37
Operating system I/O functions 40
PC Card functions 44
Platform-specific functions 44
Process environment functions 46
Process manipulation functions 49
Realtime timer functions 58
Resource manager functions 60
Searching and sorting functions 65
Shared memory functions 67
Signal functions 67
Stream I/O functions 69
String manipulation functions 72
System database functions 75
System message log functions 76
TCP/IP functions 77
Terminal control functions 85
Thread functions 86
Time functions 95
Variable-length argument list functions 98
iv Contents February 1, 2005
-
2005, QNX Software Systems Ltd.
Wide-character functions 98
Whats in a function description? 102
Synopsis: 102
Arguments: 103
Library: 103
Description: 103
Returns: 103
Errors: 103
See also: 104
Examples: 104
Classification: 104
Function safety: 108
Manifests 111QNX Neutrino Functions and Macros 115abort() 119
abs() 121
accept() 123
access() 126
acos(), acosf() 129
acosh(), acoshf() 131
addrinfo 133
aio cancel() 135
aio error() 137
aio fsync() 139
aio read() 141
aio return() 142
aio suspend() 144
aio write() 146
alarm() 147
alloca() 150
alphasort() 153
amblksiz 155
February 1, 2005 Contents v
-
2005, QNX Software Systems Ltd.
argc 156
argv 157
asctime(), asctime r() 158
asin(), asinf() 160
asinh(), asinhf() 162
assert() 164
asyncmsg channel create() 167
asyncmsg channel destroy() 170
asyncmsg connect attach() 172
asyncmsg connect attr() 174
asyncmsg connect detach() 176
asyncmsg flush() 178
asyncmsg free() 180
asyncmsg get() 181
asyncmsg malloc() 183
asyncmsg put(), asyncmsg putv() 185
atan(), atanf() 188
atan2(), atan2f() 190
atanh(), atanhf() 192
atexit() 194
atof() 197
atoh() 199
atoi() 201
atol(), atoll() 203
atomic add() 205
atomic add value() 207
atomic clr() 209
atomic clr value() 211
atomic set() 213
atomic set value() 215
atomic sub() 217
atomic sub value() 219
vi Contents February 1, 2005
-
2005, QNX Software Systems Ltd.
atomic toggle() 221
atomic toggle value() 223
auxv 225
basename() 226
bcmp() 229
bcopy() 231
bind() 233
bindresvport() 236
brk() 238
bsearch() 241
btext 244
btowc() 245
bzero() 247
cabs(), cabsf() 249
calloc() 251
cbrt(), cbrtf() 253
ceil(), ceilf() 255
cfmakeraw() 257
cfgetispeed() 259
cfgetospeed() 261
cfgopen() 263
cfree() 267
cfsetispeed() 269
cfsetospeed() 272
ChannelCreate(), ChannelCreate r() 275
ChannelDestroy(), ChannelDestroy r() 282
chdir() 285
chmod() 288
chown() 292
chroot() 295
chsize() 298
clearenv() 301
February 1, 2005 Contents vii
-
2005, QNX Software Systems Ltd.
clearerr() 304
clock() 306
ClockAdjust(), ClockAdjust r() 308
ClockCycles() 311
clock getcpuclockid() 313
clock getres() 315
clock gettime() 317
clock nanosleep() 320
clock settime() 324
ClockId(), ClockId r() 327
ClockPeriod(), ClockPeriod r() 330
ClockTime(), ClockTime r() 334
close() 337
closedir() 339
closelog() 342
cmdfd() 343
cmdname() 344
confstr() 346
connect() 351
ConnectAttach(), ConnectAttach r() 354
ConnectClientInfo(), ConnectClientInfo r() 359
ConnectDetach(), ConnectDetach r() 363
ConnectFlags(), ConnectFlags r() 365
ConnectServerInfo(), ConnectServerInfo r() 368
copysign(), copysignf() 371
cos(), cosf() 373
cosh(), coshf() 375
creat(), creat64() 377
crypt() 381
ctermid() 383
ctime(), ctime r() 385
daemon() 388
viii Contents February 1, 2005
-
2005, QNX Software Systems Ltd.
daylight 390
DebugBreak() 391
DebugKDBreak() 393
DebugKDOutput() 394
delay() 396
devctl() 398
difftime() 408
dircntl() 410
dirname() 413
dispatch block() 416
dispatch context alloc() 419
dispatch context free() 422
dispatch create() 424
dispatch destroy() 427
dispatch handler() 429
dispatch timeout() 432
dispatch unblock() 434
div() 436
dladdr() 438
dlclose() 441
dlerror() 443
dlopen() 445
dlsym() 452
dn comp() 455
dn expand() 457
drand48() 459
drem(), dremf() 461
ds clear() 463
ds create() 465
ds deregister() 468
ds flags() 470
ds get() 472
February 1, 2005 Contents ix
-
2005, QNX Software Systems Ltd.
ds register() 474
ds set() 476
dup() 478
dup2() 481
eaccess() 484
edata 487
encrypt() 488
end 490
endgrent() 491
endhostent() 492
ENDIAN BE16() 493
ENDIAN BE32() 495
ENDIAN BE64() 497
ENDIAN LE16() 499
ENDIAN LE32() 501
ENDIAN LE64() 503
ENDIAN RET16() 505
ENDIAN RET32() 507
ENDIAN RET64() 509
ENDIAN SWAP16() 511
ENDIAN SWAP32() 513
ENDIAN SWAP64() 515
endnetent() 517
endprotoent() 518
endpwent() 519
endservent() 520
endspent() 521
endutent() 522
environ 523
eof() 524
erand48() 526
erf(), erff() 528
x Contents February 1, 2005
-
2005, QNX Software Systems Ltd.
erfc(), erfcf() 530
err(), errx() 532
errno 535
etext 543
execl() 544
execle() 550
execlp() 557
execlpe() 563
execv() 568
execve() 574
execvp() 580
execvpe() 586
exit() 591
exit() 594
exp(), expf() 597
expm1(), expm1f() 599
C Library F to H 603fabs(), fabsf() 606
fcfgopen() 608
fchmod() 610
fchown() 613
fclose() 616
fcloseall() 618
fcntl() 620
fdatasync() 629
fdopen() 631
feof() 634
ferror() 636
fflush() 638
ffs() 640
fgetc() 641
fgetchar() 643
February 1, 2005 Contents xi
-
2005, QNX Software Systems Ltd.
fgetpos() 645
fgets() 647
fgetspent() 650
fgetwc() 653
fgetws() 655
fileno() 658
finite(), finitef() 661
flink() 663
flock() 666
flockfile() 669
floor(), floorf() 671
flushall() 673
fmod(), fmodf() 675
fnmatch() 678
fopen(), fopen64() 682
fork() 687
forkpty() 691
fp exception mask() 693
fp exception value() 696
fp precision() 699
fp rounding() 702
fpathconf() 705
fprintf() 708
fputc() 710
fputchar() 712
fputs() 714
fputwc() 716
fputws() 718
fread() 720
free() 723
freeaddrinfo() 725
freeifaddrs() 727
xii Contents February 1, 2005
-
2005, QNX Software Systems Ltd.
freopen(), freopen64() 728
frexp(), frexpf() 732
fscanf() 734
fseek(), fseeko() 736
fsetpos() 739
fstat(), fstat64() 741
fstatvfs(), fstatvfs64() 745
fsync() 749
ftell(), ftello() 751
ftime() 754
ftruncate(), ftruncate64() 757
ftrylockfile() 760
ftw(), ftw64() 762
funlockfile() 765
futime() 767
fwide() 770
fwprintf() 772
fwrite() 774
fwscanf() 777
gai strerror() 779
gamma(), gamma r(), gammaf(), gammaf r() 781
getaddrinfo() 784
getc() 791
getc unlocked() 793
getchar() 795
getchar unlocked() 797
getcwd() 799
getdomainname() 802
getdtablesize() 804
getegid() 806
getenv() 808
geteuid() 810
February 1, 2005 Contents xiii
-
2005, QNX Software Systems Ltd.
getgid() 812
getgrent() 814
getgrgid() 817
getgrgid r() 819
getgrnam() 822
getgrnam r() 824
getgrouplist() 827
getgroups() 830
gethostbyaddr() 832
gethostbyaddr r() 835
gethostbyname(), gethostbyname2() 838
gethostbyname r() 841
gethostent() 844
gethostent r() 846
gethostname() 849
getifaddrs() 851
GETIOVBASE() 853
GETIOVLEN() 855
getitimer() 857
getlogin() 859
getlogin r() 861
getnameinfo() 863
getnetbyaddr() 868
getnetbyname() 870
getnetent() 872
getopt() 874
getpass() 880
getpeername() 882
getpgid() 884
getpgrp() 886
getpid() 888
getppid() 890
xiv Contents February 1, 2005
-
2005, QNX Software Systems Ltd.
getprio() 892
getprotobyname() 894
getprotobynumber() 896
getprotoent() 898
getpwent() 900
getpwnam() 903
getpwnam r() 905
getpwuid() 908
getpwuid r() 910
getrlimit(), getrlimit64() 913
getrusage() 916
gets() 921
getservbyname() 923
getservbyport() 925
getservent() 927
getsid() 929
getsockname() 931
getsockopt() 933
getspent(), getspent r() 944
getspnam(), getspnam r() 948
getsubopt() 951
gettimeofday() 956
getuid() 958
getutent() 960
getutid() 962
getutline() 965
getw() 967
getwc() 969
getwchar() 971
getwd() 973
glob() 975
globfree() 980
February 1, 2005 Contents xv
-
2005, QNX Software Systems Ltd.
gmtime() 982
gmtime r() 984
h errno 986
hcreate() 988
hdestroy() 990
herror() 991
hostent 994
hsearch() 996
hstrerror() 1000
htonl() 1002
htons() 1004
hwi find item() 1006
hwi find tag() 1008
hwi off2tag() 1010
hwi tag2off() 1012
hypot(), hypotf() 1014
C Library I to L 1017ICMP 1020
ICMP6 1022
if freenameindex() 1025
if indextoname() 1027
if nameindex() 1029
if nametoindex() 1031
ifaddrs 1033
ilogb(), ilogbf() 1035
in8() 1037
in8s() 1039
in16(), inbe16(), inle16() 1041
in16s() 1043
in32(), inbe32(), inle32() 1045
in32s() 1047
index() 1049
xvi Contents February 1, 2005
-
2005, QNX Software Systems Ltd.
inet addr() 1051
inet aton() 1053
inet lnaof() 1055
inet makeaddr() 1057
inet net ntop() 1059
inet netof() 1062
inet net pton() 1064
inet network() 1066
inet ntoa() 1068
inet ntoa r() 1070
inet ntop() 1072
inet pton() 1075
INET6 1080
inet6 option *() 1084
inet6 rthdr *() 1091
initgroups() 1097
initstate() 1099
input line() 1102
InterruptAttach(), InterruptAttach r() 1104
InterruptAttachEvent(), InterruptAttachEvent r() 1113
InterruptDetach(), InterruptDetach r() 1119
InterruptDisable() 1121
InterruptEnable() 1123
InterruptHookIdle() 1125
InterruptHookTrace() 1129
InterruptLock() 1131
InterruptMask() 1133
InterruptUnlock() 1136
InterruptUnmask() 1138
InterruptWait(), InterruptWait r() 1140
intr v86() 1143
io connect 1147
February 1, 2005 Contents xvii
-
2005, QNX Software Systems Ltd.
io connect ftype reply 1154
io connect link reply 1156
ioctl() 1159
iofdinfo() 1161
iofunc attr init() 1163
iofunc attr lock() 1165
iofunc attr t 1167
iofunc attr trylock() 1173
iofunc attr unlock() 1175
iofunc check access() 1177
iofunc chmod() 1181
iofunc chmod default() 1184
iofunc chown() 1186
iofunc chown default() 1189
iofunc client info() 1191
iofunc close dup() 1193
iofunc close dup default() 1196
iofunc close ocb() 1198
iofunc close ocb default() 1200
iofunc devctl() 1202
iofunc devctl default() 1206
iofunc fdinfo() 1208
iofunc fdinfo default() 1211
iofunc func init() 1215
iofunc link() 1218
iofunc lock() 1222
iofunc lock calloc() 1224
iofunc lock default() 1226
iofunc lock free() 1229
iofunc lock ocb default() 1231
iofunc lseek() 1233
iofunc lseek default() 1236
xviii Contents February 1, 2005
-
2005, QNX Software Systems Ltd.
iofunc mknod() 1238
iofunc mmap() 1241
iofunc mmap default() 1245
iofunc notify() 1247
iofunc notify remove() 1254
iofunc notify trigger() 1256
iofunc ocb attach() 1259
iofunc ocb calloc() 1261
iofunc ocb detach() 1264
iofunc ocb free() 1267
iofunc ocb t 1269
iofunc open() 1272
iofunc open default() 1277
iofunc openfd() 1279
iofunc openfd default() 1283
iofunc pathconf() 1285
iofunc pathconf default() 1288
iofunc read default() 1290
iofunc read verify() 1292
iofunc readlink() 1296
iofunc rename() 1299
iofunc space verify() 1303
iofunc stat() 1307
iofunc stat default() 1309
iofunc sync() 1312
iofunc sync default() 1314
iofunc sync verify() 1316
iofunc time update() 1319
iofunc unblock() 1321
iofunc unblock default() 1323
iofunc unlink() 1326
iofunc unlock ocb default() 1329
February 1, 2005 Contents xix
-
2005, QNX Software Systems Ltd.
iofunc utime() 1331
iofunc utime default() 1334
iofunc write default() 1337
iofunc write verify() 1339
ionotify() 1343
IP 1349
IPsec 1356
ipsec dump policy() 1364
ipsec get policylen() 1366
ipsec strerror() 1368
ipsec set policy() 1370
IP6 1375
isalnum() 1385
isalpha() 1387
isascii() 1389
isatty() 1391
iscntrl() 1393
isdigit() 1395
isfdtype() 1397
isgraph() 1399
isinf(), isinff() 1401
islower() 1403
isnan(), isnanf() 1405
isprint() 1407
ispunct() 1409
isspace() 1411
isupper() 1414
iswalnum() 1416
iswalpha() 1418
iswcntrl() 1420
iswctype() 1422
iswdigit() 1424
xx Contents February 1, 2005
-
2005, QNX Software Systems Ltd.
iswgraph() 1426
iswlower() 1428
iswprint() 1430
iswpunct() 1432
iswspace() 1434
iswupper() 1436
iswxdigit() 1438
isxdigit() 1440
itoa() 1442
j0(), j0f() 1445
j1(), j1f() 1447
jn(), jnf() 1449
jrand48() 1451
kill() 1453
killpg() 1456
labs() 1458
lchown() 1460
lcong48() 1463
ldexp(), ldexpf() 1465
ldiv() 1467
lfind() 1469
lgamma(), lgamma r(), lgammaf(), lgammaf r() 1472
link() 1475
lio listio() 1479
listen() 1484
localeconv() 1486
localtime() 1491
localtime r() 1493
lockf() 1495
log(), logf() 1499
log1p(), log1pf() 1501
log10(), log10f() 1503
February 1, 2005 Contents xxi
-
2005, QNX Software Systems Ltd.
logb(), logbf() 1505
login tty() 1508
longjmp() 1510
lrand48() 1513
lsearch() 1515
lseek(), lseek64() 1518
lstat(), lstat64() 1522
ltoa(), lltoa() 1525
ltrunc() 1528
C Library M to O 1533main() 1536
mallinfo() 1539
malloc() 1541
mallopt() 1543
max() 1546
mblen() 1548
mbrlen() 1551
mbrtowc() 1553
mbsinit() 1556
mbsrtowcs() 1558
mbstowcs() 1560
mbtowc() 1563
mcheck() 1566
mem offset(), mem offset64() 1568
memalign() 1572
memccpy() 1574
memchr() 1576
memcmp() 1578
memcpy() 1580
memcpyv() 1582
memicmp() 1584
memmove() 1586
xxii Contents February 1, 2005
-
2005, QNX Software Systems Ltd.
memset() 1588
message attach() 1590
message connect() 1597
message detach() 1600
min() 1603
mkdir() 1605
mkfifo() 1608
mknod() 1611
mkstemp() 1615
mktemp() 1617
mktime() 1619
mlock() 1622
mlockall() 1624
mmap(), mmap64() 1626
mmap device io() 1633
mmap device memory() 1635
modem open() 1639
modem read() 1643
modem script() 1646
modem write() 1654
modf(), modff() 1657
mount() 1659
mount parse generic args() 1662
mprobe() 1665
mprotect() 1667
mq close() 1670
mq getattr() 1672
mq notify() 1675
mq open() 1678
mq receive() 1682
mq send() 1685
mq setattr() 1688
February 1, 2005 Contents xxiii
-
2005, QNX Software Systems Ltd.
mq timedreceive() 1690
mq timedsend() 1693
mq unlink() 1696
mrand48() 1698
msg info 1700
MsgDeliverEvent(), MsgDeliverEvent r() 1703
MsgError(), MsgError r() 1711
MsgInfo(), MsgInfo r() 1714
MsgKeyData(), MsgKeyData r() 1716
MsgRead(), MsgRead r() 1724
MsgReadv(), MsgReadv r() 1728
MsgReceive(), MsgReceive r() 1731
MsgReceivePulse(), MsgReceivePulse r() 1736
MsgReceivePulsev(), MsgReceivePulsev r() 1739
MsgReceivev(), MsgReceivev r() 1742
MsgReply(), MsgReply r() 1746
MsgReplyv(), MsgReplyv r() 1749
MsgSend(), MsgSend r() 1752
MsgSendnc(), MsgSendnc r() 1756
MsgSendPulse(), MsgSendPulse r() 1760
MsgSendsv(), MsgSendsv r() 1764
MsgSendsvnc(), MsgSendsvnc r() 1768
MsgSendv(), MsgSendv r() 1772
MsgSendvnc(), MsgSendvnc r() 1776
MsgSendvs(), MsgSendvs r() 1780
MsgSendvsnc(), MsgSendvsnc r() 1784
MsgVerifyEvent(), MsgVerifyEvent r() 1788
MsgWrite(), MsgWrite r() 1790
MsgWritev(), MsgWritev r() 1794
msync() 1797
munlock() 1800
munlockall() 1802
xxiv Contents February 1, 2005
-
2005, QNX Software Systems Ltd.
munmap() 1804
munmap device io() 1806
munmap device memory() 1808
name attach() 1810
name close() 1817
name detach() 1819
name open() 1821
nanosleep() 1824
nanospin() 1826
nanospin calibrate() 1828
nanospin count() 1831
nanospin ns() 1833
nanospin ns to count() 1835
nap() 1838
napms() 1839
nbaconnect() 1840
nbaconnect result() 1843
ND NODE CMP() 1845
netent 1847
netmgr ndtostr() 1848
netmgr remote nd() 1853
netmgr strtond() 1855
nextafter(), nextafterf() 1857
nftw(), nftw64() 1860
nice() 1864
nrand48() 1866
nsec2timespec() 1868
ntohl() 1870
ntohs() 1872
offsetof() 1874
open(), open64() 1876
opendir() 1884
February 1, 2005 Contents xxv
-
2005, QNX Software Systems Ltd.
openfd() 1887
openlog() 1890
openpty() 1893
out8() 1895
out8s() 1897
out16(), outbe16(), outle16() 1899
out16s() 1901
out32(), outbe32(), outle32() 1903
out32s() 1905
C Library P to R 1907pathconf() 1910
pathfind(), pathfind r() 1914
pathmgr symlink() 1918
pathmgr unlink() 1920
pause() 1922
pccard arm() 1924
pccard attach() 1928
pccard detach() 1930
pccard info() 1932
pccard lock() 1935
pccard raw read() 1937
pccard unlock() 1939
pci attach() 1941
pci attach device() 1943
pci detach() 1952
pci detach device() 1954
pci find class() 1956
pci find device() 1958
pci irq routing options() 1960
pci map irq() 1963
pci present() 1965
pci read config() 1968
xxvi Contents February 1, 2005
-
2005, QNX Software Systems Ltd.
pci read config8() 1970
pci read config16() 1972
pci read config32() 1974
pci rescan bus() 1976
pci write config() 1978
pci write config8() 1981
pci write config16() 1983
pci write config32() 1985
pclose() 1987
perror() 1989
pipe() 1991
poll() 1993
popen() 2000
posix mem offset(), posix mem offset64() 2004
posix memalign() 2006
pow(), powf() 2008
pread(), pread64() 2010
printf() 2013
procmgr daemon() 2023
procmgr event notify() 2025
procmgr event trigger() 2030
procmgr guardian() 2032
procmgr session() 2035
progname 2038
protoent 2039
pthread abort() 2040
pthread atfork() 2042
pthread attr destroy() 2044
pthread attr getdetachstate() 2046
pthread attr getguardsize() 2048
pthread attr getinheritsched() 2050
pthread attr getschedparam() 2052
February 1, 2005 Contents xxvii
-
2005, QNX Software Systems Ltd.
pthread attr getschedpolicy() 2054
pthread attr getscope() 2056
pthread attr getstackaddr() 2058
pthread attr getstacklazy() 2060
pthread attr getstacksize() 2062
pthread attr init() 2064
pthread attr setdetachstate() 2067
pthread attr setguardsize() 2069
pthread attr setinheritsched() 2072
pthread attr setschedparam() 2074
pthread attr setschedpolicy() 2076
pthread attr setscope() 2078
pthread attr setstackaddr() 2080
pthread attr setstacklazy() 2082
pthread attr setstacksize() 2084
pthread barrier destroy() 2086
pthread barrier init() 2088
pthread barrier wait() 2090
pthread barrierattr destroy() 2092
pthread barrierattr getpshared() 2094
pthread barrierattr init() 2096
pthread barrierattr setpshared() 2098
pthread cancel() 2100
pthread cleanup pop() 2102
pthread cleanup push() 2104
pthread cond broadcast() 2107
pthread cond destroy() 2109
pthread cond init() 2111
pthread cond signal() 2113
pthread cond timedwait() 2115
pthread cond wait() 2119
pthread condattr destroy() 2122
xxviii Contents February 1, 2005
-
2005, QNX Software Systems Ltd.
pthread condattr getclock() 2124
pthread condattr getpshared() 2126
pthread condattr init() 2128
pthread condattr setclock() 2130
pthread condattr setpshared() 2132
pthread create() 2134
pthread detach() 2139
pthread equal() 2141
pthread exit() 2143
pthread getconcurrency() 2145
pthread getcpuclockid() 2147
pthread getschedparam() 2149
pthread getspecific() 2151
pthread join() 2153
pthread key create() 2155
pthread key delete() 2159
pthread kill() 2161
pthread mutex destroy() 2163
pthread mutex getprioceiling() 2165
pthread mutex init() 2167
pthread mutex lock() 2169
pthread mutex setprioceiling() 2173
pthread mutex timedlock() 2175
pthread mutex trylock() 2178
pthread mutex unlock() 2180
pthread mutexattr destroy() 2182
pthread mutexattr getprioceiling() 2184
pthread mutexattr getprotocol() 2186
pthread mutexattr getpshared() 2188
pthread mutexattr getrecursive() 2190
pthread mutexattr gettype() 2192
pthread mutexattr init() 2195
February 1, 2005 Contents xxix
-
2005, QNX Software Systems Ltd.
pthread mutexattr setprioceiling() 2197
pthread mutexattr setprotocol() 2199
pthread mutexattr setpshared() 2201
pthread mutexattr setrecursive() 2203
pthread mutexattr settype() 2205
pthread once() 2208
pthread rwlock destroy() 2211
pthread rwlock init() 2213
pthread rwlock rdlock() 2216
pthread rwlock timedrdlock() 2218
pthread rwlock timedwrlock() 2221
pthread rwlock tryrdlock() 2224
pthread rwlock trywrlock() 2226
pthread rwlock unlock() 2228
pthread rwlock wrlock() 2230
pthread rwlockattr destroy() 2232
pthread rwlockattr getpshared() 2234
pthread rwlockattr init() 2236
pthread rwlockattr setpshared() 2238
pthread self() 2240
pthread setcancelstate() 2241
pthread setcanceltype() 2243
pthread setconcurrency() 2245
pthread setschedparam() 2247
pthread setspecific() 2249
pthread sigmask() 2251
pthread sleepon broadcast() 2253
pthread sleepon lock() 2255
pthread sleepon signal() 2257
pthread sleepon timedwait() 2259
pthread sleepon unlock() 2263
pthread sleepon wait() 2265
xxx Contents February 1, 2005
-
2005, QNX Software Systems Ltd.
pthread spin destroy() 2269
pthread spin init() 2271
pthread spin lock() 2273
pthread spin trylock() 2275
pthread spin unlock() 2277
pthread testcancel() 2279
pthread timedjoin() 2280
pulse 2283
pulse attach() 2285
pulse detach() 2289
putc() 2292
putc unlocked() 2294
putchar() 2296
putchar unlocked() 2298
putenv() 2300
puts() 2303
putspent() 2305
pututline() 2308
putw() 2311
putwc() 2313
putwchar() 2315
pwrite(), pwrite64() 2317
qnx crypt() 2320
qsort() 2322
Raccept() 2325
raise() 2327
rand() 2330
rand r() 2332
random() 2334
Rbind() 2337
rcmd() 2339
Rconnect() 2342
February 1, 2005 Contents xxxi
-
2005, QNX Software Systems Ltd.
rdchk() 2344
re comp() 2346
re exec() 2348
read() 2350
read main config file() 2355
readblock() 2359
readcond() 2362
readdir() 2368
readdir r() 2372
readlink() 2375
readv() 2378
realloc() 2382
realpath() 2385
recv() 2387
recvfrom() 2390
recvmsg() 2394
regcomp() 2398
regerror() 2403
regexec() 2405
regfree() 2408
remainder(), remainderf() 2410
remove() 2412
rename() 2415
res init() 2418
res mkquery() 2421
res query() 2424
res querydomain() 2427
res search() 2430
res send() 2433
resmgr attach() 2436
resmgr block() 2445
resmgr connect funcs t 2448
xxxii Contents February 1, 2005
-
2005, QNX Software Systems Ltd.
resmgr context alloc() 2450
resmgr context free() 2453
resmgr context t 2455
resmgr detach() 2457
resmgr devino() 2461
resmgr handle grow() 2464
resmgr handle tune() 2466
resmgr handler() 2469
resmgr io func() 2472
resmgr io funcs t 2474
resmgr iofuncs() 2479
resmgr msgread() 2481
resmgr msgreadv() 2483
resmgr msgwrite() 2485
resmgr msgwritev() 2487
RESMGR NPARTS() 2489
resmgr ocb() 2491
resmgr open bind() 2493
resmgr pathname() 2496
RESMGR PTR() 2499
RESMGR STATUS() 2501
resmgr unbind() 2503
rewind() 2505
rewinddir() 2508
Rgetsockname() 2511
rindex() 2513
rint(), rintf() 2515
Rlisten() 2518
rmdir() 2520
ROUTE 2523
Rrcmd() 2530
rresvport() 2532
February 1, 2005 Contents xxxiii
-
2005, QNX Software Systems Ltd.
Rselect() 2534
rsrcdbmgr attach() 2536
rsrcdbmgr create() 2543
rsrcdbmgr destroy() 2547
rsrcdbmgr detach() 2549
rsrcdbmgr devno attach() 2551
rsrcdbmgr devno detach() 2555
rsrcdbmgr query() 2557
ruserok() 2560
C Library S 2563sbrk() 2566
scalb(), scalbf() 2569
scalbn(), scalbnf() 2572
scalloc() 2575
scandir() 2577
scanf() 2579
sched getparam() 2588
sched get priority adjust() 2591
sched get priority max() 2593
sched get priority min() 2595
sched getscheduler() 2597
sched param 2599
sched rr get interval() 2605
sched setparam() 2607
sched setscheduler() 2610
sched yield() 2613
SchedGet(), SchedGet r() 2616
SchedInfo(), SchedInfo r() 2619
SchedSet(), SchedSet r() 2622
SchedYield(), SchedYield r() 2625
SCTP 2627
sctp bindx() 2629
xxxiv Contents February 1, 2005
-
2005, QNX Software Systems Ltd.
sctp connectx() 2632
sctp freeladdrs() 2634
sctp freepaddrs() 2635
sctp getladdrs() 2636
sctp getpaddrs() 2638
sctp peeloff() 2640
sctp recvmsg() 2642
sctp sendmsg() 2645
searchenv() 2649
seed48() 2652
seekdir() 2654
select() 2656
select attach() 2662
select detach() 2666
select query() 2669
sem close() 2672
sem destroy() 2674
sem getvalue() 2676
sem init() 2678
sem open() 2681
sem post() 2686
sem timedwait() 2688
sem trywait() 2691
sem unlink() 2693
sem wait() 2695
send() 2697
sendmsg() 2700
sendto() 2703
servent 2706
setbuf() 2707
setbuffer() 2709
setdomainname() 2711
February 1, 2005 Contents xxxv
-
2005, QNX Software Systems Ltd.
setegid() 2713
setenv() 2716
seteuid() 2719
setgid() 2722
setgrent() 2725
setgroups() 2727
sethostent() 2729
sethostname() 2731
SETIOV() 2733
setitimer() 2735
setjmp() 2738
setkey() 2741
setlinebuf() 2743
setlocale() 2745
setlogmask() 2748
setnetent() 2750
setpgid() 2752
setpgrp() 2755
setprio() 2756
setprotoent() 2758
setpwent() 2760
setregid() 2761
setreuid() 2764
setrlimit(), setrlimit64() 2766
setservent() 2772
setsid() 2774
setsockopt() 2776
setspent() 2779
setstate() 2780
settimeofday() 2782
setuid() 2784
setutent() 2787
xxxvi Contents February 1, 2005
-
2005, QNX Software Systems Ltd.
setvbuf() 2789
sfree() 2792
shm ctl() 2794
shm ctl special() 2803
shm open() 2806
shm unlink() 2813
shutdown() 2815
sigaction() 2817
sigaddset() 2823
sigblock() 2825
sigdelset() 2827
sigemptyset() 2829
sigevent 2831
sigfillset() 2836
sigismember() 2838
siglongjmp() 2840
sigmask() 2842
signal() 2844
SignalAction(), SignalAction r() 2848
SignalKill(), SignalKill r() 2856
SignalProcmask(), SignalProcmask r() 2862
SignalSuspend(), SignalSuspend r() 2867
SignalWaitinfo(), SignalWaitinfo r() 2870
significand(), significandf() 2873
sigpause() 2876
sigpending() 2878
sigprocmask() 2880
sigqueue() 2883
sigsetjmp() 2886
sigsetmask() 2888
sigsuspend() 2890
sigtimedwait() 2892
February 1, 2005 Contents xxxvii
-
2005, QNX Software Systems Ltd.
sigunblock() 2895
sigwait() 2897
sigwaitinfo() 2899
sin(), sinf() 2901
sinh(), sinhf() 2903
sleep() 2905
sleepon broadcast() 2907
sleepon destroy() 2909
sleepon init() 2911
sleepon lock() 2913
sleepon signal() 2915
sleepon unlock() 2917
sleepon wait() 2919
slogb() 2921
slogf() 2923
slogi() 2927
smalloc() 2929
snmp close() 2931
snmp free pdu() 2933
snmp open() 2935
snmp pdu 2937
snmp pdu create() 2941
snmp read() 2943
snmp select info() 2945
snmp send() 2948
snmp session 2951
snmp timeout() 2955
snprintf() 2957
sockatmark() 2960
socket() 2962
socketpair() 2966
SOCKSinit() 2969
xxxviii Contents February 1, 2005
-
2005, QNX Software Systems Ltd.
sopen() 2971
sopenfd() 2976
spawn() 2979
spawnl() 2989
spawnle() 2994
spawnlp() 2999
spawnlpe() 3003
spawnp() 3008
spawnv() 3014
spawnve() 3019
spawnvp() 3023
spawnvpe() 3027
sprintf() 3032
sqrt(), sqrtf() 3034
srand() 3036
srand48() 3038
srandom() 3040
srealloc() 3042
sscanf() 3045
stat(), stat64() 3047
statvfs(), statvfs64() 3055
stderr 3059
stdin 3060
stdout 3061
straddstr() 3062
strcasecmp() 3064
strcat() 3067
strchr() 3069
strcmp() 3071
strcmpi() 3073
strcoll() 3075
strcpy() 3077
February 1, 2005 Contents xxxix
-
2005, QNX Software Systems Ltd.
strcspn() 3079
strdup() 3081
strerror() 3083
strftime() 3085
stricmp() 3091
strlen() 3093
strlwr() 3095
strncasecmp() 3097
strncat() 3100
strncmp() 3102
strncpy() 3104
strnicmp() 3106
strnset() 3108
strpbrk() 3110
strrchr() 3112
strrev() 3114
strsep() 3116
strset() 3118
strsignal() 3120
strspn() 3122
strstr() 3124
strtod() 3126
strtoimax(), strtoumax() 3129
strtok() 3131
strtok r() 3134
strtol(), strtoll() 3136
strtoul(), strtoull() 3139
strupr() 3142
strxfrm() 3144
swab() 3147
swprintf() 3149
swscanf() 3151
xl Contents February 1, 2005
-
2005, QNX Software Systems Ltd.
symlink() 3153
sync() 3156
SyncCondvarSignal(), SyncCondvarSignal r() 3158
SyncCondvarWait(), SyncCondvarWait r() 3161
SyncCtl(), SyncCtl r() 3166
SyncDestroy(), SyncDestroy r() 3169
SyncMutexEvent(), SyncMutexEvent r() 3172
SyncMutexLock(), SyncMutexLock r() 3174
SyncMutexRevive(), SyncMutexRevive r() 3177
SyncMutexUnlock(), SyncMutexUnlock r() 3179
SyncSemPost(), SyncSemPost r() 3182
SyncSemWait(), SyncSemWait r() 3184
SyncTypeCreate(), SyncTypeCreate r() 3187
sysconf() 3191
sysctl() 3194
syslog() 3202
sysmgr reboot() 3205
SYSPAGE CPU ENTRY() 3207
SYSPAGE ENTRY() 3209
syspage ptr 3212
system() 3213
C Library T to Z 3217tan(), tanf() 3220
tanh(), tanhf() 3222
tcdrain() 3224
tcdropline() 3226
tcflow() 3229
tcflush() 3232
tcgetattr() 3235
tcgetpgrp() 3237
tcgetsid() 3239
tcgetsize() 3241
February 1, 2005 Contents xli
-
2005, QNX Software Systems Ltd.
tcinject() 3243
tcischars() 3246
TCP 3248
tcsendbreak() 3251
tcsetattr() 3253
tcsetpgrp() 3256
tcsetsid() 3259
tcsetsize() 3261
tell(), tell64() 3263
telldir() 3266
tempnam() 3268
termios 3270
thread pool control() 3274
thread pool create() 3277
thread pool destroy() 3284
thread pool limits() 3287
thread pool start() 3290
ThreadCancel(), ThreadCancel r() 3293
ThreadCreate(), ThreadCreate r() 3297
ThreadCtl(), ThreadCtl r() 3304
ThreadDestroy(), ThreadDestroy r() 3308
ThreadDetach(), ThreadDetach r() 3311
ThreadJoin(), ThreadJoin r() 3313
time() 3316
timer create() 3318
timer delete() 3322
timer getexpstatus() 3324
timer getoverrun() 3326
timer gettime() 3328
timer settime() 3330
timer timeout(), timer timeout r() 3333
TimerAlarm(), TimerAlarm r() 3340
xlii Contents February 1, 2005
-
2005, QNX Software Systems Ltd.
TimerCreate(), TimerCreate r() 3343
TimerDestroy(), TimerDestroy r() 3347
TimerInfo(), TimerInfo r() 3349
TimerSettime(), TimerSettime r() 3353
TimerTimeout(), TimerTimeout r() 3357
times() 3365
timespec 3368
timespec2nsec() 3369
timezone 3371
tm 3372
tmpfile(), tmpfile64() 3374
tmpnam() 3377
tolower() 3380
toupper() 3382
towctrans() 3384
towlower() 3386
towupper() 3388
TraceEvent() 3390
truncate() 3393
ttyname() 3396
ttyname r() 3398
tzname 3400
tzset() 3401
ualarm() 3404
UDP 3407
ultoa(), ulltoa() 3409
umask() 3412
umount() 3415
UNALIGNED PUT16() 3417
UNALIGNED PUT32() 3419
UNALIGNED PUT64() 3421
UNALIGNED RET16() 3423
February 1, 2005 Contents xliii
-
2005, QNX Software Systems Ltd.
UNALIGNED RET32() 3425
UNALIGNED RET64() 3427
uname() 3429
ungetc() 3432
ungetwc() 3434
UNIX 3436
unlink() 3439
unsetenv() 3442
usleep() 3444
utime() 3446
utimes() 3449
utmp 3452
utmpname() 3454
utoa() 3456
va arg() 3459
va copy() 3465
va end() 3467
va start() 3469
valloc() 3471
verr(), verrx() 3473
vfork() 3475
vfprintf() 3477
vfscanf() 3480
vfwprintf() 3483
vfwscanf() 3485
vprintf() 3487
vscanf() 3489
vslogf() 3492
vsnprintf() 3494
vsprintf() 3497
vsscanf() 3500
vswprintf() 3503
xliv Contents February 1, 2005
-
2005, QNX Software Systems Ltd.
vswscanf() 3505
vsyslog() 3507
vwarn(), vwarnx() 3509
vwprintf() 3511
vwscanf() 3513
wait() 3515
wait3() 3518
wait4() 3521
waitid() 3525
waitpid() 3528
warn(), warnx() 3531
wcrtomb() 3533
wcscat() 3535
wcschr() 3537
wcscmp() 3539
wcscoll() 3541
wcscpy() 3543
wcscspn() 3545
wcsftime() 3547
wcslen() 3549
wcsncat() 3551
wcsncmp() 3553
wcsncpy() 3555
wcspbrk() 3557
wcsrchr() 3559
wcsrtombs() 3561
wcsspn() 3563
wcsstr() 3565
wcstod(), wcstof(), wcstold() 3567
wcstoimax(), wcstoumax() 3570
wcstok() 3572
wcstol(), wcstoll() 3574
February 1, 2005 Contents xlv
-
2005, QNX Software Systems Ltd.
wcstombs() 3577
wcstoul(), wcstoull() 3580
wcscxfrm() 3583
wctob() 3585
wctomb() 3587
wctrans() 3590
wctype() 3592
wmemchr() 3594
wmemcmp() 3596
wmemcpy() 3598
wmemmove() 3600
wmemset() 3602
wordexp() 3604
wordfree() 3606
wprintf() 3607
write() 3609
writeblock() 3614
writev() 3617
wscanf() 3620
y0(), y0f() 3622
y1(), y1f() 3624
yn(), ynf() 3626
SOCKS A Basic Firewall 3629AAbout SOCKS 3631
How to SOCKSify a client 3631
What SOCKS expects 3632
Third-Party Copyright Notices 3635BBSD Stack 3637
BSD Stack and Various Utilities 3638
MINIX Operating System 3645
ncurses Library 3646
xlvi Contents February 1, 2005
-
2005, QNX Software Systems Ltd.
Regular Expression Handling 3647
Remote Procedure Call (RPC) 3647
SNMPv2 3648
SOCKS 3649
Summary of Safety Information 3651CCancellation points 3653
Interrupt handlers 3658
Signal handlers 3661
Multithreaded programs 3674
Glossary 3677
Index 3701
February 1, 2005 Contents xlvii
-
List of Figures
A hierarchy of processes. 1704
A deadlock when sending messages improperly among processes.1705
MsgSendv(), client to process manager. 1717
MsgReplyv(), process manager to client. 1717
MsgSendv(), client to filesystem manager 1718
Components of a fully qualified pathname. 1849
Specifying a guardian for child processes. 2032
Conditions that satisfy an input request. 2363
Most of the spawn*() functions do a lot of work before a messageis sent to procnto. 2981
February 1, 2005 List of Figures xlix
-
About This Reference
February 1, 2005 About This Reference li
-
2005, QNX Software Systems Ltd. Typographical conventions
Typographical conventionsThroughout this manual, we use certain typographical conventions todistinguish technical terms. In general, the conventions we useconform to those found in IEEE POSIX publications. The followingtable summarizes our conventions:
Reference Example
Code examples if( stream == NULL )
Command options -lR
Commands make
Environment variables PATH
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 format single-step instructions like this:
To reload the current page, press Ctrl R.
We use an arrow () in directions for accessing menu items, like this:
February 1, 2005 About This Reference liii
-
Typographical conventions 2005, QNX Software Systems Ltd.
Youll find the Other... menu item underPerspectiveShow View.
We use notes, cautions, and warnings to highlight importantmessages:
Notes point out something important or useful.
CAUTION: Cautions tell you about commands or procedures thatmay have unwanted or undesirable side effects.!
WARNING: Warnings tell you about commands or proceduresthat could be dangerous to your files, your hardware, or evenyourself.
liv About This Reference February 1, 2005
-
2005, QNX Software Systems Ltd. What youll find in this guide
What youll find in this guideThe Library Reference describes the C functions, data types, andprotocols that are included as part of the QNX Neutrino RTOS.
The Library Reference also contains:
Summary listings of the library, including a description of whatyoull find in a function description
Summary of safety information:
- functions that are cancellation points
- functions that you can safely call from an interrupt handler
- functions that you can safely call from a signal handler
- functions that you cant safely call from a multithreadedprogram.
descriptions of manifests
SOCKS A Basic Firewall
Third-Party Copyright Notices
Glossary
Whats new in QNX Neutrino 6.3.0 ServicePack 1
New contentasyncmsg channel create()
Create an asynchronous message channel.
asyncmsg channel destroy()
Destroy an asynchronous message channel.
asyncmsg connect attach()
Establish a connection between a process and a channel.
February 1, 2005 About This Reference lv
-
Whats new in QNX Neutrino 6.3.0 Service Pack 1 2005, QNX Software Systems Ltd.
asyncmsg connect attr()
Return the original connection attributes.
asyncmsg connect detach()
Break a connection between a process and a channel.
asyncmsg flush()
Flush the messages sent through the connection.
asyncmsg free()
Free a message buffer.
asyncmsg get()
Receive an asynchronous message.
asyncmsg malloc()
Allocate a message buffer for sending.
asyncmsg put(), asyncmsg putv()
Send asynchronous messages to a connection.
shm ctl special()
Give special attributes to a shared memory object
Changed contentgetdomainname()
If the buffer isnt large enough, getdomainname()truncates the domain name.
getgrouplist() The Neutrino implementation of this functionignores the basegid argument.
mallopt() The MALLOC CKACCESS, MALLOC FILLAREA,and MALLOC CKCHAIN options were added tothis call.
lvi About This Reference February 1, 2005
-
2005, QNX Software Systems Ltd. Whats new in QNX Neutrino 6.3.0 Service Pack 1
MsgReply(), MsgReply r(), MsgReplyv(), MsgReplyv r()The MsgSend* r() functions use negative errnovalues to indicate failure, so you shouldnt pass anegative value for the status to MsgReply*(),because the MsgSend* r() functions could interpretit as an error code.
name attach() The example now handles an IO CONNECTmessage.
nanospin(), nanospin ns(), and nanospin ns to count()The first time that you call these functions, the Clibrary invokes nanospin calibrate() with anargument of 0 (interrupts enabled), unless you callit directly first.
pci attach device()
Added PCI MASTER ENABLE to the flags.
procmgr daemon()
The data in the siginfo t structure for theSIGCHLD signal that the parent receives isntuseful in this case.
rsrcdbmgr create()
Added RSRCDBMGR FLAG NOREMOVE to theflags.
setenv() This function doesnt free any memory. If youwant to change the value of an existingenvironment variable, you should use putenv()instead.
sigevent If you dont want to modify the priority of thethread that receives the pulse, specifySIGEV PULSE PRIO INHERIT for the prioritywhen you call SIGEV PULSE INIT().
February 1, 2005 About This Reference lvii
-
Whats new in QNX Neutrino 6.3.0 Service Pack 1 2005, QNX Software Systems Ltd.
spawn(), spawnp()
Added descriptions of the rest of the flags forthe inheritance structure.
If you set SPAWN EXEC in the flags member ofthe inheritence structure, these functionsdont return, unless an error occurred.
Erratagetsubopt() Corrected the example.
mq notify() Dont use SIGEV INTR as an event type.
pause() This function suspends the calling thread, not theprocess, until delivery of a signal.
pthread setschedparam()
The timeslice for round-robin scheduling(SCHED RR) is 4 the clock period.
You can specify sporadic scheduling at any time,not just when you create a thread.
regexec() Corrected the description of the regmatch tstructure.
sched get priority max(), sched get priority min(),sched setscheduler(), SchedInfo(), SchedSet()
The timeslice for round-robin scheduling(SCHED RR) is 4 the clock period.
sched setscheduler(), SchedSet()
You can specify sporadic scheduling at any time, notjust when you create a thread.
spawn(), spawnl(), spawnle(), spawnlp(), spawnlpe(), spawnp(),spawnv(), spawnve(), spawnvp(), spawnvpe()
The child process cant access the parent processsenvironment, only its own.
lviii About This Reference February 1, 2005
-
2005, QNX Software Systems Ltd. Whats new in QNX Neutrino 6.3.0
Whats new in QNX Neutrino 6.3.0New content
fopen64() Large-file support for fopen().
freopen64() Large-file support for freopen().
ftw64() Large-file support for ftw().
getnameinfo() Perform address-to-nodename translation.
inet6 option *() Manipulate IPv6 hop-by-hop and destinationoptions.
inet6 rthdr *() manipulate IPv6 Router header options.
ipsec dump policy()
Generate a readable string from an IPsec policyspecification.
ipsec get policylen()
Get the length of the IPsec policy.
ipsec set policy()
Generate an IPsec policy specification structurefrom a readable string.
nftw(), nftw64() Walk a file tree and its large-file support.
poll() Input/output multiplexing.
resmgr handle tune()
Tune aspects of client fd-to-OCB mapping
sctp bindx() Add or remove one or more addresses from a givenassociation.
sctp connectx() Help associate an endpoint that is multi-homed.
sctp freeladdrs()
Free all resources allocated by sctp getladdrs().
February 1, 2005 About This Reference lix
-
Whats new in QNX Neutrino 6.2.1 2005, QNX Software Systems Ltd.
sctp freepaddrs()
Free all resources allocated by sctp getpaddrs().
sctp getladdrs() Return all locally bound addresses on a socket.
sctp getpaddrs() Return all peer addresses in an association.
sctp peeloff() Branch off an association into a seperate socket.
SCTP Stream Control Transmission Protocol.
sctp recvmsg() Receive message using advanced SCTP features.
sctp sendmag() Send message using advanced SCTP features.
tmpfile64() Large-file support for tmpfile().
Whats new in QNX Neutrino 6.2.1New content
dispatch unblock()
Unblock all of the threads that are blocked on adispatch handle
errno Each thread in a multi-threaded program has its ownerror value in its thread local storage. No matter whichthread youre in, you can simply refer to errno itsdefined in such a way that it refers to the correctvariable for the thread. For more information, seeLocal storage for private data in the documentationfor ThreadCreate().
pthread attr setschedpolicy().
Sporadic scheduling (SCHED SPORADIC) is a newfeature of QNX Neutrino 6.2.0.
sched param
Structure of scheduling parameters
va copy() Make a copy of a variable argument list
lx About This Reference February 1, 2005
-
2005, QNX Software Systems Ltd. Whats new in QNX Neutrino 6.2.1
Changed contentbind(), bindresvport()
These functions arent cancellation points any more, becausethis conflicted with POSIX.
htonl(), htons(), inet ntop(), inet pton(), isfdtype(), ntohl(), ntohs()These functions have been moved from libsocket to libc.
Errataalphasort() This function compares two directory entries; it
doesnt sort an array of entries.
execlpe(), execvpe()
You can now execute a shell script.
fgetc(), fgetchar(), fgets(), fgetwc(), fgetws(), getc(), getc unlocked(),getchar(), getchar unlocked(), gets(), getw(), getwc(), getwchar()
Use feof() or ferror() to distinguish an end-of-filecondition from an error.
fstat(), fstat64() These functions return -1 if an error occurs.
iofunc mmap(), iofunc mmap default()
These functions return a nonpositive value onsuccess.
InterruptAttach(), InterruptAttachEvent()
You should always setNTO INTR FLAGS TRK MSK.
mq getattr(), mq setattr()
The mq flags member of the mq attr structureapplies to the message-queue description (i.e.locally), not to the queue as a whole.
mq open() Corrected the interpretation of the name argument.
February 1, 2005 About This Reference lxi
-
Whats new in QNX Neutrino 6.2.1 2005, QNX Software Systems Ltd.
MsgError(), MsgError r()
If the error argument is EOK, the MsgSend*() callreturns EOK; if error is any other value, theMsgSend*() call returns -1.
MsgSendPulse(), MsgSendPulse r()
You can now send pulses across the network.
You can send a pulse to any process not just to aprocess in the same process group if yourprocess has the appropriate permission.
name open() This function returns a nonnegative integerrepresenting a side-channel connection ID, or -1 ifan error occurred.
printf() The exponent produced for the e and E formats isat least two digits long.
Clarified what happens if the format string includesinvalid multibyte characters.
pthread mutex timedlock(), pthread rwlock timedrdlock(),pthread rwlock timedwrlock()
The timeout is based on the CLOCK REALTIMEclock.
resmgr ocb() Corrected the name.
select() This function and the associated macros are nowdefined in , instead of (which includes).
sem open() Corrected the interpretation of the sem nameargument.
sem timedwait() The timeout is based on the CLOCK REALTIMEclock.
send() The list of errors now includes EPIPE.
lxii About This Reference February 1, 2005
-
2005, QNX Software Systems Ltd. Whats new in QNX Neutrino 6.2
shm open() Corrected the interpretation of the name argument.
sigaction() Corrected the example (it isnt safe to call printf()in a signal handler).
spawn(), spawnl(), spawnle(), spawnlp(), spawnlpe(), spawnp(),spawnv(), spawnve(), spawnvp(), spawnvpe()
You can now execute a shell script.
The child processs tms utime, tms stime,tms cutime, and tms cstime are now calculated.
timer create() Dont use SIGEV INTR or SIGEV UNBLOCK forthe event type.
vsnprintf() Corrected the returned values.
Whats new in QNX Neutrino 6.2Significant changes:
New content
Deprecated content
Errata
New Contentaddrinfo TCP/IP address information
dircntl() Control an open directory
freeaddrinfo() Free an address information structure
freeifaddrs() Free an address information structure
gai strerror() Return the getaddrinfo() error code
getaddrinfo() Get address information
getdomainname()
Get the domain name of the current host
February 1, 2005 About This Reference lxiii
-
Whats new in QNX Neutrino 6.2 2005, QNX Software Systems Ltd.
gethostbyname2()
Get a network host entry, given a name
getifaddrs() Get a network interface address
hwi find item() Find an item in the hwi item structure
hwi find tag() Find a tag in the hwi item structure
hwi off2tag() Return a pointer to the start of a tag in the hwinfoarea of the system page
hwi tag2off() Return the offset from the start of the hwinfo areaof the system page
ICMP6 Internet Control Message Protocol for IPv6
if freenameindex()
Free dynamic memory allocated by if nameindex()
if indextoname() Map an interface index to its name
if nameindex() Return a list of interfaces
if nametoindex() Map an interface name to its index
ifaddrs() Structure that describes an Internet host
INET6 Internet Protocol version 6 family
inet net ntop() Convert an Internet network number to CIDRformat
inet net pton() Convert an Internet network number from CIDRformat to network format
IPv6 Internet Protocol version 6
IPsec Internet security protocol
mallinfo() Get memory allocation information
mallopt() Control the memory allocation
lxiv About This Reference February 1, 2005
-
2005, QNX Software Systems Ltd. Whats new in QNX Neutrino 6.2
mcheck() Enable memory allocation routine consistencychecks
memalign() Allocate aligned memory
mprobe() Perform consistency check on memory
posix memalign()
Allocate aligned memory
procmgr session()
Provide process manager session support
resmgr handle grow()
Expand the capacity of the device managerdatabase
resmgr io func()
Retrieve an I/O function from an I/O function table
resmgr iofuncs() Extract the I/O function pointers associated with cconnection
resmgr ocb() Retrieve an Open Control Block
sched get priority adjust()
Calculate the allowable priority for the schedulingpolicy
seekdir() Set the position for the next read of the directorystream
sleepon broadcast()
Wake up multiple threads
sleepon destroy()
Destroy a sleepon
sleepon init() Initialize a sleepon
sleepon lock() Lock a sleepon
February 1, 2005 About This Reference lxv
-
Whats new in the QNX Neutrino 6.1.0 docs 2005, QNX Software Systems Ltd.
sleepon signal()
Wake up a single thread
sleepon unlock()
Unlock a sleepon
sleepon wait() Wait on a sleepon
tcsetsid() Make a terminal device a controlling device
strtoimax(), strtoumax()
Convert a string to an integer type
telldir() Get the location associated with the directorystream
valloc() Allocate a heap block aligned on a page boundary
wcstoimax(), wcstoumax()
Convert a wide-character string to an integer type
Deprecated Content getpriority() use getprio() or SchedGet() instead.
setpriority() use setprio() or SchedSet() instead.
Erratasnprintf() Corrected the Returns section and Classifications
Whats new in the QNX Neutrino 6.1.0 docsSignificant changes:
New content
Deprecated content
lxvi About This Reference February 1, 2005
-
2005, QNX Software Systems Ltd. Whats new in the QNX Neutrino 6.1.0 docs
New contentThe following functions have been added:
Wide-character functions
Wide-character versions of many functions
InterruptHookTrace()
Attach the pseudo interrupt handler thats used bythe instrumented module
iofdinfo() Retrieve server attributes
iofunc fdinfo() Handle an IO FDINFO message
iofunc fdinfo default()
Default handler for IO FDINFO messages
MsgVerifyEvent(), MsgVerifyEvent r()
Check the validity of a receive ID and an eventconfiguration
resmgr unbind()
Remove an OCB
straddstr() Concatenate one string on to the end of another
SyncCtl(), SyncCtl r()
Perform an operation on a synchronization object
SyncMutexEvent(), SyncMutexEvent r()
Attach an event to a mutex
SyncMutexRevive(), SyncMutexRevive r()
Revive a mutex
thread pool control()
Control the thread pool behavior
February 1, 2005 About This Reference lxvii
-
Whats new in the QNX Neutrino 6.1.0 docs 2005, QNX Software Systems Ltd.
thread pool limits()
Wrapper function for thread pool control()
TraceEvent() Trace kernel events
Deprecated contentmatherr() Handle errors in math library functions
lxviii About This Reference February 1, 2005
-
Summary of Functions
February 1, 2005 Summary of Functions 1
-
2005, QNX Software Systems Ltd. Summary of function categories
Summary of function categoriesWeve organized the functions in the C library into the followingcategories:
Asynchronous I/O functions
Asynchronous read, write, and other I/Ooperations.
Atomic functions
Thread-safe integer manipulation functions.
Character manipulation functions
Single-character functions for upper/lowercaseconversions.
Conversion functions
Convert values from one representation to another(e.g. numeric values to strings).
Directory functions
Directory services (change, open, close, etc.).
Dispatch interface functions
Handle different event types, including messages,pulse codes, and signals.
File manipulation functions
File operations (change permissions, delete,rename, etc.)
IPC functions Traditional InterProcess Communicationfunctions.
Hardware functions
These functions work with PCI and other devices.
Math functions Perform computations such as the commontrigonometric calculations. These functionsoperate with floating-point values.
February 1, 2005 Summary of Functions 3
-
Summary of function categories 2005, QNX Software Systems Ltd.
Memory allocation functions
Allocate and deallocate memory.
Memory manipulation functions
Manipulate blocks of memory.
Message queue functions
Nonblocking message-passing facilities.
Multibyte character functions
ANSI C functions for processing multibyte andwide characters.
QNX Neutrino-specific IPC functions
Native message-passing and related functions.
Operating system I/O functions
POSIX functions for performing I/O at a lowerlevel than the C Language stream I/O functions(e.g. fopen(), fread(), fwrite(), and fclose() ).
PC Card functions
Native PC Card functions.
Platform-specific functions
Invoke Intel 80x86 and other processor-relatedfunctions directly from a program.
Process environment functions
For process identification, user identification,process groups, system identification, system timeand process time, environment variables, terminalidentification, and configurable system variables.
Process manipulation functions
For process creation, execution, and termination;signal handling; and timer operations.
4 Summary of Functions February 1, 2005
-
2005, QNX Software Systems Ltd. Summary of function categories
Realtime timer functions
Rich set of inexpensive timer functions that arequick to create and manipulate.
Resource manager functions
These functions help you create resourcemanagers.
Searching and sorting functions
Perform various search and sort operations (do abinary search on a sorted array, find one stringinside another, etc.).
Shared-memory functions
Create and manipulate shared-memory regions.
Signal functions Rich set of functions for handling and sendingsignals.
Stream I/O functions
The standard functions to read and write files.Data can be transmitted under format control or ascharacters, strings, or blocks of memory.
String manipulation functions
Manipulate a character string, i.e. an array of zeroor more adjacent characters followed by a NULcharacter (0) that marks the end of the string.
System database functions
Allow an application to access group and userdatabase information.
System message log functions
This set of functions controls the system log.
TCP/IP functions
Handle TCP/IP network communications and theTCP/IP database files.
February 1, 2005 Summary of Functions 5
-
Summary of function categories 2005, QNX Software Systems Ltd.
Terminal control functions
Set and control terminal attributes (baud rate, flowcontrol, etc.).
Thread functions
Operate on threads and the objects used tosynchronize threads.
Time functions Obtain and manipulate times and dates.
Variable-length argument list functions
Process a variable number of arguments to afunction.
Wide-character functions
Wide-character versions of functions from otherfunction summary categories.
The following subsections describe these function categories in moredetail. Each function is noted with a brief description of its purpose.
Asynchronous I/O functionsThese functions perform asynchronous read, write, and other I/Ooperations.
Asynchronous I/O operations arent currently supported.
The following functions are defined:
aio cancel() Cancel an asynchronous I/O operation
aio error() Get the error status for an asynchronous I/Ooperation
aio fsync() Asynchronously synchronize a file
aio read() Asynchronously read from a file
6 Summary of Functions February 1, 2005
-
2005, QNX Software Systems Ltd. Summary of function categories
aio return() Get the return status for an asynchronous I/Ooperation
aio suspend() Wait for asynchronous I/O operations to complete
aio write() Asynchronously write to a file
Atomic functionsThese functions manipulate an integer in a thread-safe way. On amultiprocessor system, even a simple:
/*Assuming x is an unsigned variable shared between twoor more threads or a thread and an interrupt handler.
*/
x = 0xdeadbeef;
may cause x to be in an undefined state if multiple threads runningsimultaneously on multiple processors execute this code at the sametime.
Use the atomic*() functions to ensure that your integer operations arecarried out properly:
atomic toggle( &x, 0xdeadbeef );
atomic add() Safely add to a variable
atomic add value()
Safely add to a variable, returning the previousvalue
atomic clr() Safely clear a variable
atomic clr value()
Safely clear a variable, returning the previous value
atomic set() Safely set bits in a variable
February 1, 2005 Summary of Functions 7
-
Summary of function categories 2005, QNX Software Systems Ltd.
atomic set value()
Safely set bits in a variable, returning the previousvalue
atomic sub() Safely subtract from a variable
atomic sub value()
Safely subtract from a variable, returning theprevious value
atomic toggle() Safely toggle a variable
atomic toggle value()
Safely toggle a variable, returning the previousvalue
Character manipulation functionsThese functions operate on single characters of type char. Thefunctions test characters in various ways and convert them betweenupper and lowercase. (Some of these functions have wide-characterversions in the Wide-character functions section of the functionsummary.)
isalnum() Test a character to see if its alphanumeric
isalpha() Test to see if a character is a letter
isascii() Test for a character in the range 0 to 127
iscntrl() Test a character to see if its a control character
isdigit() Test for any decimal digit
isgraph() Test for any printable character except space
islower() Test for any lowercase letter
isprint() Test for any printable character, including space
8 Summary of Functions February 1, 2005
-
2005, QNX Software Systems Ltd. Summary of function categories
ispunct() Test for any punctuation character
isspace() Test for a whitespace character
isupper() Test for any uppercase letter
isxdigit() Test for any hexadecimal digit
tolower() Convert a character to lowercase
toupper() Convert a character to uppercase
Conversion functionsThese functions perform conversions between objects of various typesand strings:
atof() Convert a string into a double
atoh() Convert a string containing a hexadecimal numberinto an unsigned number
atoi() Convert a string into an integer
atol(), atoll() Convert a string into a long integer
ENDIAN BE16()
Return a big-endian 16-bit value in native format
ENDIAN BE32()
Return a big-endian 32-bit value in native format
ENDIAN BE64()
Return a big-endian 64-bit value in native format
ENDIAN LE16()
Return a little-endian 16-bit value in native format
ENDIAN LE32()
Return a little-endian 32-bit value in native format
February 1, 2005 Summary of Functions 9
-
Summary of function categories 2005, QNX Software Systems Ltd.
ENDIAN LE64()
Return a little-endian 64-bit value in native format
ENDIAN RET16()
Return an endian-swapped 16-bit value
ENDIAN RET32()
Return an endian-swapped 32-bit value
ENDIAN RET64()
Return an endian-swapped 64-bit value
ENDIAN SWAP16()
Endian-swap a 16-bit value in place
ENDIAN SWAP32()
Endian-swap a 32-bit value in place
ENDIAN SWAP64()
Endian-swap a 64-bit value in place
htonl() Convert a 32-bit value from host-byte order tonetwork-byte order
htons() Convert a 16-bit value from host-byte order tonetwork-byte order
itoa() Convert an integer into a string, using a given base
ltoa(), lltoa() Convert a long integer value into a string, using agiven base
nsec2timespec()
Convert nanoseconds to a timespec structure
ntohl() Convert network-byte order value
ntohs() Convert network-byte order value
strtod() Convert a string into a double
10 Summary of Functions February 1, 2005
-
2005, QNX Software Systems Ltd. Summary of function categories
strtoimax(), strtoumax()
Convert a string into an integer
strtol(), strtoll()
Convert a string into a long integer
strtoul(), strtoull()
Convert a string into an unsigned long integer
timespec Time-specification structure
timespec2nsec()
Convert a timespec structure to nanoseconds
ultoa(), ulltoa() Convert an unsigned long integer into a string,using a given base
UNALIGNED PUT16()
Write a misaligned 16-bit value safely
UNALIGNED PUT32()
Write a misaligned 32-bit value safely
UNALIGNED PUT64()
Write a misaligned 64-bit value safely
UNALIGNED RET16()
Access a misaligned 16-bit value safely
UNALIGNED RET32()
Access a misaligned 32-bit value safely
UNALIGNED RET64()
Access a misaligned 64-bit value safely
utoa() Convert an unsigned integer into a string, using agiven base
wordexp() Perform word expansions
February 1, 2005 Summary of Functions 11
-
Summary of function categories 2005, QNX Software Systems Ltd.
wordfree() Free a word expansion buffer
See also the following functions, which convert the cases ofcharacters and strings:
strlwr()
strupr()
tolower()
toupper()
Directory functionsThese functions pertain to directory manipulation:
alphasort() Compare two directory entries
chdir() Change the current working directory
chroot() Change the root directory
closedir() Close a directory
dircntl() Control an open directory
dirname() Report the parent directory name of a file pathname
getcwd() Get the name of the current working directory
getwd() Get current working directory pathname
glob() Find paths matching a pattern
globfree() Free storage allocated by a call to glob()
mkdir() Create a subdirectory
mount() Mount a filesystem
mount parse generic args()
Strip off common mount arguments
12 Summary of Functions February 1, 2005
-
2005, QNX Software Systems Ltd. Summary of function categories
opendir() Open a directory file
pathfind(), pathfind r()
Search for a file in a list of directories
readdir() Get information about the next matching filename
readdir r() Get information about the next matching filename
realpath() Resolve a pathname
rewinddir() Reset the position of a directory stream to the start ofthe directory
rmdir() Delete an empty directory
scandir() Scan a directory
seekdir() Set the position for the next read of the directorystream
telldir() Get the location associated with the directory stream
umount() Unmount a filesystem
Dispatch interface functionsThese functions make up the dispatch interface where you can handledifferent event types including messages, pulse codes, and signals.The functions cover dispatch contexts, attaching events, attachingpathnames and file descriptors to dispatch contexts, thread pools, etc.For an overview of these functions, see Components of a resourcemanager in the Writing a Resource Manager chapter of the QNXNeutrino Programmers Guide.
dispatch block() Block while waiting for an event
dispatch context alloc()
Return a dispatch context
February 1, 2005 Summary of Functions 13
-
Summary of function categories 2005, QNX Software Systems Ltd.
dispatch context free()
Free a dispatch context
dispatch create()
Allocate a dispatch handle
dispatch destroy()
Destroy a dispatch handle
dispatch handler()
Handle events received by dispatch block()
dispatch timeout()
Set a timeout
dispatch unblock()
Unblock all of the threads that are blocked on adispatch handle
message attach()
Attach a message range
message connect()
Create a connection to a channel
message detach()
Detach a message range
name attach() Register a name in the namespace and create achannel
name detach() Remove a name from the namespace and destroythe channel
pulse Structure that describes a pulse
pulse attach() Attach a handler function to a pulse code
pulse detach() Detach a handler function from a pulse code
14 Summary of Functions February 1, 2005
-
2005, QNX Software Systems Ltd. Summary of function categories
resmgr attach() Attach a path to a pathname space
resmgr block() Block while waiting for a message
resmgr connect funcs t
Table of POSIX-level connect functions
resmgr context alloc()
Allocate a resource-manager context
resmgr context free()
Free a resource-manager context
resmgr context t
Context information thats passed betweenresource-manager functions
resmgr detach() Remove a pathname from the pathname space
resmgr devino() Get the device and inode number
resmgr handle grow()
Expand the capacity of the device managerdatabase
resmgr handle tune()
Tune aspects of client fd-to-OCB mapping
resmgr handler()
Handle resource manager messages
resmgr io func()
Retrieve an I/O function from an I/O function table
resmgr io funcs t
Table of POSIX-level I/O functions
resmgr iofuncs() Extract the I/O function pointers associated withclient connections
February 1, 2005 Summary of Functions 15
-
Summary of function categories 2005, QNX Software Systems Ltd.
resmgr msgread()
Read a message from a client
resmgr msgreadv()
Read a message from a client
resmgr msgwrite()
Write a message to a client
resmgr msgwritev()
Write a message to a client
RESMGR NPARTS()
Get a given number of parts from the ctp->iovstructure
resmgr ocb() Retrieve an Open Control Block
resmgr open bind()
Associate an OCB with an open request
resmgr pathname()
Return the pathname associated with an ID
RESMGR PTR()
Get one part from the ctp->iov structure and fill inits fields
RESMGR STATUS()
Set the status member of a resource-managercontext
resmgr unbind() Remove an OCB
select attach() Attach a file descriptor to a dispatch handle
select detach() Detach a file descriptor from a dispatch handle
select query() Decode the last select event
16 Summary of Functions February 1, 2005
-
2005, QNX Software Systems Ltd. Summary of function categories
thread pool create()
Create a thread pool handle
thread pool control()
Control the thread pool behavior
thread pool destroy()
Free the memory allocated to a thread pool
thread pool limits()
Wrapper function for thread pool control()
thread pool start()
Start a thread pool
File manipulation functionsThese functions operate directly with files. The following functionsare defined:
access() Check to see if a file or directory can be accessed
chmod() Change the permissions for a file
chown() Change the user ID and group ID of a file
eaccess() Check to see if a file or directory can be accessed(extended version)
glob() Find paths matching a pattern
globfree() Free storage allocated by a call to glob()
fchmod() Change the permissions for a file
fchown() Change the user ID and group ID of a file
fpathconf() Return the value of a configurable limit associatedwith a file or directory
February 1, 2005 Summary of Functions 17
-
Summary of function categories 2005, QNX Software Systems Ltd.
ftruncate(), ftruncate64()
Truncate a file
futime() Record the modification time for a file
lchown() Change the user ID and group ID of a file orsymbolic link
lstat(), lstat64()
Get information about a file or directory
ltrunc() Truncate a file at a given position
mkfifo() Create a FIFO special file
mkstemp() Make a unique temporary filename, and open the file
mktemp() Make a unique temporary filename
nftw(), nftw64()
Walk a file tree
pathconf() Return the value of a configurable limit
pclose() Close a pipe
pwrite(), pwrite64()
Write into a file without changing the file pointer
remove() Remove a link to a file
rename() Rename a file
stat(), stat64()
Get information about a file or directory, given a path
statvfs(), statvfs64()
Get filesystem information, given a path
sync() Synchronize filesystem updates
18 Summary of Functions February 1, 2005
-
2005, QNX Software Systems Ltd. Summary of function categories
tempnam() Create a name for a temporary file
truncate() Truncate a file to a specified length
tmpnam() Generate a unique string for use as a filename
unlink() Remove a link to a file
utime() Record the modification time for a file or directory
utimes() Set a files access and modification times
IPC functionsThese functions deal with InterProcess Communications.
flock() Apply or remove an advisory lock on an open file
lockf() Record locking on files
mlock() Lock a buffer in physical memory
mlockall() Lock a processs address space
mmap(), mmap64()
Map a memory region into a process address space
mprotect() Change memory protection
msync() Synchronize memory with physical storage
munlock() Unlock a buffer
munlockall() Unlock a processs address space
munmap() Unmap previously mapped addresses
pthread barrier destroy()
Destroy a barrier object
pthread barrier init()
Initialize a barrier object
February 1, 2005 Summary of Functions 19
-
Summary of function categories 2005, QNX Software Systems Ltd.
pthread barrier wait()
Synchronize at a barrier
pthread barrierattr destroy()
Destroy a barrier attributes object
pthread barrierattr getpshared()
Get the process-shared attribute of a barrierattributes object
pthread barrierattr init()
Initialize a barrier attributes object
pthread barrierattr setpshared()
Set the process-shared attribute of a barrierattributes object
pthread cond broadcast()
Unblock threads waiting on a condition
pthread cond destroy()
Destroy a condition variable
pthread cond init()
Initialize a condition variable
pthread cond signal()
Unblock the thread waiting on a condition variable
pthread cond timedwait()
Wait on a condition variable, with a time limit
pthread cond wait()
Wait on a condition variable
pthread condattr destroy()
Destroy a condition variable attribute object
20 Summary of Functions February 1, 2005
-
2005, QNX Software Systems Ltd. Summary of function categories
pthread condattr getclock()
Get the clock attribute from a condition-variableattribute object
pthread condattr getpshared()
Get the process-shared attribute from a conditionvariable attribute object
pthread condattr init()
Initialize a condition variable attribute object
pthread condattr setclock()
Set the clock attribute in a condition-variableattribute object
pthread condattr setpshared()
Set the process-shared attribute in acondition-variable attribute object
pthread mutex destroy()
Destroy a mutex
pthread mutex getprioceiling()
Get a mutexs priority ceiling
pthread mutex init()
Initialize a mutex
pthread mutex lock()
Lock a mutex
pthread mutex setprioceiling()
Set a mutexs priority ceiling
pthread mutex timedlock()
Lock a mutex
pthread mutex trylock()
Attempt to lock a mutex
February 1, 2005 Summary of Functions 21
-
Summary of function categories 2005, QNX Software Systems Ltd.
pthread mutex unlock()
Unlock a mutex
pthread mutexattr destroy()
Destroy a mutex attribute object
pthread mutexattr getprioceiling()
Get the priority ceiling of a mutex attribute object
pthread mutexattr getprotocol()
Get a mutexs scheduling protocol
pthread mutexattr getpshared()
Get the process-shared attribute from a mutexattribute object
pthread mutexattr getrecursive()
Get the recursive attribute from a mutex attributeobject
pthread mutexattr gettype()
Get a mutex type
pthread mutexattr init()
Initialize the mutex attribute object
pthread mutexattr setprioceiling()
Set the priority ceiling of a mutex attribute object
pthread mutexattr setprotocol()
Set a mutexs scheduling protocol
pthread mutexattr setpshared()
Set the process-shared attribute in mutex attributeobject
pthread mutexattr setrecursive()
Set the recursive attribute in mutex attribute object
22 Summary of Functions February 1, 2005
-
2005, QNX Software Systems Ltd. Summary of function categories
pthread mutexattr settype()
Set a mutex type
pthread once() Dynamic package initialization
pthread rwlock destroy()
Destroy a read/write lock
pthread rwlock init()
Initialize a read/write lock
pthread rwlock rdlock()
Acquire a shared read lock on a read/write lock
pthread rwlock timedrdlock()
Lock a read-write lock for writing
pthread rwlock timedwrlock()
Attempt to acquire an exclusive write lock on aread/write lock
pthread rwlock tryrdlock()
Attempt to acquire a shared read lock on aread/write lock
pthread rwlock trywrlock()
Attempt to acquire an exclusive write lock on aread/write lock
pthread rwlock unlock()
Unlock a read/write lock
pthread rwlock wrlock()
Acquire an exclusive write lock on a read/writelock
pthread rwlockattr destroy()
Destroy a read-write lock attribute object
February 1, 2005 Summary of Functions 23
-
Summary of function categories 2005, QNX Software Systems Ltd.
pthread rwlockattr getpshared()
Get the process-shared attribute of a read-writelock attribute object
pthread rwlockattr init()
Create a read-write lock attribute object
pthread rwlockattr setpshared()
Set the process-shared attribute of a read-writelock attribute object
pthread spin destroy()
Destroy a thread spinlock
pthread spin init()
Initialize a thread spinlock
pthread spin lock()
Lock a thread spinlock
pthread spin trylock()
Try locking a thread spinlock
pthread spin unlock()
Unlock a thread spinlock
readcond() Read data from a terminal device
sem close() Close a named semaphore
sem destroy() Destroy a semaphore
sem getvalue() Get the value of a semaphore (named or unnamed)
sem init() Initialize a semaphore
sem open() Create or access a named semaphore
sem post() Increment a semaphore
sem timedwait() Wait on a semaphore, with a timeout
24 Summary of Functions February 1, 2005
-
2005, QNX Software Systems Ltd. Summary of function categories
sem trywait() Wait on a semaphore, but dont block
sem unlink() Destroy a named semaphore
sem wait() Wait on a semaphore
sync() Synchronize filesystem updates
Hardware functionsThese functions work with PCI and other devices for operations suchas determining whether or not a PCI BIOS is present, attaching adriver to a PCI device, and so on.
The following functions are defined:
pci attach() Connect to the PCI server
pci attach device()
Attach a driver to a PCI device
pci detach() Disconnect from the PCI server
pci detach device()
Detach a driver from a PCI device
pci find class() Find devices that have a specific Class Code
pci find device() Find the PCI device with a given device ID andvendor ID
pci irq routing options()
Retrieve PCI IRQ routing information
pci map irq() Map an interrupt pin to an IRQ
pci present() Determine whether or not PCI BIOS is present
pci read config()
Read from the configuration space of a PCI device
February 1, 2005 Summary of Functions 25
-
Summary of function categories 2005, QNX Software Systems Ltd.
pci read config8()
Read a byte from the configuration space of adevice
pci read config16()
Read 16-bit values from the configuration space ofa device
pci read config32()
Read 32-bit values from the configuration space ofa device
pci rescan bus() Rescan the PCI bus for added or removed devices
pci write config()
Write to the configuration space of a PCI device
pci write config8()
Write bytes to the configuration space of a PCIdevice
pci write config16()
Write 16-bit values to the configuration space of adevice
pci write config32()
Write 32-bit values to the configuration space of adevice
hwi find item() Find an item in the hwi item structure
hwi find tag() Find a tag in the hwi item structure
hwi off2tag() Return a pointer to the start of a tag in the hwinfoarea of the system page
hwi tag2off() Return the offset from the start of the hwinfo areaof the system page
26 Summary of Functions February 1, 2005
-
2005, QNX Software Systems Ltd. Summary of function categories
Math functionsThe math functions are arranged in the following categories:
Absolute values
Bessel functions
Divisions, remainders, and modular arithmetic
Floating-point settings
Gamma functions
Logarithms and exponentials
Miscellaneous
Pseudo-random numbers
Roots and powers
Rounding
Trigonometric and hyperbolic functions
Absolute values
abs() Return the absolute value of an integer
cabs(), cabsf() Compute the absolute value of a complex number
fabs(), fabsf() Compute the absolute value of a double number
labs() Calculate the absolute value of a long integer
Bessel functions
j0(), j0f() Compute a Bessel function of the first kind
j1(), j1f() Compute a Bessel function of the first kind
jn(), jnf() Compute a Bessel function of the first kind
y0(), y0f() Compute a Bessel function of the second kind
February 1, 2005 Summary of Functions 27
-
Summary of function categories 2005, QNX Software Systems Ltd.
y1(), y1f() Compute a Bessel function of the second kind
yn(), ynf() Compute a Bessel function of the second kind
Division, remainders, and modular arithmetic
div() Calculate the quotient and remainder of a divisionoperation
drem(), dremf()
Compute the remainder of two numbers
fmod(), fmodf()
Compute a residue, using floating-point modular arithmetic
ldiv() Perform division on long integers
modf(), modff()
Break a number into integral and fractional parts
remainder(), remainderf()
Compute the floating point remainder
Floating-point settings
These functions set or get attributes of floating-point operations:
fp exception mask()
Get or set the current exception mask
fp exception value()
Get the value of the current exception registers
fp precision() Set or get the current precision
fp rounding() Set or get the current rounding
28 Summary of Functions February 1, 2005