#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "%Z%%M% %I% %E% SMI"
#
# Create two files from a list of input strings;
# new_list.c contains an array of characters indexed into by perror and
# strerror;
# errlst.c contains an array of pointers to strings for compatibility
# with existing user programs that reference it directly;
# errlst.c references the strings in new_list.c indirectly using a library
# private symbol, __sys_errs[], in order to get relative relocations.
#
# Since the 64 bit ABI doesn't define the old symbols, the second file
# should be left out 64 bit libraries.
#
# WARNING!
# Do NOT add entries to this list such that it grows the list
# beyond the last entry:
# 151 Stale NFS file handle
# Growing this list may damage programs because this array is
# copied into a reserved array at runtime. See bug 4097669.
#
# If you need to add an entry please use one of the empty
# slots.
# The arrays _sys_errs[], accessible via perror(3C) and strerror(3C)
# interfaces, and sys_errlist[] are created from this list.
# It is the direct referencing of sys_errlist[] that is the problem.
# Your code should only use perror() or strerror().
BEGIN {
FS = "\t"
hi = 0
newfile = "new_list.c"
# We need to include the errors strings proper in the
# C source for gettext; the macro C allows us to embed
# them as comment.
}
/^[0-9]+/ {
if ($1 > hi)
hi = $1
astr[$1] = $2
}
END {
k = 0
mx = 151 # max number of entries for sys_errlist[]
{
printf "Please read comments in"
exit 1
}
for (j = 0; j <= hi; ++j)
{
}
for (j = 0; j <= hi; ++j)
{
}
}