os/ossrv/genericopenlibs/cstdlib/LSTDIO/FERROR.C
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /* FERROR.C
     2  * 
     3  * Portions Copyright (c) 1990-1999 Nokia Corporation and/or its subsidiary(-ies).
     4  * All rights reserved.
     5  */
     6 
     7 /*
     8  * Copyright (c) 1990 The Regents of the University of California.
     9  * All rights reserved.
    10  *
    11  * Redistribution and use in source and binary forms are permitted
    12  * provided that the above copyright notice and this paragraph are
    13  * duplicated in all such forms and that any documentation,
    14  * advertising materials, and other materials related to such
    15  * distribution and use acknowledge that the software was developed
    16  * by the University of California, Berkeley.  The name of the
    17  * University may not be used to endorse or promote products derived
    18  * from this software without specific prior written permission.
    19  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
    20  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
    21  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
    22  */
    23 
    24 /*
    25 FUNCTION
    26 <<ferror>>---test whether read/write error has occurred
    27 
    28 INDEX
    29 	ferror
    30 
    31 ANSI_SYNOPSIS
    32 	#include <stdio.h>
    33 	int ferror(FILE *<[fp]>);
    34 
    35 TRAD_SYNOPSIS
    36 	#include <stdio.h>
    37 	int ferror(<[fp]>)
    38 	FILE *<[fp]>;
    39 
    40 DESCRIPTION
    41 The <<stdio>> functions maintain an error indicator with each file
    42 pointer <[fp]>, to record whether any read or write errors have
    43 occurred on the associated file or stream.
    44 Use <<ferror>> to query this indicator.
    45 
    46 See <<clearerr>> to reset the error indicator.
    47 
    48 RETURNS
    49 <<ferror>> returns <<0>> if no errors have occurred; it returns a
    50 nonzero value otherwise.
    51 
    52 PORTABILITY
    53 ANSI C requires <<ferror>>.
    54 
    55 No supporting OS subroutines are required.
    56 */
    57 
    58 #include <stdio.h>
    59 #include "LOCAL.H"
    60 
    61 #undef ferror
    62 /**
    63 Check for errors.
    64 @return   If there were no errors a 0 value is returned.
    65 Otherwise a non-zero value is returned .
    66 */
    67 EXPORT_C int
    68 ferror (FILE * fp)
    69 {
    70   return __sferror (fp);
    71 }