OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [newlib-1.18.0/] [newlib-1.18.0-or32-1.0rc1/] [newlib/] [libc/] [stdio/] [ferror.c] - Diff between revs 207 and 345

Only display areas with differences | Details | Blame | View Log

Rev 207 Rev 345
/*
/*
 * Copyright (c) 1990 The Regents of the University of California.
 * Copyright (c) 1990 The Regents of the University of California.
 * All rights reserved.
 * All rights reserved.
 *
 *
 * Redistribution and use in source and binary forms are permitted
 * Redistribution and use in source and binary forms are permitted
 * provided that the above copyright notice and this paragraph are
 * provided that the above copyright notice and this paragraph are
 * duplicated in all such forms and that any documentation,
 * duplicated in all such forms and that any documentation,
 * advertising materials, and other materials related to such
 * advertising materials, and other materials related to such
 * distribution and use acknowledge that the software was developed
 * distribution and use acknowledge that the software was developed
 * by the University of California, Berkeley.  The name of the
 * by the University of California, Berkeley.  The name of the
 * University may not be used to endorse or promote products derived
 * University may not be used to endorse or promote products derived
 * from this software without specific prior written permission.
 * from this software without specific prior written permission.
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 */
 */
 
 
/*
/*
FUNCTION
FUNCTION
<<ferror>>---test whether read/write error has occurred
<<ferror>>---test whether read/write error has occurred
 
 
INDEX
INDEX
        ferror
        ferror
 
 
ANSI_SYNOPSIS
ANSI_SYNOPSIS
        #include <stdio.h>
        #include <stdio.h>
        int ferror(FILE *<[fp]>);
        int ferror(FILE *<[fp]>);
 
 
TRAD_SYNOPSIS
TRAD_SYNOPSIS
        #include <stdio.h>
        #include <stdio.h>
        int ferror(<[fp]>)
        int ferror(<[fp]>)
        FILE *<[fp]>;
        FILE *<[fp]>;
 
 
DESCRIPTION
DESCRIPTION
The <<stdio>> functions maintain an error indicator with each file
The <<stdio>> functions maintain an error indicator with each file
pointer <[fp]>, to record whether any read or write errors have
pointer <[fp]>, to record whether any read or write errors have
occurred on the associated file or stream.
occurred on the associated file or stream.
Use <<ferror>> to query this indicator.
Use <<ferror>> to query this indicator.
 
 
See <<clearerr>> to reset the error indicator.
See <<clearerr>> to reset the error indicator.
 
 
RETURNS
RETURNS
<<ferror>> returns <<0>> if no errors have occurred; it returns a
<<ferror>> returns <<0>> if no errors have occurred; it returns a
nonzero value otherwise.
nonzero value otherwise.
 
 
PORTABILITY
PORTABILITY
ANSI C requires <<ferror>>.
ANSI C requires <<ferror>>.
 
 
No supporting OS subroutines are required.
No supporting OS subroutines are required.
*/
*/
 
 
#if defined(LIBC_SCCS) && !defined(lint)
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "%W% (Berkeley) %G%";
static char sccsid[] = "%W% (Berkeley) %G%";
#endif /* LIBC_SCCS and not lint */
#endif /* LIBC_SCCS and not lint */
 
 
#include <_ansi.h>
#include <_ansi.h>
#include <stdio.h>
#include <stdio.h>
#include "local.h"
#include "local.h"
 
 
/* A subroutine version of the macro ferror.  */
/* A subroutine version of the macro ferror.  */
 
 
#undef ferror
#undef ferror
 
 
int
int
_DEFUN(ferror, (fp),
_DEFUN(ferror, (fp),
       FILE * fp)
       FILE * fp)
{
{
  int result;
  int result;
  CHECK_INIT(_REENT, fp);
  CHECK_INIT(_REENT, fp);
  _flockfile (fp);
  _flockfile (fp);
  result = __sferror (fp);
  result = __sferror (fp);
  _funlockfile (fp);
  _funlockfile (fp);
  return result;
  return result;
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.