Previous | Contents | Index |
DECC$NO_ROOTED_SEARCH_LISTS controls how the decc$to_vms function resolves search-list logicals and provides a means to restore the OpenVMS behavior prior to Version 7.3-1.
With DECC$NO_ROOTED_SEARCH_LISTS enabled:
Enabling this feature logical provides the pre-Version 7.3-1 behavior for search list logicals.
With DECC$NO_ROOTED_SEARCH_LISTS disabled:
Disabling this feature logical provides the behavior for OpenVMS Version 7.3-1 and later.
DECC$PIPE_BUFFER_SIZE allows a larger buffer size to be used for pipe functions such as pipe and popen . A value of 512 to 65535 bytes can be specified.
If DECC$PIPE_BUFFER_SIZE is not specified, the default buffer size 512 is used.
Default: 512
Minimum: 512
Maximum: 65535
DECC$PIPE_BUFFER_QUOTA lets you specify a buffer quota to use for the pipe function if the optional fourth argument of that function is omitted.
If the optional pipe fourth argument is omitted and DECC$PIPE_BUFFER_QUOTA is not defined, then the buffer quota defaults to the buffer size, as before.
Default: 512
Minimum: 512
Maximum: 2147483647
With DECC$POPEN_NO_CRLF_REC_ATTR enabled, CR/LF carriage control is prevented from being added to the pipe records. This is compatible with UNIX behavior, but be aware that enabling this feature might result in undesired behavior from other functions, such as gets , that rely on the carriage-return character.
By default DECC$POSIX_COMPLIANT_PATHNAMES is disabled, and the usual C RTL behavior prevails. This disabled mode includes interpretation of pathnames as UNIX style specifications and uses rules that are different and unrelated to POSIX-compliant pathname processing.
To enable DECC$POSIX_COMPLIANT_PATHNAMES, set it to one of the following values:
1 | All pathnames are designated as POSIX style. |
2 | Pathnames that end in " : " or contain any of the bracket characters " []<> ", and that can be successfully parsed by the SYS$FILESCAN service, are designated as OpenVMS style. Otherwise, they are designated as POSIX style. |
3 | The pathnames " . " and " .. ", or pathnames that contain " / " are designated as POSIX style. Otherwise, they are designated as OpenVMS style. |
4 | All pathnames are designated as OpenVMS style. |
See Section 12.3.1 for more information.
With DECC$POSIX_SEEK_STREAM_FILE disabled, positioning beyond end-of-file will immediately write zeros to the file from the current end-of-file to the new position.
With this logical name disabled, UIDs and GIDs are derived from the process UIC.
This feature is only available on OpenVMS systems providing POSIX style UID and GID support.
With this logical name disabled, all files without a file type are reported with a trailing period.
With DECC$READDIR_KEEPDOTDIR enabled, directories are reported in UNIX style with a file type of ".DIR".
With this logical name disabled, you get the expected OpenVMS behavior. For example:
Renaming "A.A" to "B" yields "B.A"
rename("file.ext", "logical_name") /* where logical_name = dev:[dir.subdir] */ /* and :[dir.subdir] exists. */ |
This results in:
dev:[dir.subdir]file.ext |
This example renames a file from one directory into another directory, which is the same behavior as in legacy versions of OpenVMS (versions before 7.3-1). Also in this example, if dev:[dir.subdir] does not exist, rename returns an error.
Disabling DECC$RENAME_ALLOW_DIR provides a more UNIX compliant conversion of the "logical_name" argument of rename . Consider the following example with DECC$RENAME_ALLOW_DIR disabled:
rename("file.ext", "logical_name") /* where logical_name = dev:[dir.subdir] */ |
This results in:
dev:[dir]subdir.ext |
This example renames the file using the subdir part of the "logical_name" argument as the new file name because on UNIX systems, renaming a file to a directory is not allowed. So rename internally converts the "logical_name" to a file name, and dev:[dir]subdir is the most reasonable conversion it can perform.
This new feature switch has a side effect of causing rename to a directory to take precedence over rename to a file. Consider this example:
rename ( "file1.ext", "dir2" ) /* dir2 is not a logical */ |
With DECC$RENAME_ALLOW_DIR disabled, this example results in dir2.ext , regardless of whether or not subdirectory [.dir2] exists.
With DECC$RENAME_ALLOW_DIR enabled, this example results in dir2.ext only if subdirectory [.dir2] does not exist. If subdirectory [.dir2] does exist, the result is [.dir2]file1.ext .
If DECC$RENAME_NO_INHERIT is enabled, UNIX compliant behavior is expected, so DECC$RENAME_ALLOW_DIR is ignored, and renaming a file to a directory is not allowed. |
With DECC$SELECT_IGNORES_INVALID_FD disabled, select ignores invalid file descriptors.
With DECC$STDIO_CTX_EOL disabled, each fwrite generates a separate write, which for mailbox and record files generates a separate record.
With DECC$STREAM_PIPE disabled, pipe uses the OpenVMS legacy record I/O. This is the default.
With DECC$STRTOL_ERANGE disabled, the legacy behavior of leaving the pointer at the failing digit is preserved.
The alternate mode protects thread-specific data only if another function has it locked. This protects data that is in use within the C RTL, but does not protect the caller from an AST changing the data pointed to.
This latter mode is now the C RTL default for the strtok , ecvt , and fcvt functions.
You can select the legacy AST safe mode by enabling DECC$THREAD_DATA_AST_SAFE.
Default: 2
Maximum: 2147483647
To enter the value as an octal value, add the leading zero; otherwise, it is translated as a decimal value. For example:
$ DEFINE DECC$UMASK 026 |
Maximum: 0777
The principal logical names affecting UNIX like behavior are grouped as follows:
1 General corrections
10 Enhancements
20 UNIX style file names
30 UNIX style file attributes
90 Full UNIX behavior - No concessions to OpenVMS
Level 30 is appropriate for UNIX like programs such as BASH and GNV.
The DECC$UNIX_LEVEL values and associated groups of affected feature logical names are:
General Corrections (DECC$UNIX_LEVEL 1) DECC$FIXED_LENGTH_SEEK_TO_EOF 1 DECC$POSIX_SEEK_STREAM_FILE 1 DECC$SELECT_IGNORES_INVALID_FD 1 DECC$STRTOL_ERANGE 1 DECC$VALIDATE_SIGNAL_IN_KILL 1 General Enhancements (DECC$UNIX_LEVEL 10) DECC$ARGV_PARSE_STYLE 1 DECC$EFS_CASE_PRESERVE 1 DECC$STDIO_CTX_EOL 1 DECC$PIPE_BUFFER_SIZE 4096 DECC$USE_RAB64 1 UNIX style file names (DECC$UNIX_LEVEL 20) DECC$DISABLE_TO_VMS_LOGNAME_TRANSLATION 1 DECC$EFS_CHARSET 1 DECC$FILENAME_UNIX_NO_VERSION 1 DECC$FILENAME_UNIX_REPORT 1 DECC$READDIR_DROPDOTNOTYPE 1 DECC$RENAME_NO_INHERIT 1 DECC$GLOB_UNIX_STYLE UNIX like file attributes (DECC$UNIX_LEVEL 30) DECC$EFS_FILE_TIMESTAMPS 1 DECC$EXEC_FILEATTR_INHERITANCE 1 DECC$FILE_OWNER_UNIX 1 DECC$FILE_PERMISSION_UNIX 1 DECC$FILE_SHARING 1 UNIX compliant behavior (DECC$UNIX_LEVEL 90) DECC$FILENAME_UNIX_ONLY 1 DECC$POSIX_STYLE_UID 1 DECC$USE_JPI$_CREATOR 1 DECC$DETACHED_CHILD_PROCESS 1 |
|
Enabling DECC$UNIX_PATH_BEFORE_LOGNAME overrides the setting for DECC$DISABLE_TO_VMS_LOGNAME_TRANSLATION.
This feature is only available on systems supporting POSIX style session identifiers.
This provides latent support for file buffers in 64-bit memory.
With this logical name disabled, validation of signals is restricted to checking that the signal value is in the range 0 to _SIG_MAX. If sys$sigprc fails, errno is set based on sys$sigprc exit status.
With DECC$V62_RECORD_GENERATION enabled, the output mechanism follows the rules used for OpenVMS Version 6.2.
With DECC$WRITE_SHORT_RECORDS enabled, short-sized records (records with size less than the maximum record size) written at EOF are padded with zeros to align records on record boundaries. This is the behavior seen in OpenVMS Version 7.3-1 and some ACRTL ECOs of that time period.
With DECC$WRITE_SHORT_RECORDS disabled, the legacy behavior of writing records with no padding is implemented. This is the recommended and default behavior.
With DECC$XPG4_STRPTIME enabled, XPG5 support for the pivoting year is
disabled and all years in the range 0 to 99 are in the current century.
1.7 32-Bit UIDs/GIDs and POSIX Style Identifiers
Where supported in versions of the OpenVMS operating system, POSIX style identifiers refers 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 HP 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 on OpenVMS versions that support them requires applications to be compiled for 32-bit UID/GID. On OpenVMS versions where 32-bit UID/GID is the default, the user or application must still enable POSIX style IDs by defining the DECC$POSIX_STYLE_UID feature logical name:
$ DEFINE DECC$POSIX_STYLE_UID ENABLE |
With POSIX style IDs enabled, at compile time you can selectively invoke the traditional (UIC-based) definition for an individual function by explicitly calling it by its decc$ -prefixed entry point (as opposed to the decc$__long_gid_ -prefixed entry point, which provides the POSIX style behavior).
To disable POSIX style IDs:
$ DEFINE DECC$POSIX_STYLE_UID DISABLE |
OpenVMS Version 7.3-2 and higher supports POSIX style IDs as well as 32-bit UID/GIDs. When an application is compiled to use 32-bit UID/GIDs, the UID and GID are derived from the UIC as in previous versions of the operating system. In some cases, such as with the getgroups function, more information may be returned when the application supports 32-bit GIDs.
To compile an application for 16-bit UID/GID support on systems that by
default use 32-bit UIDs/GIDs, define the _DECC_SHORT_GID_T macro to 1.
1.8 Input and Output on OpenVMS Systems
After you learn how to link with the HP C RTL and call HP C functions and macros, you can use the HP C RTL for its primary purpose: input/output (I/O).
Since every system has different methods of I/O, familiarize yourself with the OpenVMS specific methods of file access. In this way, you will be equipped to predict functional differences when porting your source program from one operating system to another.
Figure 1-2 shows the I/O methods available with the HP C RTL. The OpenVMS system services communicate directly with the OpenVMS operating system, so they are closest to the operating system. The OpenVMS Record Management Services (RMS) functions use the system services, which manipulate the operating system. The HP C Standard I/O and UNIX I/O functions and macros use the RMS functions. Since the HP C RTL Standard I/O and UNIX I/O functions and macros must go through several layers of function calls before the system is manipulated, they are furthest from the operating system.
Figure 1-2 I/O Interface from C Programs
The C programming language was developed on the UNIX operating system, and the Standard I/O functions were designed to provide a convenient method of I/O that would be powerful enough to be efficient for most applications, and also be portable so that the functions could be used on any system running C language compilers.
The HP C RTL adds functionality to this original specification. Since, as implemented in the HP C RTL, the Standard I/O functions recognize line terminators, the HP C RTL Standard I/O functions are particularly useful for text manipulation. The HP C RTL also implements some of the Standard I/O functions as preprocessor-defined macros.
In a similar manner, the UNIX I/O functions originally were designed to provide a more direct access to the UNIX operating systems. These functions were meant to use a numeric file descriptor to represent a file. A UNIX system represents all peripheral devices as files to provide a uniform method of access.
The HP C RTL adds functionality to the original specification. The UNIX I/O functions, as implemented in HP C, are particularly useful for manipulating binary data. The HP C RTL also implements some of the UNIX I/O functions as preprocessor-defined macros.
The HP C RTL includes the Standard I/O functions that should exist on all C compilers, and also the UNIX I/O functions to maintain compatibility with as many other implementations of C as possible. However, both Standard I/O and UNIX I/O use RMS to access files. To understand how the Standard I/O and UNIX I/O functions manipulate RMS formatted files, learn the fundamentals of RMS. See Section 1.8.1 for more information about Standard I/O and UNIX I/O in relationship to RMS files. For an introduction to RMS, see the Guide to OpenVMS File Applications.
Before deciding which method is appropriate for you, first ask this question: Are you concerned with UNIX compatibility or with developing code that will run solely under the OpenVMS operating system?
If you are writing system-level software, you may need to access the OpenVMS operating system directly through calls to system services. For example, you may need to access a user-written device driver directly through the Queue I/O Request System Service ($QIO). To do this, use the OpenVMS level of I/O; this level is recommended if you are an experienced OpenVMS programmer. For examples of programs that call OpenVMS system services, see the HP C User's Guide for OpenVMS Systems.
You may never use the RMS or the OpenVMS system services. The Standard I/O and UNIX I/O functions are efficient enough for a large number of applications. Figure 1-3 shows the dependency of the Standard I/O and the UNIX I/O functions on RMS, and the various methods of I/O available to you.
Figure 1-3 Mapping Standard I/O and UNIX I/O to RMS
Previous | Next | Contents | Index |