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