summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremie Koenig <jk@jk.fr.eu.org>2010-08-16 13:36:52 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2010-08-18 01:38:02 +0200
commit7070feccb2e4d135d5620805de6cec177722b837 (patch)
tree435fa80b569f0007e34668b8196abc7e3449847b
parent0e63733ee60d0b9fa56ec47bdb088d4b835ec217 (diff)
Implement /proc/mounts as a symlink to /etc/mtab
* procfs_nonpid_files.c (procfs_create_mounts): New function. * procfs_dir.c (procfs_fill_root_dir): Call procfs_create_mounts. Signed-off-by: Jeremie Koenig <jk@jk.fr.eu.org>
-rw-r--r--procfs_dir.c3
-rw-r--r--procfs_nonpid_files.c13
2 files changed, 16 insertions, 0 deletions
diff --git a/procfs_dir.c b/procfs_dir.c
index f76e6a4b..bd1e49d6 100644
--- a/procfs_dir.c
+++ b/procfs_dir.c
@@ -654,6 +654,9 @@ procfs_fill_root_dir(struct procfs_dir *dir, time_t timestamp)
if ((err = procfs_create_loadavg (dir, &node, timestamp)) != 0)
return err;
+ if ((err = procfs_create_mounts (dir, &node, timestamp)) != 0)
+ return err;
+
return 0;
}
diff --git a/procfs_nonpid_files.c b/procfs_nonpid_files.c
index 2c1209ee..f1300666 100644
--- a/procfs_nonpid_files.c
+++ b/procfs_nonpid_files.c
@@ -166,6 +166,19 @@ error_t procfs_create_loadavg (struct procfs_dir *dir,
return err;
}
+error_t procfs_create_mounts (struct procfs_dir *dir,
+ struct node **node,
+ time_t timestamp)
+{
+ struct procfs_dir_entry *dir_entry;
+ int err;
+
+ dir_entry = update_pid_entries (dir, "mounts", timestamp, "/etc/mtab");
+ err = procfs_create_node (dir_entry, "mounts", node);
+
+ return err;
+}
+
error_t get_uptime (struct timeval *uptime)
{
struct timeval boot_time, now;