home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Current Shareware 1994 January
/
SHAR194.ISO
/
misc
/
aix1025.zip
/
AIX_FAQ.2
< prev
next >
Wrap
Internet Message Format
|
1993-10-27
|
65KB
Path: nlbbs!jaxsat!pagesat!decwrl!uunet!cs.utexas.edu!mavrick!basto@cactus.org
From: basto@cactus.org (Luis Basto)
Newsgroups: comp.unix.aix,news.answers,comp.answers
Subject: AIX Frequently Asked Questions (Part 2 of 3)
Summary: This posting contains a list of Frequently Asked Questions and thei
answers about AIX, IBM's version of Unix.
Keywords: AIX RS/6000 questions answers
Message-ID: <1463@mavrick.UUCP>
Date: 25 Oct 93 06:04:24 GMT
Expires: 15 Nov 93 01:23:45 GMT
Sender: luis@mavrick.UUCP
Reply-To: basto@cactus.org (Luis Basto)
Followup-To: comp.unix.aix
Lines: 1589
Approved: news-answers-request@MIT.Edu
Supersedes: <1460@mavrick.UUCP>
Archive-name: aix-faq/part2
Last-modified: October 25, 1993
Version: 2.42
Version: $Id: aix.faq,v 2.42 93/10/25 basto $
Frequently Asked Questions to AIX 3.x and IBM RS/6000
_____________________________________________________
1.201: How do I do remote backup?
There seems to be several ways of doing this. I found the following works:
tar -b1 -cf - . | rsh REMOTEHOST "dd ibs=512 obs=1024 of=/dev/TAPEDEVICE"
From: kraemerf@franvm3.VNET.IBM.COM (Frank Kraemer)
mksysb will not back up to remote tape devices. The following script
will do remote backups.
[Ed.: I've verified this script works fine. However, it may be slow for
large filesystems since it creates a temp file of filenames in /tmp.]
#!/bin/ksh
# @(#) Create a backup tape of the private user data.
#=================================================================#
# Script : usave.sh #
# Author : F. Kraemer #
# Date : 92/02/19 #
# Update : 92/10/29 #
# Info : the ultimative backup script #
# Example: usave.sh /dev/rmt0 - save to local tape #
# usave.sh /save/save.me - save to local file #
# usave.sh /tmp/pipe - save to remote tape #
#-----------------------------------------------------------------#
PS4="(+) "
#set -x
PROG=$(basename $0)
HOST=$(hostname)
TODAY=$(date +%H:%M:%S)
#-----------------------------------------------------------------#
# cleanup #
#-----------------------------------------------------------------#
cleanup ()
{
ec=$1
error=$2
case "$ec"
in
"$USAGE_EC") # usage error
error="Usage:\t$PROG DeviceName\n" 1>&2
;;
"$NOTAP_EC") # Tape error
error="error:\t$PROG: $DEVICE is not available on the system.\n" 1>&2
;;
"$LISTE_EC") # list error
error="error:\t$PROG: could not create tar list for $LOGNAME.\n" 1>&2
;;
"$NOTAR_EC") # tar command error
error="error:\t$PROG: tar command failed.\n" 1>&2
;;
"$PIPEP_EC") # pipe error
error="error:\t$PROG: mknod command failed.\n" 1>&2
;;
"$NORSH_EC") # rsh error
error="error:\t$PROG: rsh - Remote Shell command failed.\n" 1>&2
;;
"$RHOST_EC") # remote host error
error="error:\t$PROG: Remote Host unknown.\n" 1>&2
;;
*)
;;
esac
case "$DEVICE"
in
#
# Fix the block size if $DEVICE is a tape device
#
/dev/rmt[0-9]*)
echo "\n\t$PROG: Rewinding tape to begin.........(please wait)\n"
tctl -f $DEVICE rewind 2>/dev/null
;;
*) ;;
esac
rm -f ${LIST} ${PIPE} 2>/dev/null
[ -n "$error" ] && echo "\n${error}\n"
trap '' 0 1 2 15
exit "$ec"
}
#-----------------------------------------------------------------#
# Variables. #
#-----------------------------------------------------------------#
USAGE_EC=1 # exit code for usage error
NOMNT_EC=2 # exit code wrong device name
NOTAP_EC=3 # exit code no tape available
LISTE_EC=4 # exit code backup list error
NOTAR_EC=5 # exit code for wrong tar
TRAPP_EC=6 # exit code for trap
PIPEP_EC=7 # exit code for pipe
RHOST_EC=8 # exit code for bad ping
NORSH_EC=9 # exit code for bad rsh
DEVICE="$1" # device to tar into
LIST="/tmp/.tar.$LOGNAME.$$" #
REMOTEH="" # Remote host for backup
REMOTET="" # Remote tape for backup
tapedev= #
PIPE="/tmp/pipe" # Pipe for remote backup
#-----------------------------------------------------------------#
# main() #
#-----------------------------------------------------------------#
tput clear
echo "\n\t$PROG started from $LOGNAME@$HOST on $TERM at $TODAY.\n"
rm -f $LIST 2>/dev/null
#-----------------------------------------------------------------#
# Trap on exit/interrupt/break to clean up #
#-----------------------------------------------------------------#
trap "cleanup $TRAPP_EC \"Abnormal program termination. $PROG"\" 0 1 2 15
#-----------------------------------------------------------------#
# Check command options #
#-----------------------------------------------------------------#
[ "$#" -ne 1 ] && cleanup "$USAGE_EC" ""
#-----------------------------------------------------------------#
# Check device name #
#-----------------------------------------------------------------#
[ `expr "$DEVICE" : "[/]"` -eq 0 ] && cleanup "$NOMNT_EC" \
"$PROG: Backup device or file name must start with a '/'."
#-----------------------------------------------------------------#
# Check tape device. #
#-----------------------------------------------------------------#
case "$DEVICE"
in
#
# Fix the block size if $DEVICE is a tape device
#
/dev/rmt[0-9]*)
#
echo "\n\t$PROG: Verify backup media ($DEVICE)............\n"
#
# see if a low or high density tape device was specified
# (eg rmt0.1)
density="`expr $DEVICE : \
"/dev/rmt[0-9]*\.\([0-9]*\)"`"
#
# strip /dev/ from device name and
# get the base name (eg translate:
# /dev/rmt0.2 to rmt0)
#
tapedev="`expr $DEVICE : \
"/dev/\(rmt[0-9]*\)[\.]*[0-9]*"`"
#
# Check if the tape is defined in the system.
lsdev -C -c tape -S Available -F "name" | grep $tapedev >/dev/null 2>&
rc=$?
[ "$rc" -ne 0 ] && cleanup "$NOTAP_EC" ""
#
# Restore old tape name.
#
[ "${density:-1}" -lt 4 ] && density=1 || density=5
DEVICE="/dev/${tapedev}.${density}"
echo "\n\t$PROG: Insert a tape in ($DEVICE)........(press enter)\n"
read TEMP
echo "\n\t$PROG: Rewinding tape to begin...........(please wait)\n"
tctl -f $DEVICE rewind 2>/dev/null
;;
#
# Backup is done on remote host. The remote shell facility
# must be set up and running.
#
${PIPE}*)
#
echo "\n\t$PROG: Assuming remote backup via network.\n"
echo "\t$PROG: Enter name of Remote Host ===> \c"
read REMOTEH
echo "\n\t$PROG: Pinging Remote Host to test connection.\n"
ping ${REMOTEH} 1 1 >/dev/null 2>&1
rc=$? # give up unknown host
[ "$rc" -ne 0 ] && cleanup "$RHOST_EC" ""
JUNK=$(rsh ${REMOTEH} "/usr/sbin/lsdev -C -c tape -S Available")
rc=$? # give up rsh failed
[ "$rc" -ne 0 ] && cleanup "$NORSH_EC" ""
echo "\t$PROG: Available Tapes on ${REMOTEH} are :\n\n\t\t${JUNK}\n"
echo "\t$PROG: Enter name of Remote Tape (e.g. /dev/rmt0) ===> \c"
read REMOTET
echo "\n\t$PROG: Insert tape on ${REMOTEH} in ${REMOTET}..(pres
enter)"
read TEMP
echo "\t$PROG: Rewinding Remote Tape ${REMOTET} on ${REMOTEH}.\n"
rsh ${REMOTEH} "tctl -f ${REMOTET} rewind"
rc=$? # give up rsh failed
[ "$rc" -ne 0 ] && cleanup "$NOTAP_EC" ""
rm -f ${PIPE} 2>/dev/null
mknod ${PIPE} p
rc=$? # give up mknod failed
[ "$rc" -ne 0 ] && cleanup "$PIPEP_EC" ""
cat ${DEVICE} | rsh ${REMOTEH} "dd of=${REMOTET} obs=100b 2>/dev/null
&
;;
*) ;;
esac
#-----------------------------------------------------------------#
# Prepare the list. #
#-----------------------------------------------------------------#
echo "\n\t$PROG: Create list of files to be saved...."
find $HOME -print > $LIST
rc=$?
[ "$rc" -ne 0 ] && cleanup "$LISTE_EC" ""
#-----------------------------------------------------------------#
# tar the files. #
#-----------------------------------------------------------------#
echo "\n\t$PROG: Changing current directory to (/)...."
cd / > /dev/null 2>&1
echo "\n\t$PROG: Running tar format backup from user ($LOGNAME)...."
tar -cvf "$DEVICE" -L "$LIST"
rc="$?"
[ "$rc" -ne 0 ] && cleanup "$NOTAR_EC" ""
#-----------------------------------------------------------------#
# Backup completed #
#-----------------------------------------------------------------#
TODAY=$(date +%H:%M:%S)
echo "\n\t$PROG ended at $TODAY............................\n\n"
cleanup 0
#-----------------------------------------------------------------#
# EOF #
#-----------------------------------------------------------------#
1.202: How do I backup a multi-disk volume group?
From: pack@acd.ucar.edu (Daniel Packman)
[ Ed.: I have not verified this procedure. I would actually recommend
NOT to have one volume group span multiple disks unless you really
need such big logical volumes. ]
1. If you have a set of three or more disks in a volume group
(typically 3 for 5xx machines with three internal drives;
with only two, the procedures outlined here have to be modified
to ignore the fact that you don't have a quorum in the volume group)
2. If one drive has failed (usually only one fails at a time :-) )
It is possible to go through a service boot (the volume group is called
rootvg and one of the 2 good disks on it is called hdisk0):
importvg -y rootvg hdisk0
varyonvg -f -n -m1 rootvg
These commands will work, but give error messages. If you wish to mount
a user filesystem, say /u on logical volume /dev/lv00, then
mount -f /dev/lv00 /v
will work only if jfslog, the journaled file system log device, is not
on the damaged disk. If it is, you must (and can in any case) mount the
filesystem read-only:
mount -f -r /dev/lv00 /v
This crucial and rather obvious point baffled several level 3 support
personnel at Austin as well as myself for almost a week. Once the file
system(s) of interest are available, they can be saved to tape for
restoration later. Of course, one can expect only about two thirds of a
filesystem to be recoverable if it spans all 3 physical disks. One
other point to remember is that the standard boot procedure from floppy
includes the restore command but does not include the backup command.
*****************************************************************************
* If you do not have other RS6000 machines at your site it is imperative *
* that you either build a bootable tape which includes either restore or *
* tar or cpio (a bootable floppy set will not have enough space) or at the *
* very least copy onto a spare floppy backup, cpio, or tar. The floppy *
* should be created with backup -ivq so that its contents can be read into *
* the memory resident system after booting. *
*****************************************************************************
All is not lost if tar, cpio or backup are available on an undamaged
disk that can be mounted. Since tar and cpio are in /bin, they may both
very well be unavailable.
It is a very good idea for those who have tape devices to build a
bootable tape with their desired extra commands in it. Follow the
instructions from IBM but add your desired commands to the following
three files:
/usr/lpp/bosinst/tape2
/usr/lpp/bosinst/diskette/boot2
/usr/lpp/bosinst/diskette/inslist
If you have anything other than a minimum memory configuration, you
should be able to add many commands.
1.203: How do I put multiple backups on a single 8mm tape?
From: kerm@mcnc.org (Cary E. Burnette)
There are two possible solutions to this, both of which use /dev/rmt0.1
which is non-rewinding.
SOLUTION #1
-----------
To put multiple backups on a single tape, use /dev/rmt0.1, which is a
no-rewind device, using either rdump or backup (both by name & inode
work). Using rdump or backup "byinode" both generate the message that
the tape is rewinding but actually do not. This is an example that
works on my system:
# rsh remote1 -l root /etc/rdump host:/dev/rmt0.1 -Level -u /u
# rsh remote2 -l root /etc/rdump host:/dev/rmt0.1 -Level -u /u
# tctl -f /dev/rmt0.1 rewind # rewinds the tape
where I am implementing the command from host.
To restore a table of contents of the first I would use
# restore -f /dev/rmt0.1 -s1 -tv
where the -s1 flag tells restore to go to the first record on the tape.
Type the exact command again to get the second record. The -s(Number)
means go to Number record from this spot. It works pretty well.
SOLUTION #2
-----------
Steve Knodle
Educational Resources Center
Clarkson University
I use:
------------------- Dump.sh --------------------
CONTENTSFILE=`date |dd conv=lcase |sed -e 's/19//' |awk '{print $6 $2 $3}'`
set -x
LEVEL=$1
shift
backup -c -b 56 -$LEVEL -uf /dev/rmt0.1 /
backup -c -b 56 -$LEVEL -uf /dev/rmt0.1 /usr
backup -c -b 56 -$LEVEL -uf /dev/rmt0.1 /u
tctl -f /dev/rmt0 rewind
touch /usr/local/dumps/Contents.$CONTENTSFILE
echo "Dumping /" >>/usr/local/dumps/Contents.$CONTENTSFILE
restore -t -s 1 -f /dev/rmt0.1 >>/usr/local/dumps/Contents.$CONTENTSFILE
echo "Dumping /usr" >>/usr/local/dumps/Contents.$CONTENTSFILE
restore -t -q -s 1 -f /dev/rmt0.1 >>/usr/local/dumps/Contents.$CONTENTSFILE
echo "Dumping /u" >>/usr/local/dumps/Contents.$CONTENTSFILE
restore -t -q -s 1 -f /dev/rmt0.1 >>/usr/local/dumps/Contents.$CONTENTSFILE
tctl -f /dev/rmt0 rewind
I process the table-of-contents first by a little program that does
common prefix encoding, and then compress.
This gives a table of contents file I can keep on-line until the tape
is reused.
1.204: How can I make an exact duplicate of a tape over the network?
The challenge here is not to have to create a temporary file (disk space
limitation) and work across heterogeneous networks.
This script might work:
LOCAL=/dev/tape_dev
REMOTE=/dev/tape_dev
dd if=$LOCAL ibs=64k obs=512 | rsh remote_host dd ibs=512 obs=64k of=$REMOTE
From: pack@acd.ucar.edu (Daniel Packman)
Daniel provides the following perl script to convert from the known
world's function codes to AIX for compatibility.
#!/bin/perl
# Wrapper to convert input rmt requests to
# AIX 3.2 ioctl numbers. We pass on all commands we don't understand
# I0 MTWEOF -> I10 STWEOF write and end-of-file record
# I1 MTFSF -> I11 STFSF forward space file
# I2 MTBSF -> I12 STRSF reverse space file
# I3 MTFSR -> I13 STFSR forward space record
# I4 MTBSR -> I14 STRSR reverse space record
# I5 MTREW -> I6 STREW rewind
# I6 MTOFFL -> I5 STOFFL rewind and unload tape
# I7 MTNOP -> I0 (no-op? should ignore following count)
# I8 MTRETEN-> I8 STRETEN retension tape, leave at load point
# I9 MTERASE-> I7 STERASE erase tape, leave at load point
#I10 MTEOM (position to end of media ... no ibm equivalent?)
#I11 MTNBSF (backward space file to BOF ... no ibm equivalent?)
@iocs = (10,11,12,13,14,6,5,0,8,7);
open(RMT,"|/usr/sbin/rmt") || die "Can't open pipe to rmt\n";
select(RMT);
$| = 1;
while (<STDIN>) {
s/(^I)(\d$)/I$iocs[$2]/;
exit 0 if $_ =~ /^[Qq]/;
print RMT $_ ; }
exit 0;
______________________________________________________________________________
1.300: Some info about the memory management system
From: Michael Coggins (MCOG@CHVM1.VNET.IBM.COM).
1. Does AIX use more paging space than other unix systems?
Under many scenarios, AIX requires more paging space than other unix
systems. The AIX VMM implements a technique called "early allocation of
paging space". When a page is allocated in RAM, and it is not a
"client" (NFS) or a "persistent" (disk file) storage page, then it is
considered a "working" storage page. Working storage pages are commonly
an application's stack, data, and any shared memory segments. So, when
a program's stack or data area is increased, and RAM is accessed, the
VMM will allocate space in RAM and space on the paging device. This
means that even before RAM is exhausted, paging space is used. This
does not happen on many other unix systems, although they do keep track
of total VM used.
Example 1:
Workstation with 64mb RAM is running only one small application that
accesses a few small files. Everything fits into RAM, including all
accessed data. On AIX, some paging space will already be used. On
other unix systems, paging space will be 100% free. Clearly, this is an
example that shows where we use more paging space than the other machines.
Example 2:
Same machine as above, except we are running in an environment where
many applications are running with inadequate RAM. Also, in this
environment, the system is running applications that are started, run,
left idle, and not in constant use. A session of FRAME running in a
window, for example. What happens is that eventually (theoretically)
all applications will be paged out at least once. On the AIX system and
the other systems the total paging requirements will be the same
(assuming similar malloc algorithm). The major difference is that the
AIX system allocated the paging space pages before they were actually
needed, and the other systems did not allocate them until they were
needed. However, most other systems have an internal variable that gets
incremented as virtual memory pages are used. AIX does not do this.
This can cause the AIX system to run out of paging space (virtual
memory), even though malloc() continues to return memory. This
"feature" allows sparse memory segments to work, but requires that all
normal users of malloc() (sbrk()) know how much virtual memory will be
available (actually impossible), and to handle a paging space low
condition. A big problem. There are some pretty obvious pros and cons
to both methods of doing Virtual Memory.
2. How much paging space do I need?
Concerning the rule of thumb of having 2 times RAM for paging space:
this is rather simplistic, as are most rules of thumb. If the machine
is in a "persistent storage environment", meaning that they have a few
small programs, and lots of data, they may not need even as much as 1
times RAM for paging space. For example, a 1GB database server running
on a 6000 with 256MB of RAM, and only running about 50MB of "working"
storage does not need 512MB of paging space, or even 256MB. They only
need the amount of paging space that will allow all their working
storage to be paged out to disk. This is because the 1GB database is
mostly "persistent storage", and will require little or no paging space.
Excessive paging space may simply mean wasted disk space. However,
avoid insufficient paging space. Tip: Don't have more than one paging
space per disk. Tip: Put lots of RAM in your system - it will use it.
3. Why does vmstat show no free RAM pages?
AIX uses RAM as a possibly huge disk buffer. If you read a file in the
morning, that file is read into RAM, and left there. If no other
programs need that RAM, that file will be left in RAM until the machine
is halted. This means that if you need the file again, access will be
quick. If you need that RAM, the system will simply use the pages the
file was using. The pages were flushed back to disk earlier. This
means that you can get a huge speedup in disk access if you have enough
RAM. For example, a 200MB database will just ease into RAM if you have
a 256MB system.
4. Since vmstat shows no free RAM pages, am I out of RAM?
Probably not. Since disk files will be "mapped" into RAM, if vmstat
shows lots of RAM pages FREE, then you probably have too much RAM (not
usual on a RISC System/6000)!
5. Shouldn't the "avm" and the "fre" fields from vmstat add up to something?
No. The "avm" field tells you how much "Active Virtual Memory" AIX
thinks you are using. This will closely match the amount of paging
space you are using. This number has *ABSOLUTELY* nothing to do with
the amount of RAM you are using, and does *NOT* include your mapped
files (disk files).
6. Why does the "fre" field from vmstat sometimes show lots of free
RAM pages?
This will happen after an application that used a lot of RAM via
"working" storage (not NFS storage, and not disk file or "persistent"
storage) exits. When RAM pages that were used by working storage (a
program's stack and data area) are no longer needed, there is no need to
leave them around. AIX completely frees these RAM pages. The time to
access these pages versus a RAM page holding a "sync'd" mapped file is
almost identical. Therefore, there is no need to periodically "flush"
RAM.
7. Is the vmstat "fre" field useful?
The vmstat "fre" field represents the number of free page frames. If
the number is consistently small (less than 500 pages), this is normal.
If the number is consistently large (greater than 4000 pages), then you
have more memory than you need in this machine.
1.301: How much should I trust the ps memory reports?
From: chukran@austin.VNET.IBM.COM
Using "ps vg" gives a per process tally of memory usage for each running
process. Several fields give memory usage in different units, but these
numbers do not tell the whole story on where all the memory goes.
First of all, the man page for ps does not give an accurate description
of the memory related fields. Here is a better description:
RSS - This tells how much RAM resident memory is currently being used
for the text and data segments for a particular process in units of
kilobytes. (this value will always be a multiple of 4 since memory is
allocated in 4 KB pages).
%MEM - This is the fraction of RSS divided by the total size of RAM for
a particular process. Since RSS is some subset of the total resident
memory usage for a process, the %MEM value will also be lower than actual.
TRS - This tells how much RAM resident memory is currently being used
for the text segment for a particular process in units of kilobytes.
This will always be less than or equal to RSS.
SIZE - This tells how much paging space is allocated for this process
for the text and data segments in units of kilobytes. If the executable
file is on a local filesystem, the page space usage for text is zero.
If the executable is on an NFS filesystem, the page space usage will be
nonzero. This number may be greater than RSS, or it may not, depending
on how much of the process is paged in. The reason RSS can be larger is
that RSS counts text whereas SIZE does not.
TSIZ - This field is absolutely bogus because it is not a multiple of 4
and does not correlate to any of the other fields.
These fields only report on a process text and data segments. Segment
size which cannot be interrogated at this time are:
Text portion of shared libraries (segment 13)
Files that are in use. Open files are cached in memory as
individual segments. The traditional kernel cache buffer
scheme is not used in AIX 3.
Shared data segments created with shmat.
Kernel segments such as kernel segment 0, kernel extension
segments, and virtual memory management segments.
Speaking of kernel segments, the %MEM and RSS report for process zero
are totally bogus for AIX 3.1. The reason why RSS is so big is that the
kernel segment zero is counted twice. For AIX 3.2, this has been
changed, but the whole story is still not known. The RSS value for
process 0 will report a very small number of the swapper private data
segment. It does not report the size of the kernel segment 0, where the
swapper code lives.
In summary, ps is not a very good tool to measure system memory usage.
It can give you some idea where some of the memory goes, but it leaves
too many questions unanswered about the total usage.
______________________________________________________________________________
1.400: How do I make an informative prompt in the shell?
In the Korn Shell (ksh), the PS1 variable is expanded each time it is
printed, so you can use:
$ myhost=`hostname`
$ PS1='$LOGNAME@$myhost $PWD \$ '
to get, e.g.
bengsig@ieibm1 /u/bengsig $
In the C-shell, use:
% set myhost=`hostname`
% alias cd 'chdir \!* > /dev/null; set prompt="$LOGNAME@$myhost $cwd % "'
% cd
to get, e.g.
bengsig@dkunix9 /u/bengsig/aixfaq %
There is no easy solution in the Bourne Shell. Use the Korn Shell instead.
1.401: How do I set up ksh for emacs mode command line editing?
From: scotte@cdsac.uucp (L. Scott Emmons)
The ksh has an undocumented way of binding the arrowkeys to the emacs
line editing commands. In your .kshrc, add:
alias __A=^P
alias __B=^N
alias __C=^F
alias __D=^B
alias __H=^A
Note that "^P" (et al) must be the actual control sequence.
Type "set -o emacs" or put this line in your .profile.
Also, you MUST have PTF U406855 for this to work in AIX 3.2. The APAR #
for the problem is IX25982, which may have been superceded.
1.402: Listing files with ls causes a core dump
From: John F Haugh II
Scenario: a directory that is shared by N users (N >= 200).
Run 'ls -l' in that directory. It goes for a while, then
Seg fault(coredump)!
It only occurs when the usernames are displayed (almost every file is
owned by a different person). The -g and -n options work fine; only -l
and -o (which shows owner and not group) cause it.
I believe that this problem was corrected by U407548. If you have that
many users that you are having core dump problems (it took over 200),
you might also want to look into getting the PTF that fixes IX31403.
That APAR deals with large numbers of accounts and performance problems
associated with looking them up.
1.403: How do I put my own text into InfoExplorer?
With AIX 3.1, you cannot do it. AIX 3.2 has a product called
InfoCrafter that allows you to do that.
1.404: InfoExplorer ASCII key bindings
From: mycroft@hal.gnu.ai.mit.edu (Charles Hannum)
If you just press 'Return' when it starts up, with 'Basic Screen
Operations' highlighted, you'll get some help.
If you look long enough, you'll find a page named 'Using Keys and Key
Sequences in the InfoExplorer ASCII Interface'. It describes the key
sequences and actions. Here are a few to get you started.
Keys Action
Ctrl-W Moves between the Navigation screen and the Reading screen.
If the Navigation screen is displayed, you can press Ctrl-W to display
the Reading screen. If the Reading screen is displayed, you can press
Ctrl-W to display the Navigation screen.
Ctrl-O Makes the menu bar active or inactive. If your text cursor is
located in the text area of the screen, you can press Ctrl-O to make the
menu bar active. If the menu bar is already active, you can press
Ctrl-O to make it inactive, which moves the text cursor to the text area.
Tab Moves to the next menu bar option in the menu bar. If a pull-down
menu is not displayed and you press the Right Arrow key, the next menu
bar option is displayed in reverse video.
1.405: How can I add new man pages to the system?
From: horst@faui63.informatik.uni-erlangen.de (Horst Luehrsen)
Put the man pages in /usr/man, e.g. /usr/man/man1/tcsh.1 for the tcsh
man page. Unter AIX 3.1.10, /usr/lib/makewhatis can be used to update
the makewhatis-database /usr/man/whatis so apropos and whatis know about
the added manpages. /usr/lib/makewhatis should be available on all 3.2
versions.
______________________________________________________________________________
1.500 Which release of X11 do I have?
Run 'lslpp -h X11rte.obj'.
If your output has a line similar to:
01.02.0000.0000 COMPLETE COMMIT 03/04/93 02:05:11 root
you have X11 R4. If your output has a line similar to:
U491068 01.02.0003.0000 COMPLETE COMMIT 07/28/93 12:50:42 root
you have X11 R5.
Some people also call these AIXwindows 1.2.0 and 1.2.3.
1.501: How to prevent ctrl-alt-backspace from killing the X session
Start X with 'xinit -T' to disable ctrl-alt-backspace from stopping X.
1.502: Who has a termcap/terminfo source for the HFT console?
The console used on the RISC System/6000, PS/2 and RT can be used as a
terminal on another system with the termcap below. You can find this
and other termcaps in /lib/libtermcap/termcap.src, including IBM
specific ones. The terminfo sources are stored in /usr/lib/terminfo/*.ti.
This termcap can also be used from an aixterm window.
hf|hft|hft-c|ibm8512|ibm8513|IBM_High_Function_Terminal:\
:co#80:li#25:am:ht:\
:cm=\E[%i%d;%dH:ti=\E[25;1H:te=\E[20h:\
:nd=\E[C:up=\E[A:do=^J:ho=\E[H:\
:bs:sf=\E[S:ec=\E[%dX:\
:cl=\E[H\E[J:cd=\E[J:ce=\E[K:\
:AL=\E[%dL:DL=\E[%dM:al=\E[L:dl=\E[M:\
:im=\E[4h:ei=\E[4l:mi:\
:dm=\E[4h:ed=\E[4l:\
:so=\E[7m:se=\E[m:ul=\E[4m:ue=\E[m:\
:md=\E[1m:mr=\E[7m:mb=\E[5m:me=\E[m:\
:as=^N:ae=^O:sc=\E[s:rc=\E[u:\
:kl=\E[D:kb=^H:kr=\E[C:ku=\E[A:kd=\E[B:kh=\E[H:\
:kn#10:k1=\E[001q:k2=\E[002q:k3=\E[003q:k4=\E[004q:k5=\E[005q:\
:k6=\E[006q:k7=\E[007q:k8=\E[008q:k9=\E[009q:k0=\E[010q:\
:is=\Eb\E[m^O\E[?7h:rs=\Eb\E[m^O\E[?7h\E[H\E[J:
1.503: How can I look at PostScript files? Why is "dpsexec" so lousy?
From: VRBASS@ATLVMIC1 (Vance R. Bass)
You can look at PostScript files using either "xpreview" (in the
optionally installable text formatting services) or you can get
Ghostscript and Ghostview from a comp.sources.x server and build it
yourself.
>From the "xpreview" man page:
The xpreview command is an AIXwindows 1.2- and Motif 1.1-based
application that displays output from the troff command on an AIXwindows
display. The troff command output file must be prepared for any one of
the devX100, devX100K or devpsc devices. The xpreview command also
displays PostScript language files that begin with %!.
"dpsexec" is NOT intended to be a full-service document browser, but
rather a simple DPS code debugger. If you insist on using it, you can
edit your PS code to remove the "showpage" (which will reset dpsexec
and clear the window) to view single-page files. It does not handle
multi-page files gracefully.
1.504: unix:0 vs `hostname`:0
1.) Is there any way to get the machine to check its local host table
first without renaming resolv.conf?
From: mcguire@selway.umt.edu (Charles J McGuire)
Not that I know of. Under SunOS and Ultrix you can specify, check
/etc/hosts, then NIS, then DNS. On our AIX machines, I have a cron job
that checks the integrity of both the primary and secondary
nameservers every 5 minutes. If they're gone, cron renames
resolv.conf. It continues to check the servers. When they're back,
it moves resolv.conf back. Even with this arrangement, I need to
configure two resolv.conf files that switch the order of the primary
and secondary servers if the primary goes away. If the primary is
unavailable, queries can still take a while to time out on the
primary, before querying the secondary. This method is not very
elegant, but it does the job. Things are a little unstable during the
transitions depending on when the servers go away relative to when
cron runs - not to mention slight differences in clock times.
2.) How do you tell X applications where you are if the console display
is unix:0?
From: crow@waterloo.austin.ibm.com (David L. Crow)
I would suggest that if you have R5, use ":<display>.<screen>". I do
not believe that R4 clients will understand :0, so I would suggest
unix:0 for them.
Without specifying unix or the hostname, you will get the fastest
transport mechanism. While currently there are only two transport
methods in the AIXwindows X server (Unix sockets and TCP sockets),
many vendors are looking at using shared memory as a transport method.
If you use :0 (or :0.0 or :1, etc.), then you should get the best
performance regardless of the available transport methods.
3.) Is there a significant performance penalty incurred by using
`hostname`:0 as DISPLAY?
Yes! Using unix:0, you are using Unix sockets. These are much faster
than their TCP socket counterparts.
1.505: VT100 key bindings for aixterm
From: haedener@iac.unibe.ch (Konrad Haedener)
Add this to your .Xdefaults file and start your VAX session with
'aixterm -v -name vt100 -e telnet MYVAXHOST'
-----
vt100.foreground: Wheat
vt100.background: MidnightBlue
vt100.font: Rom14.500
vt100.geometry: 80x25+0+0
vt100.vt102: true
vt100.fullcursor: false
vt100.pointerColor: coral
vt100.cursorColor: gray100
vt100.translations: <Key>F1: string(0x1b) string("OP") \n\
<Key>F2: string(0x1b) string("OQ") \n\
<Key>F3: string(0x1b) string("OR") \n\
<Key>F4: string(0x1b) string("OS") \n\
<Key>KP_0: string(0x1b) string("Op") \n\
<Key>KP_1: string(0x1b) string("Oq") \n\
<Key>KP_2: string(0x1b) string("Or") \n\
<Key>KP_3: string(0x1b) string("Os") \n\
<Key>KP_4: string(0x1b) string("Ot") \n\
<Key>KP_5: string(0x1b) string("Ou") \n\
<Key>KP_6: string(0x1b) string("Ov") \n\
<Key>KP_7: string(0x1b) string("Ow") \n\
<Key>KP_8: string(0x1b) string("Ox") \n\
<Key>KP_9: string(0x1b) string("Oy") \n\
<Key>KP_Divide: string(0x1b) string("OQ") \n\
<Key>KP_Multiply: string(0x1b) string("OR") \n\
<Key>KP_Subtract: string(0x1b) string("OS") \n\
<Key>KP_Add: string(0x1b) string("Om") \n\
<Key>KP_Enter: string(0x1b) string("OM") \n\
<Key>KP_Decimal: string(0x1b) string("On") \n\
<Key>Next: string(0x1b) string("Ol") \n\
<Key>Left: string(0x1b) string("OD") \n\
<Key>Up: string(0x1b) string("OA") \n\
<Key>Right: string(0x1b) string("OC") \n\
<Key>BackSpace : string(0x7f) \n\
<Key>Down: string(0x1b) string("OB")
You should also add
XENVIRONMENT=$HOME/.Xdefaults
export XENVIRONMENT
to your .profile.
______________________________________________________________________________
1.600: My named dies frequently, why?
Running on 3.2, named dies frequently on network's primary name server.
From: jpe@ee.egr.duke.edu (John P. Eisenmenger)
Try the following:
stopsrc -s named # stop running named
setenv MALLOCTYPE 3.1 # use 3.1 memory allocation algorithm
/etc/named ... # don't use smit to start named
You might be able to use startsrc/smit after setting MALLOCTYPE and get
the same effect, but I'm not sure.
[According to John, the problem is malloc() in the named code. He
also suggests using Berkeley's bind, which he has ported and can be
ftp'ed from ftp.egr.duke.edu, /archives/network/bind-4.8.3.tar.Z. -ed]
Two ptfs should fix this problem. Get U412332 and U414752.
Christophe Wolfhugel <Christophe.Wolfhugel@grasp.insa-lyon.fr> reports
that bind 4.9 works fine on AIX 3.2 and without MALLOCTYPE=3.1.
1.601: How do I trace ethernet packets on an AIX system?
From: afx@muc.ibm.de (Andreas Siegert)
Do the following:
iptrace -i en0 /tmp/ipt
The iptrace backgrounds. Find its process id and kill it when you are
ready. Then run
ipreport -rns /tmp/ipt >/tmp/ipr
and look at the output. The current version of Info does not document
the r, n and s options but they are quite useful for layering the output.
1.602 What is the authorized way of starting automount at boot time?
From: curt@ekhadafi.austin.ibm.com (Curt Finch)
I put this in my /etc/inittab:
automount:2:once:/usr/etc/automount -T -T -T -v >/tmp/au.se 2>&1
I hereby dub it authorized.
1.603: How do I set a tty port for both dial-in and dial-out?
Set the mode of the tty to be either 'shared' or 'delayed'.
1.604: How to move or copy whole directory trees across a network
The following command will move an entire directory tree across a network
while preserving permissions, uids and gids.
$rsh RemoteHost "cd TargetDir; tar -cBf - ." | tar -xvBf -
Explanation:
The tar-create is rsh'd to the remote system and is written to
stdout (the pipe).
The local system is extracting the tar that is being read from
stdin (the pipe).
1.605: How can I send mail to hosts that cannot be pinged?
From: jupiter.sun.csd.unb.ca!dedourek (John DeDourek)
AIX 3.2 as shipped is configured to only send mail to mail addresses
which include a host name. Many organizations use a mail address whose
"host name" part is not a host name (technically an MX name). To change
the configuration of the AIX mailer, login as root. Then edit the file
/etc/sendmail.cf to remove the comment marker ("# ") at the beginning of
the line which reads:
# OK MX
Now rebuild the machine readable form of the configuration with
sendmail -bz
and finally restart signal sendmail to load the new configuration by one
of the following:
reboot
or
stopsrc -s sendmail
startsrc -s sendmail
or
kill -1 `cat /etc/sendmail.pid`
1.606: How to setup dialup SLIP
From: marvin@tornado.oche.de (Christian Bode)
If you don't have problems with slattach you should have PTF
bos.obj 3.2.0.0.U411505 installed. I assume that you did the right
ifconfig commands to setup your slip-device (for example sl0).
1. Create a group called slip.
2. Create a user slip with smit like this:
[Entry Fields]
* User NAME [slip]
ADMINISTRATIVE User? true
User ID []
LOGIN user? true
PRIMARY group [slip]
Group SET [slip]
ADMINISTRATIVE groups [system]
SU groups [slip]
HOME directory [/home/slip]
Initial PROGRAM [/bin/sh]
User INFORMATION [SLIP-Dialup]
Another user can SU to user? false
User can RLOGIN? true
TRUSTED PATH? nosak
Valid TTYs [/dev/tty1]
AUDIT classes []
PRIMARY authentication method [SYSTEM]
SECONDARY authentication method [NONE]
Max FILE size [2097151]
Max CPU time [-1]
Max DATA segment [262144]
Max STACK size [65536]
Max CORE file size [2048]
Max physical MEMORY [65536]
File creation UMASK [022]
EXPIRATION date (MMDDhhmmyy) [0]
3. Create a tty with getty on it:
Add a TTY
[Entry Fields]
TTY type tty
TTY interface rs232
Description Asynchronous Terminal
Parent adapter sa0
* PORT number [s1]
BAUD rate [38400]
PARITY [none]
BITS per character [8]
Number of STOP BITS [1]
TERMINAL type [dumb]
STATE to be configured at boot time [available]
DMA on
Read Trigger 0,1,2,3
Transmit buffer count [16]
Name of initial program to run [/etc/getty]
Note: The following attributes are only applicable if /etc/getty is
specified as the initial program to run.
Enable program? respawn
Run level 2
Enable LOGIN share
TIME before advancing to next port setting [0]
STTY attributes for RUN TIME [hupcl,cread,brkint>
STTY attributes for LOGIN [hupcl,cread,echoe,>
RUN shell activity manager no
Optional LOGGER name []
4. Change the hardware characteristics so that it uses NO XON/XOFF handshake
5. Here is the the .profile for User slip to manage dialups
PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/
sr/bin/X11:/sbin:/usr/local/bin:.
ENV=$HOME/.kshrc
HISTSIZE=128
export PATH ENV HISTSIZE
#
# Search for a LCK-File for our tty if there is one
#
if test -f /etc/locks/LCK..tty1
then
SHPID=`cat /etc/locks/LCK..tty1`
else
echo `date` " No LCK-File !!!" >>slip.log
exit 64
fi
#
# Search for our own Shell to get the PID for checking against LCK-File
#
SH2PID=`ps -aef |
sed -n -e 's/^ *slip *\([0-9][0-9]*\) .*-sh *$/\1/p`
#
# Is it the the same PID as in the LCK File so that we can start working ??
#
if test $SHPID = $SH2PID
then
# remove the LCK-File because slattach does not like it.
rm -rf /etc/locks/LCK..tty1
# Add RTS/CTS Handshakeing to our own tty
stty add rts
# Startup slattach. Slattach has to have mode 4755 to be started up !!!
/usr/sbin/slattach tty1
# Just say that we are up.
echo `date` " Starting up slip-daemon " >>slip.log
# leave slattach enough time to startup
sleep 4
else
# Something must be wrong with the LCK-File
SH3PID=`ps -aef | awk ' {print $2}' | grep $SHPID`
if test ."$SH3PID" = .""
then
SH3PID="NO_SUCH_PROCESS"
fi
if test $SHPID = $SH3PID
then
# There is a living process which owns the LCK-File !!
echo `date` " Can't remove LCK-File, not owner !!!" >>slip.log
exit 64
else
# Who the hell didn't remove the LCK-File (should never happen)
echo `date` " LCK-File with no owner found !!!" >>slip.log
exit 64
fi
fi
# Get the pid of slattch so that we can kill him later on.
SLPID=`ps -aef |
sed -n -e 's/^ *slip *\([0-9][0-9]*\) .*-.*\/usr\/sbin\/slattach tty
*$/\1/p`
# Kill slattach if we get a signal 1 (Carrier Lost ? / Otherside-slattach
terminated )
trap "kill $SLPID; exit 0" 1
# We will have a nice sleep and nice dreamings
while sleep 256
do
:
done
______________________________________________________________________________
1.900: SCSI-1 and SCSI-2 "interoperability" got you confused?
From: drr
A. SCSI-1 devices are supported on a SCSI-2 adapter. This
config will provide SCSI-1 performance.
B. SCSI-2 devices are supported on a SCSI-1 adapter. This
config will provide SCSI-1 performance.
C. A mix of SCSI-2 and SCSI-1 devices are supported on a SCSI-1
adapter. All devices will have SCSI-1 performance.
D. A mix of SCSI-2 and SCSI-1 devices are supported on a SCSI-2
adapter. SCSI-2 devices will have SCSI-2 performance (10 MB/sec)
and SCSI-1 devices will have SCSI-1 performance (4-5 MB/sec).
1.901: How to get your keyboard back after unplugging it from the 6000
From: Mickey Coggins and Anne Serre
When you unplug your keyboard from a running system, and plug it back
in, the key mapping is wrong. For example, keys like Caps Lock and Ctrl
don't work as designed.
Solution: Type at the command line
/usr/lpp/diagnostics/da/dkbd
Your screen goes black, you hear a few beeps, and your keyboard is reset.
It works with any environment, Xwindows, hft, NLS...
For Models 220, 230 and M20, use the following commands:
/usr/lpp/diagnostics/da/dkbd
/usr/lpp/diagnostics/da/dkbdsal (for the 220)
1.902: How do I set up pcsim, the DOS emulator?
You must have a bootable DOS diskette to install pcsim. Either DOS 3.3,
4.x, or 5.0 will work. IBM do not officially support DOS 5.0 for pcsim
but I have no problems with it. Just don't try to be fancy with the UMB
and memory manager stuff.
With a bootable DOS disk in the drive, do:
$touch /u/dosdrive (this is the AIX file for DOS emulation)
$pcsim -Adiskette 3 -Cdrive /u/dosdrive
You would now get an A prompt. Type:
A> fdisk
Create the virtual C drive of whatever size you choose. Make it large
enough for your needs since you cannot enlarge it later.
A> format c: /s (to format the virtual C drive)
Now exit from pcsim with ESCpcsim (Esc key followed by pcsim).
Now create a simprof file. Following is a starter:
Adiskette : 3
Cdrive :/u/dosdrive
lpt1 : name of printer queue
refresh : 50
dmode : V
mouse : com1
You can now start pcsim anytime by typing pcsim. Make sure no floppies
are in the drive. For further information, refer to publication
SC23-2452, Personal Computer Simulator/6000 Guide and Reference.
1.903: How do I transfer files between AIX and DOS disks?
In one of the bos extensions are commands for transferring files between
DOS diskettes and AIX. The commands are dosread, doswrite, dosdir, dosdel,
and dosformat. Many users have mentioned that the mtools package from
prep.ai.mit.edu is better than the native AIX programs.
_____________________________________________________________________________
2.00: C/C++
Contrary to many people's belief, the C environment on the RS/6000 is
not very special. The C compiler has quite a number of options that can
be used to control how it works, which "dialect" of C it compiles, how
it interprets certain language constructs, etc. InfoExplorer includes a
Users Guide and a Reference Manual.
The compiler can be invoked with either xlc for strict ANSI mode and cc
for RT compatible mode (i.e. IBM 6150 with AIX 2). The default options
for each mode are set in the /etc/xlc.cfg file, and you can actually add
another stanza and create a link to the /bin/xlc executable.
The file /usr/lpp/xlc/bin/README.xlc has information about the C
compiler, and the file /usr/lpp/bos/bsdport contains useful information,
in particular for users from a BSD background.
The file /etc/xlc.cfg also shows the symbol _IBMR2 that is predefined,
and therefore can be used for #ifdef'ing RS/6000 specific code.
2.01: I cannot make alloca work
A famous routine, in particular in GNU context, is the allocation
routine alloca(). Alloca allocates memory in such a way that it is
automatically free'd when the block is exited. Most implementations
does this by adjusting the stack pointer. Since not all C environments
can support it, its use is discouraged, but it is included in the xlc
compiler. In order to make the compiler aware that you intend to use
alloca, you must put the line
#pragma alloca
before any other statements in the C source module(s) where alloca is
called. If you don't do this, xlc will not recognize alloca as anything
special, and you will get errors during linking.
For AIX 3.2, it may be easier to use the -ma flag.
2.02: How do I compile my BSD programs?
The file /usr/lpp/bos/bsdport contains information on how to port
programs written for BSD to AIX 3.1. This file may be very useful for
others as well.
A quick cc command for most "standard" BSD programs is:
$ cc -D_BSD -D_BSD_INCLUDES -o [loadfile] [sourcefile.c] -lbsd
If your software has system calls predefined with no prototype
parameters, also use the -D_NO_PROTO flag.
2.03: Isn't the linker different from what I am used to?
Yes. It is not at all like what you are used to:
- The order of objects and libraries is normally _not_ important. The
linker reads _all_ objects including those from libraries into memory
and does the actual linking in one go. Even if you need to put a
library of your own twice on the ld command line on other systems, it
is not needed on the RS/6000 - doing so will even make your linking slower.
- One of the features of the linker is that it will replace an object in
an executable with a new version of the same object:
$ cc -o prog prog1.o prog2.o prog3.o # make prog
$ cc -c prog2.c # recompile prog2.c
$ cc -o prog.new prog2.o prog # make prog.new from prog
# by replacing prog2.o
- The standard C library /lib/libc.a is linked shared, which means that
the actual code is not linked into your program, but is loaded only
once and linked dynamically during loading of your program.
- The ld program actually calls the binder in /usr/lib/bind, and you can
give ld special options to get details about the invocation of the
binder. These are found on the ld man page or in InfoExplorer.
- If your program normally links using a number of libraries (.a files),
you can 'prelink' each of these into an object, which will make your
final linking faster. E.g. do:
$ cc -c prog1.c prog2.c prog3.c
$ ar cv libprog.a prog1.o prog2.o prog3.o
$ ld -r -o libprog.o libprog.a
$ cc -o someprog someprog.c libprog.o
This will solve all internal references between prog1.o, prog2.o and
prog3.o and save this in libprog.o Then using libprog.o to link your
program instead of libprog.a will increase linking speed, and even if
someprog.c only uses, say prog1.o and prog2.o, only those two modules
will be in your final program. This is also due to the fact that the
binder can handle single objects inside one object module as noted above.
If you are using an -lprog option (for libprog.a) above, and still want
to be able to do so, you should name the prelinked object with a
standard library name, e.g. libprogP.a (P identifying a prelinked
object), that can be specified by -lprogP. You cannot use the archiver
(ar) on such an object.
You should also have a look at section 3.01 of this article, in
particular if you have mixed Fortran/C programs.
Dave Dennerline (dad@adonis.az05.bull.com) claims that his experiences
in prelinking on AIX does not save much time since most people have
separate libraries which do not have many dependencies between them,
thus not many symbols to resolve.
2.04: How do I link my program with a non-shared /lib/libc.a?
cc -o prog -bnoso -bI:/lib/syscalls.exp obj1.o obj2.o obj3.o
will do that for a program consisting of the three objects obj1.o, etc.
2.05: How do I make my own shared library?
To make your own shared object or library of shared objects, you should
know that a shared object cannot have undefined symbols. Thus, if your
code uses any externals from /lib/libc.a, the latter MUST be linked with
your code to make a shared object. Mike Heath (mike@pencom.com) said it
is possible to split code into more than one shared object when externals
in one object refer to another one. You must be very good at
import/export files. Perhaps he or someone can provide an example.
Assume you have one file, sub1.c, containing a routine with no external
references, and another one, sub2.c, calling stuff in /lib/libc.a. You
will also need two export files, sub1.exp, sub2.exp. Read the example
below together with the examples on the ld man page.
---- sub1.c ----
int addint(int a, int b)
{
return a + b;
}
---- sub2.c ----
#include <stdio.h>
void printint(int a)
{
printf("The integer is: %d\n", a);
}
---- sub1.exp ----
#!
addint
---- sub2.exp ----
#!
printint
---- usesub.c ----
main()
{
printint( addint(5,8) );
}
The following commands will build your libshr.a, and compile/link the
program usesub to use it. Note that you need the ld option -lc for
sub2shr.o since it calls printf from /lib/libc.a.
$ cc -c sub1.c
$ ld -o sub1shr.o sub1.o -bE:sub1.exp -bM:SRE -T512 -H512
$ cc -c sub2.c
$ ld -o sub2shr.o sub2.o -bE:sub2.exp -bM:SRE -T512 -H512 -lc
$ ar r libshr.a sub1shr.o sub2shr.o
$ cc -o usesub usesub.c -L: libshr.a
$ usesub
The integer is: 13
$
2.06: Linking my program fails with strange errors. Why?
Very simple, the linker (actually called the binder), cannot get the
memory it needs, either because your ulimits are too low or because you
don't have sufficient paging space. Since the linker is quite different
from normal Unix linkers and actually does much more than these, it also
uses a lot of virtual memory. It is not unusual to need 10000 pages (of
4k) or more to execute a fairly complex linking.
If you get 'BUMP error', either ulimits or paging is too low, if you get
'Binder killed by signal 9' your paging is too low.
First, check your memory and data ulimits; in korn shell 'ulimit -a' will
show all limits and 'ulimit -m 99999' and 'ulimit -d 99999' will
increase the maximum memory and data respectively to some high values.
If this was not your problem, you don't have enough paging space.
If you will or can not increase your paging space, you could try this:
- Do you duplicate libraries on the ld command line? That is never
necessary.
- Do more users link simultaneously? Try having only one linking going
on at any time.
- Do a partwise linking, i.e. you link some objects/libraries with the
-r option to allow the temporary output to have unresolved references,
then link with the rest of your objects/libraries. This can be split
up as much as you want, and will make each step use less virtual memory.
If you follow this scheme, only adding one object or archive at a
time, you will actually emulate the behavior of other Unix linkers.
If you decide to add more paging space, you should consider adding a new
paging space on a second hard disk, as opposed to just increasing the
existing one. Doing the latter could make you run out of free space on
your first harddisk. It is more involved to shrink a paging space
but easier to delete one.
2.07: What's with malloc()?
malloc() uses a late allocation algorithm based on 4.3 BSD's malloc()
for speed. This lets you allocate very large sparse memory spaces,
since the pages are not actually allocated until they are touched for
the first time. Unfortunately, it doesn't die gracefully in the face of
loss of available memory. See the "Paging Space Overview" under
InfoExplorer, and see the notes on the linker in this document for an
example of an ungraceful death.
If you want your program to get notified when running out of memory, you
should handle the SIGDANGER signal. The default is to ignore it.
SIGDANGER is sent to all processes when paging space gets low, and if
paging space gets even lower, processes with the highest paging space
usage are sent the SIGKILL signal.
malloc() is substantially different in 3.2, allocating memory more
tightly. If you have problems running re-compiled programs on 3.2, try
running them with MALLOCTYPE=3.1.
2.08: Why does xlc complain about 'extern char *strcpy()'
The header <string.h> has a strcpy macro that expands strcpy(x,y) to
__strcpy(x,y), and the latter is then used by the compiler to generate
inline code for strcpy. Because of the macro, your extern declaration
contains an invalid macro expansion. The real cure is to remove your
extern declaration but adding -U__STR__ to your xlc will also do the trick.
2.09: Why do I get 'Parameter list cannot contain fewer ....'
This is the same as above.
2.10: Why does xlc complain about '(sometype *)somepointer = something'
Software that is developed using GNUC may have this construct. However,
standard C does not permit casts to be lvalues, so you will need to
change the cast and move it to the right side of the assignment. If you
compile with 'cc', removing the cast completely will give you a warning,
'xlc' will give you an error (provided somepointer and something are of
different types - but else, why would the cast be there in the first place?)
2.11: Some more common errors
Here are a few other common errors with xlc:
305 | switch((((np)->navigation_type) ? (*((np)->navigation_type)) :
((void *)0)))
.a...........
a - 1506-226: (S) The second and third operands of the conditional
operator must be of the same type.
The reason for this is that xlc defines NULL as (void *)0, and it does
not allow two different types as the second and third operand of ?:.
The second argument above is not a pointer and the code used NULL
incorrectly as a scalar. NULL is a nil pointer constant in ANSI C and
in some traditional compilers.
You should change NULL in the third argument above to an integer 0.
2.12: Can the compiler generate assembler code?
The traditional -S option is not supported by the XLC compiler, and
there is in fact no way to make the compiler generate machine readable
assembler code. The option -qlist will generate a human readable one in
the .lst file.
2.13: Curses
Curses based applications should be linked with -lcurses and _not_ with
-ltermlib. It has also been reported that some problems with curses are
avoided if your application is compiled with -DNLS.
Peter Jeffe <peter@ski.austin.ibm.com> also notes:
>the escape sequences for cursor and function keys are *sometimes*
>treated as several characters: eg. the getch() - call does not return
>KEY_UP but 'ESC [ C.'
You're correct in your analysis: this has to do with the timing of the
escape sequence as it arrives from the net. There is an environment
variable called ESCDELAY that can change the fudge factor used to decide
when an escape is just an escape. The default value is 500; boosting
this a bit should solve your problems.
Christopher Carlyle O'Callaghan <asdfjkl@wam.umd.edu> has more comments
concerning extended curses:
1) The sample program in User Interface Programming Concepts, page 7-13
is WRONG. Here is the correct use of panes and panels.
#include <cur01.h>
#include <cur05.h>
main()
{
PANE *A, *B, *C, *D, *E, *F, *G, *H;
PANEL *P;
initscr();
A = ecbpns (24, 79, NULL, NULL, 0, 2500, Pdivszp, Pbordry, NULL, NULL);
D = ecbpns (24, 79, NULL, NULL, 0, 0, Pdivszf, Pbordry, NULL, NULL);
E = ecbpns (24, 79, D, NULL, 0, 0, Pdivszf, Pbordry, NULL, NULL);
B = ecbpns (24, 79, A, D, Pdivtyh, 3000, Pdivszp, Pbordry, NULL, NULL);
F = ecbpns (24, 79, NULL, NULL, 0, 0, Pdivszf, Pbordry, NULL, NULL);
G = ecbpns (24, 79, F, NULL, 0, 5000, Pdivszp, Pbordry, NULL, NULL);
H = ecbpns (24, 79, G, NULL, 0, 3000, Pdivszp, Pbordry, NULL, NULL);
C: = ecbpns (24, 79, B, F, Pdivtyh, 0, Pdivszf, Pbordry, NULL, NULL);
P = ecbpls (24, 79, 0, 0, "MAIN PANEL", Pdivtyv, Pbordry, A);
ecdvpl (P);
ecdfpl (P, FALSE);
ecshpl (P);
ecrfpl (P);
endwin();
}
2) DO NOT include <curses.h> and any other <cur0x.h> file together.
You will get a bunch of redefined statements.
3) There is a CURSES and EXTENDED CURSES stuff. Use only one or the
other. If the manual says that they're backwards compatible or some
other indication that you can use CURSES routines with EXTENDED,
don't believe it. To use CURSES you need to include <curses.h> and
you can't (see above).
4) If you use -lcur and -lcurses in the same link command, you will get
Memory fault (core dump) error... YOU CANNOT use both of them at the
same time. -lcur is for extended curses, -lcurses is for regular curses.
5) When creating PANEs, when you supply a value (other than 0) for the
'ds' parameter and use Pdivszf value for the 'du' parameter, the 'ds'
will be ignored (the sample program on page 7-13 in User Interface
Programming Concepts is wrong.) For reasons as yet undetermined,
Pdivszc doesn't seem to work (or at least I can't figure out how to
use it.)
6) If you're running into bugs and can't figure out what is happening,
try the following:
include -qextchk -g in your compile line
-qextchk will check to make sure you're passing the right number of
parameters to the procedures
-g will allow you to use the inline debugger on Unix/AIX.
to use the debugger after you compiled it,
type: dbx <fn>
the command 'help' will give you all of the possible commands to
use in the debugger... have fun... :)
7) Do not use 80 as the number of columns if you want to use the whole
screen. The lower right corner will get erased. Use 79 instead.
8) If you create a panel, you must create at least 1 pane, otherwise you
will get a Memory fault (core dump).
9) When creating a panel, if you don't have a border around it, any title
you want will not show up.
10) to make the screen scroll down:
wmove (win, 0, 0);
winsertln (win)
11) delwin(win) DOESN'T WORK IN EXTENDED WINDOWS.
Anyway, to make it appear as if a window is deleted, you need to do
the following:
for every window that you want to appear on the screen
touchwin(win)
wrefresh(win)
you must make sure that you do it in the exact same order as you put
them on the screen (i.e., if you called newwin with A, then C, then B,
then you must do the loop with A, then C, then B, otherwise you won't
get the same screen back). The best thing to do is to put them into
an array and keep track of the last window index.
12) mvwin(win, line, col) implies that it is only used for viewports and
subwindows... It can also be used for the actual windows themselves.
13) If you specify the attribute of a window using wcolorout(win), any
subsequent calls to chgat(numchars, mode) or any of its relatives
will not work. (or at least they get very picky...)
2.14: How do I speed up linking
Please refer to sections 2.03 and 2.06 above.
From: losecco@undpdk.hep.nd.edu (John LoSecco) and
hook@chaco.aix.dfw.ibm.com (Gary R. Hook)
From oahu.cern.ch in /pub/aix3 you can get a wrapper for the existing
linker called tld which can reduce link times with large libraries by
factors of 3 to 4.
2.15: What is deadbeef?
When running the debugger (dbx), you may have wondered what the
'deadbeef' is you occasionally see in registers. Do note, that
0xdeadbeef is a hexadecimal number that also happens to be some kind
of word (the RS/6000 was built in Texas!), and this hexadecimal number
is simply put into unused registers at some time, probably during
program startup.
2.16: How do I statically link in 3.2?
xlc -bnso -bI:/lib/syscalls.exp -liconv -bnodelcsect