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