mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +08:00
procfs: Add support for fstat().
This commit is contained in:
+11
-2
@@ -474,8 +474,17 @@ static int procfs_dup(FAR const struct file *oldp, FAR struct file *newp)
|
|||||||
|
|
||||||
static int procfs_fstat(FAR const struct file *filep, FAR struct stat *buf)
|
static int procfs_fstat(FAR const struct file *filep, FAR struct stat *buf)
|
||||||
{
|
{
|
||||||
#warning Missing logic
|
/* This is trivially simple in the current implementation. The procfs
|
||||||
return -ENOSYS;
|
* file system contains only directory and read-only data file entries.
|
||||||
|
* Therefore, the return buf always has the same fixed values.
|
||||||
|
*
|
||||||
|
* REVISIT: This, of course, will need to change if read-write procfs
|
||||||
|
* entries are to be supported.
|
||||||
|
*/
|
||||||
|
|
||||||
|
memset(buf, 0, sizeof(struct stat));
|
||||||
|
buf->st_mode = S_IFREG | S_IROTH | S_IRGRP | S_IRUSR;
|
||||||
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
Reference in New Issue
Block a user