Changeset 221afc9e in mainline for uspace/lib/posix/stdio.c


Ignore:
Timestamp:
2011-07-12T02:43:56Z (14 years ago)
Author:
Petr Koupy <petr.koupy@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2346e78
Parents:
46ac986
Message:

Redefinitions of some libc functions (mainly return value corrections).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/posix/stdio.c

    r46ac986 r221afc9e  
    8686        s[0] = '\0';
    8787        return s;
     88}
     89
     90/**
     91 * Put a string on the stream.
     92 *
     93 * @param s String to be written.
     94 * @param stream Output stream.
     95 * @return Non-negative on success, EOF on failure.
     96 */
     97int posix_fputs(const char *restrict s, FILE *restrict stream)
     98{
     99        int rc = fputs(s, stream);
     100        if (rc == 0) {
     101                return EOF;
     102        } else {
     103                return 0;
     104        }
    88105}
    89106
     
    394411
    395412/**
     413 * Discard prefetched data or write unwritten data.
     414 *
     415 * @param stream Stream that shall be flushed.
     416 * @return Zero on success, EOF on failure.
     417 */
     418int posix_fflush(FILE *stream)
     419{
     420        int rc = fflush(stream);
     421        if (rc < 0) {
     422                errno = -rc;
     423                return EOF;
     424        } else {
     425                return 0;
     426        }
     427}
     428
     429/**
    396430 * Print formatted output to the opened file.
    397431 *
Note: See TracChangeset for help on using the changeset viewer.