diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2022-10-26 08:38:19 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2022-10-27 09:43:57 +0200 |
commit | e6a09861b9a76b5527aa1310cff3d4e772b292b8 (patch) | |
tree | 4aec60947a1f1c72342a17c970d5435f080d40f6 /include | |
parent | f9f0c098048f8fa76f9f4945b0fe16e9333530d5 (diff) | |
download | barebox-e6a09861b9a76b5527aa1310cff3d4e772b292b8.tar.gz barebox-e6a09861b9a76b5527aa1310cff3d4e772b292b8.tar.xz |
commands: add new stat command
We have a couple of commands to help with debugging the VFS:
ll, devinfo, devlookup, but we lack a command that can just dump all
information we have in a struct stat or struct cdev. Add stat as such a
command. For most uses, it's not needed, but it can come in handy for
development. The stat_print and cdev_print functions underlying it are
exported, so they can called for debugging purposes.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20221026063819.2355568-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/fs.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/fs.h b/include/fs.h index b501db38ad..f96839f9eb 100644 --- a/include/fs.h +++ b/include/fs.h @@ -147,6 +147,9 @@ int ls(const char *path, ulong flags); char *mkmodestr(unsigned long mode, char *str); +void stat_print(const char *filename, const struct stat *st); +void cdev_print(const struct cdev *cdev); + char *canonicalize_path(const char *pathname); char *get_mounted_path(const char *path); |