fs: procfs add show file typee

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
This commit is contained in:
yinshengkai 2023-06-07 21:57:30 +08:00 committed by Xiang Xiao
parent bfe962ce2c
commit e3c637baf4
1 changed files with 4 additions and 3 deletions

View File

@ -1203,8 +1203,8 @@ static ssize_t proc_groupfd(FAR struct proc_file_s *procfile,
totalsize = 0; totalsize = 0;
linesize = procfs_snprintf(procfile->line, STATUS_LINELEN, linesize = procfs_snprintf(procfile->line, STATUS_LINELEN,
"\n%-3s %-8s %-8s %s\n", "\n%-3s %-8s %-8s %-8s %s \n",
"FD", "POS", "OFLAGS", "PATH"); "FD", "POS", "OFLAGS", "TYPE", "PATH");
copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining, copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining,
&offset); &offset);
@ -1235,9 +1235,10 @@ static ssize_t proc_groupfd(FAR struct proc_file_s *procfile,
} }
linesize = procfs_snprintf(procfile->line, STATUS_LINELEN, linesize = procfs_snprintf(procfile->line, STATUS_LINELEN,
"%3d %8ld %8x", "%3d %8ld %8d %8x",
i * CONFIG_NFILE_DESCRIPTORS_PER_BLOCK + i * CONFIG_NFILE_DESCRIPTORS_PER_BLOCK +
j, (long)file->f_pos, j, (long)file->f_pos,
INODE_GET_TYPE(file->f_inode),
file->f_oflags); file->f_oflags);
copysize = procfs_memcpy(procfile->line, linesize, buffer, copysize = procfs_memcpy(procfile->line, linesize, buffer,
remaining, &offset); remaining, &offset);