Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ld(1)

cachectl(3C)

a.out(4)

magic(4)

chatr(1)

NAME

chatr − change program’s internal attributes

SYNOPSIS

chatr [-n] [-q] [-s] file ...

DESCRIPTION

chatr, by default, prints each file’s magic number and file attributes to the standard output.

Options

With one or more optional arguments, chatr performs the following operations:

-n Change file from demand-loaded to shared. 

-q Change file from shared to demand-loaded. 

-s Perform its operation silently. 

The term shared applies to the magic number SHARE_MAGIC while the term demand-loaded applies to the magic number DEMAND_MAGIC.  Consult How HP-UX Works: Concepts for the System Administrator to see how these magic numbers are interpreted. 

Upon completion, chatr prints the file’s old and new values to standard output unless -s is specified. 

RETURN VALUE

chatr returns zero on success.  If the command line contents is syntactically incorrect, or one or more of the specified files cannot be acted upon, chatr returns the number of files whose attributes could not be modified.  If no files are specified, chatr returns decimal 255. 

DIAGNOSTICS

The error messages produced by chatr are self-explanatory. 

EXAMPLES

Change a.out to demand-loaded

chatr -q a.out

700/800 only: Change binding mode of program file that uses shared libraries to immediate and nonfatal.  Also enable usage of SHLIB_PATH environment variable:

chatr -B immediate -B nonfatal +s enable a.out

700/800 only: Disallow run-time path lookup for the shared library /lib/libc.sl that the shared library libfoo.sl depends on:

chatr +l /lib/libc.sl libfoo.sl

DEPENDENCIES

Series 300/400

The following additional option is supported:

-C cachespec Specify caching mode for the data and/or stack segment.  This option has a mandatory argument, cachespec, which specifies whether a particular segment uses either write-through caching or copyback caching. cachespec consists of one or more of the following arguments, concatenated together:

d Use write-through caching for the data segment. 

D Use copyback caching for the data segment. 

s Use write-through caching for the stack segment. 

S Use copyback caching for the stack segment. 

If no option is specified for a particular segment, the caching mode for that segment remains the same as before. 

In general, copyback caching should be used because it provides better performance.  However, applications that write object code into either the data or stack segment, and then execute the code, do not work with copyback caching, unless the application is modified to flush the cache.  Use of chatr to change the caching mode to write-through should be restricted to those cases where it would be difficult or impossible to change the source code to use cachectl() because simply changing the caching mode does not solve the problem of stale entries in the instruction cache (see cachectl(3C)).

Systems that are based on an MC68020 or MC68030 microprocessor do not have a copyback cache, so the caching mode is always write-through on those systems (i.e., cachespec is ignored). 

Series 700/800

The following additional options are supported:

-l library Indicate that the specified shared library is subject to run-time path lookup if directory path lists are provided (see +s and +b). 

-B bind Select run-time binding behavior of a program using shared libraries.  One of the major binding modes immediate or deferred must be specified.  One or more of the binding modifiers nonfatal or restricted can also be specified, each with a separate option.  See the Programming on HP-UX manual for a description of binding modes. 

+b flag Control whether the directory path list stored when the program was built can be used to locate shared libraries needed by the program.  The two flag values, enable and disable, respectively enable and disable use of the path list.  See the +s option. 

+l library Indicate that the specified shared library is not subject to run-time path lookup if directory path lists are provided (see +s and +b). 

+s flag Control whether the directory path list specified with the SHLIB_PATH environment variable can be used to locate shared libraries needed by the program.  The two flag values, enable and disable, respectively enable and disable use of the environment variable.  If both +s and +b are used, their relative order on the command line indicates which path list will be searched first.  See the +b option. 

AUTHOR

chatr was developed by HP. 

SEE ALSO

ld(1), cachectl(3C), a.out(4), magic(4). 

How HP-UX Works: Concepts for the System Administrator.

Programming on HP-UX.

Hewlett-Packard Company  —  HP-UX Release 9.0: August 1992

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026