dfs上使用elm文件系统+spi flash 打开文件 open 操作返回 -19
int fd = open(filename, O_RDONLY, 0644);
这个fd返回时-19,这是什么原因引起的
而且在没有出现放回-19之前文件系统和网络功能都正常,
出现之后文件系统好像就坏掉了一样看不到文件,网络也连接不上,只有重启才能恢复正常
int open(const char *file, int flags, ...)
{
int fd, result;
struct dfs_fd *d;
/* allocate a fd */
fd = fd_new();
if (fd < 0)
{
rt_set_errno(-ENOMEM);
return -1;
}
d = fd_get(fd);
result = dfs_file_open(d, file, flags);
if (result < 0)
{
/* release the ref-count of fd */
fd_put(d);
fd_put(d);
rt_set_errno(result);
return -1;
}
/* release the ref-count of fd */
fd_put(d);
return fd;
}
RTM_EXPORT(open);
通过源码来看是要么返回-1 要么返回fd
找到问题原因了,内存不够了,找了一天的错误码