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 2006 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A * This file defines and implements the re-entrant enumeration routines for 2N/A * services: setservent(), getservent_r(), and endservent(). They consult 2N/A * the switch policy directly and do not "share" their enumeration state 2N/A * nor the stayopen flag with the implentation of the more common 2N/A * getservbyname_r()/getservbyport_r(). The latter follows a tortuous 2N/A * route in order to be consistent with netdir_getbyYY() (see 2N/A#
pragma ident "%Z%%M% %I% %E% SMI" 2N/A * Unsynchronized, but it affects only 2N/A * efficiency, not correctness. 2N/A * Setting proto to NULL here is a bit of a hack since we share 2N/A * the parsing code in the NIS+ backend with our getservbyYY() 2N/A * brethren who can search on 1-1/2 key. If they pass a NULL 2N/A * proto, the parsing code deals with it by picking the protocol 2N/A * from the first NIS+ matching object and combining all entries 2N/A * with "that" proto field. NIS+ is the only name service, so far, 2N/A * that can return multiple entries on a lookup. 2N/A /* === No stayopen flag; of course you stay open for iteration */