This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Libc question.


Hi all:
  In the code: PACKAGES\LANGUAGE\C\LIBC\stdio\current\include\io.inl
there are two definition for "cyg_stdio_read() " won't they conflict to each
other? Thanks a lot!

1.
inline Cyg_ErrNo cyg_stdio_read( cyg_stdio_handle_t dev,
                                 void *buffer, cyg_uint32 *len )
{
    if( dev != CYG_STDIO_HANDLE_NULL )
    {
        ssize_t done = read( dev, buffer, *len );

        if( done < 0 )
        {
            *len = 0;
            return errno;
        }

        *len = done;
    }
    // If the device is NULL, just return EOF indication
    else *len = 0;

    return ENOERR;
}

this is for FileIO versions of IO function.

2.
inline Cyg_ErrNo cyg_stdio_read( cyg_stdio_handle_t dev,
                                 void *buffer, cyg_uint32 *len )
{
    return cyg_io_read( dev, buffer, len );
}
this if for Direct IO versions of IO function.

why the first one is required?


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]