rem: return errno;
add: return from_platform_error(errno);
context: do_copy_from_myfs(char *bfile, char *host_file){    int     bfd,err = 0;    char    myfs_name[1024];    FILE   *fp;    size_t  amt;    static char buff[4 * 1024];    sprintf(myfs_name, "/myfs/%s", bfile);    fp = fopen(host_file, "wb");    if (fp == NULL) {        printf("can't open host file: %s\n", host_file);        return errno;    }            if ((bfd = sys_open(1, -1, myfs_name, O_RDONLY, MY_S_IFREG, 0)) < 0) {        fclose(fp);        printf("error opening: %s\n", myfs_name);        return bfd;    }        while(1) {        amt = sizeof(buff);        err = sys_read(1, bfd, buff, amt);        if (err < 0)            break;        if (fwrite(buff, 1, err, fp) != amt)            break;    }    if (err < 0)        perror("read error");    sys_close(1, bfd);    fclose(fp);	return (err < 0 ? err : 0);}