/* this function is a POSIX compliant version, which will get file information. */
int stat(const char *file, struct stat *buf)
/* this function is a POSIX compliant version, which will get file information. */
int stat(const char *file, struct stat *buf)
{
    int result;
    if (file == NULL || buf == NULL)
    {
        rt_set_errno(EBADF);
        return -1;
    }
    result = dfs_file_stat(file, buf);
    if (result < 0)
    {
        rt_set_errno(-result);
    }
    return result;
}