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/* Copyright (c) 1988 AT&T */ 2N/A/* All Rights Reserved */ 2N/A * University Copyright- Copyright (c) 1982, 1986, 1988 2N/A * The Regents of the University of California 2N/A * All Rights Reserved 2N/A * University Acknowledgment- Portions of this document are derived from 2N/A * software developed by the University of California, Berkeley, and its 2N/A#
pragma ident "%Z%%M% %I% %E% SMI" 2N/A/* Final argument to _endopen depends on build environment */ 2N/A * Note that iop is not locked here, since no other thread could 2N/A * possibly call _endopen with the same iop at this point. 2N/A * Clear stream orientation, clear stream encoding rule, and set 2N/A * stream's mbstate_t object to describe an initial conversion state. 2N/A * Because the filename has not been specified, the underlying file 2N/A * will not be closed and reopened. The access modes of an open 2N/A * file descriptor can't be changed via fcntl(). When '+' is 2N/A * specified, the old access mode needs to be O_RDWR. When 'r' is 2N/A * specified, the old access mode needs to be O_RDONLY or O_RDWR. 2N/A * When 'a' or 'w' is specified, the old access mode needs to be 2N/A * O_WRONLY or O_RDWR. Otherwise, fail with EBADF, indicating that 2N/A * the underlying file descriptor was not opened with a mode that 2N/A * would allow the stream to do successful I/O with the requested mode. 2N/A * Change mode of underlying fd as much as possible without closing 2N/A * and reopening it. Ignore truncate failures, eg. with stdout. 2N/A /* ignore seek failures, eg. with pipes */ 2N/A * XPG6: If name is a null pointer, freopen will attempt to 2N/A * change the mode of the stream to that specified by type. 2N/A * there may be concurrent calls to reopen the same stream - need 2N/A * to make freopen() atomic 2N/A * new function to do everything that fclose() does, except 2N/A * to release the iop - this cannot yet be released since 2N/A * _endopen() is yet to be called on this iop