hp.com home products and services support and drivers solutions how to buy
cd-rom home
End of Jump to page title
HP OpenVMS systems
documentation

Jump to content


HP C

HP C

Run-Time Library Reference Manual for OpenVMS Systems

Order Number: AA-RSMUB-TE


September 2003

This manual describes the functions and macros in the HP C Run-Time Library for OpenVMS systems.

Revision/Update Information: This manual supersedes the HP C Run-Time Library Reference Manual for OpenVMS Systems, Order Number AA-RSMUA-TE

Software Version: HP OpenVMS Alpha Version 7.3-2
OpenVMS VAX Version 7.3




Hewlett-Packard Company Palo Alto, California


First Printing, February 1991
Revised, September 2003

© Copyright 2003 Hewlett-Packard Development Company, L.P.

UNIX® is a registered trademark of The Open Group.

X/Open® is a registered trademark of X/Open Company Ltd. in the UK and other countries.

The information contained herein is subject to change without notice. The only warranties for HP products and services are set forth in the express warranty statements accompanying such products and services. Nothing herein should be construed as constituting an additional warranty. HP shall not be liable for technical or editorial errors or omissions contained herein.

Proprietary computer software. Valid license from HP required for possession, use or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor's standard commercial license.

ZK5763

The HP OpenVMS documentation set is available on CD-ROM.

This document was prepared using DECdocument, Version V3.3-1e.

Portions of the HP C Run-Time Library have been implemented using source copyrighted by the University of California, Berkley and its contributors.

Copyright (c) 1981 Regents of the University of California.

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by the University of California, Berkeley and its contributors.
  4. Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Contents Index


Preface

This manual describes the HP C Run-Time Library (RTL). It provides reference information about the C RTL functions and macros that perform input/output (I/O) operations, character and string manipulation, mathematical operations, error detection, subprocess creation, system access, and screen management. It also notes portability concerns between operating systems, where applicable.

The HP C RTL contains XPG4-compliant internationalization support, providing functions to help you develop software that can run in different languages and cultures.

You can send comments or suggestions regarding this manual or any HP C documentation by sending electronic mail to the following Internet address:

c_docs@hp.com

Intended Audience

This manual is intended for experienced and novice programmers who need reference information on the functions and macros found in the HP C RTL.

Document Structure

This manual has the following chapters, reference section, and appendixes:

Associated Documents

The following documents may be useful when programming in HP C for OpenVMS Systems:

For more information about HP OpenVMS products and services, access the HP Web site at the following location:

http://www.hp.com/go/openvms

How to Order Additional Documentation

For information about how to order additional documentation, visit the following Web site address:

http://www.hp.com/go/openvms/doc/order

Conventions Used in this Document

Convention Meaning
[Return] The symbol [Return] represents a single stroke of the Return key on a terminal.
Ctrl/X The symbol Ctrl/X, where letter X represents a terminal control character, is generated by holding down the Ctrl key while pressing the key of the specified terminal character.
switch statement
int data type
fprintf function
<stdio.h> header file
Monospace type identifies language keywords and the names of HP C functions and header files. Monospace type is also used when referring to a specific variable name used in an example.
arg1 Italic type indicates a placeholder, such as an argument or parameter name, and the introduction of new terms.
$ RUN CPROG [Return] Interactive examples show user input in boldface type.
float x;
.
.
.

x = 5;
A vertical ellipsis indicates that not all of the text of a program or program output is illustrated. Only relevant material is shown in the example.
option,... A horizontal ellipsis indicates that additional parameters, options, or values can be entered. A comma that precedes the ellipsis indicates that successive items must be separated by commas.
[output-source,...] Square brackets, in function synopses and a few other contexts, indicate that a syntactic element is optional. Square brackets are not optional, however, when used to delimit a directory name in an OpenVMS file specification or when used to delimit the dimensions of a multidimensional array in HP C source code.
sc-specifier ::=
auto
static
extern
register
In syntax definitions, items appearing on separate lines are mutually exclusive alternatives.
[a|b] Brackets surrounding two or more items separated by a vertical bar (|) indicate a choice; you must choose one of the two syntactic elements.
<ucDelta symbol> A delta symbol is used in some contexts to indicate a single ASCII space character.

Platform Labels

A platform is a combination of operating system and hardware that provides a distinct environment. This manual contains information applicable to the OpenVMS operating system on both the VAX and Alpha architectures.

The information in this manual applies to both of these platforms, except when specifically labeled, as follows:
Label Explanation
(ALPHA ONLY) Specific to an Alpha processor (Alpha architecture) running the OpenVMS operating system.
(VAX ONLY) Specific to a VAX processor running the OpenVMS operating system.

New and Changed Features - OpenVMS Version 7.3-2

The following enhancements have been made to the C Run-Time Library for OpenVMS Version 7.3-2. These enhancements provide improved UNIX portability and the flexibility of additional user-controlled feature selections. New C RTL functions are also included.

POSIX Style Identifiers

POSIX style identifier support is added to the C RTL, providing additional UNIX portability and standards compliance. POSIX style identifiers refer to the User Identifier (UID), Group Identifier (GID), and Process Group. The scope includes real and effective identifiers.

The support for POSIX style identifiers in the C RTL requires 32-bit user and group ID support and also depends on features in the base version of OpenVMS. POSIX style IDs are supported by OpenVMS Version 7.3-2 and higher.

To use POSIX style identifiers, applications must be compiled for 32-bit UID/GID (by defining the __USE_LONG_GID_T macro), and POSIX style IDs must be enabled by defining the DECC$POSIX_STYLE_UID feature logical name to ENABLE.

To disable POSIX style IDs, define DECC$POSIX_STYLE_UID to DISABLE.

64-bit Pointer Support for Some Socket Routines

64-bit pointer support is added for the following TCP/IP socket routines:


freeaddrinfo   recvmsg 
getaddrinfo    sendmsg 

Previously, these routines had only a 32-bit interface.

Set Default Directory for Child Processes

You can now set the default (working) directory for a child process created by vfork / exec *, using the new C RTL decc$set_child_default_dir function.

New Feature Logicals

The following new feature logicals provide additional standards conformance and UNIX portability:

UNIX File-Name Translation Enhancements

Various enhancements to improve performance, especially through faster UNIX name translation, are included:

New/Changed Functions

The following new C RTL functions are provided with OpenVMS Version 7.3-2:

File Read/Write Functions


   pread         readv            __writev64 
   pwrite        _readv64          

Print Functions


   snprintf 
   vsnprintf 

Signal Functions


   sighold       sigignore        sigrelse       
   sigwait       sigtimedwait     sigwaitinfo        

Time Functions


   nanosleep     clock_gettime 
   clock_getres  clock_settime 

Password Functions


   getpwnam_r    _getpwnam_r64   __getpwnam64   _getpwent64 
   getpwuid      getpwuid_r      __getpwuid64   _getpwuid_r64 

Security/Impersonation Functions


   endgrent      getgrnam        getsid        setpgrp 
   getgrent      getgrnam_r      seteuid       setregid 
   getgrgid      getpgid         setgrent      setreuid 
   getgrgid_r    getpgrp         setpgid       setsid 

Socket Function


   poll 

Miscellaneous Functions


   a64l       globfree    rand_r       decc$set_child_default_dir 
   glob       l64a        ttyname_r          

The following modified C RTL functions are also provided:


   endpwent      setgid          geteuid 
   getegid       setpwent        getgid 
   getpwent      setuid          getuid 
   ttyname 


Next Contents Index