Ultra C Library Reference
Total Page:16
File Type:pdf, Size:1020Kb
Ultra C Library Reference Version 2.6 RadiSys. 118th Street Des Moines, Iowa 50325 515-223-8000 www.radisys.com Revision B • February 2003 Copyright and publication information Reproduction notice This manual reflects version 2.6 of Ultra C Compiler. The software described in this document is intended to Reproduction of this document, in part or whole, by be used on a single computer system. RadiSys Corpo- any means, electrical, mechanical, magnetic, optical, ration expressly prohibits any reproduction of the soft- chemical, manual, or otherwise is prohibited, without written permission from RadiSys Corporation. ware on tape, disk, or any other medium except for backup purposes. Distribution of this software, in part Disclaimer or whole, to any other party or on any other system may constitute copyright infringements and misappropria- The information contained herein is believed to be accurate as of the date of publication. However, tion of trade secrets and confidential processes which RadiSys Corporation will not be liable for any damages are the property of RadiSys Corporation and/or other including indirect or consequential, from use of the parties. Unauthorized distribution of software may OS-9 operating system, Microware-provided software, cause damages far in excess of the value of the copies or reliance on the accuracy of this documentation. involved. The information contained herein is subject to change without notice. February 2003 Copyright ©2003 by RadiSys Corporation. All rights reserved. EPC and RadiSys are registered trademarks of RadiSys Corporation. ASM, Brahma, DAI, DAQ, MultiPro, SAIB, Spirit, and ValuePro are trademarks of RadiSys Corporation. DAVID, MAUI, OS-9, OS-9000, and SoftStax are registered trademarks of RadiSys Corporation. FasTrak, Hawk, and UpLink are trademarks of RadiSys Corporation. † All other trademarks, registered trademarks, service marks, and trade names are the property of their respective owners. Contents Using Functions and Macros................................................................................................................ 22. Library Files......................................................................................................................................... 22. Program Globals.................................................................................................................................. 23. Class 1 Globals ............................................................................................................................. 23. Class 2 Globals ............................................................................................................................. 24. Header Files......................................................................................................................................... 25. The C Library...................................................................................................................................... 43. Communicating with Environment Functions ............................................................................... 43. Character Classification Functions ................................................................................................ 43. Character Conversion Functions ................................................................................................... 44. File Positioning Functions ............................................................................................................. 44. GetStat/SetStat Functions .............................................................................................................. 45. Input/Output Device Functions ..................................................................................................... 47. Input/Output Functions................................................................................................................. 47. Interprocess Communication Functions ........................................................................................ 50. Interrupt Manipulation Functions ................................................................................................. 53. Mathematical Functions................................................................................................................ 54. Memory Management Functions................................................................................................... 54. Shared Data Access Functions ....................................................................................................... 56. Miscellaneous Functions ............................................................................................................... 56. Module Manipulation Functions...................................................................................................58. Multibyte Character and String Functions..................................................................................... 59. OS System Functions..................................................................................................................... 61. POSIX Messaging Functions ......................................................................................................... 61. Process Manipulation Functions.................................................................................................... 62. Resource Locks ............................................................................................................................. 63. Searching and Sorting Functions ................................................................................................... 63. String Handling Functions............................................................................................................. 63. Terminal Manipulation Functions (Termcap)................................................................................ 65. Time Functions ............................................................................................................................. 65. Processor-Specific Functions.......................................................................................................... 68. Implementation-Defined Behavior.................................................................................................69. ANSI “Core” Signals .............................................................................................................. 70. OS-9 “Core” Signals............................................................................................................... 70. OS-9 68K Family Signals ........................................................................................................ 70. OS-9 80x86 Family Signals..................................................................................................... 70. OS-9 PowerPC™ Family Signals............................................................................................. 70. Processor-Specific Family Signals .................................................................................................. 71. 68K Family Processors............................................................................................................ 71. 80x86 Family Processors ........................................................................................................ 72. PowerPC Family Processors.................................................................................................... 72. 3 Contents ARM Family Processors.......................................................................................................... 72. SH Family Processors.............................................................................................................. 73. SPARC Family Processors ....................................................................................................... 73. Equivalents for the sys_clib.l Functions ......................................................................................... 77. The Function Description.............................................................................................................. 80. Syntax..................................................................................................................................... 80. OS-9 Attributes....................................................................................................................... 81. Library.................................................................................................................................... 81. Errors ..................................................................................................................................... 81. References to Other Calls .......................................................................................................81. C Shared Library ................................................................................................................................. 81. abort() ...............................................................................................................................................88 abs() ..................................................................................................................................................89 access() ..............................................................................................................................................90