* fhandler_proc.cc (proc_tab): Add entry for mounts symlink.
(format_proc_mounts): New function to implement mounts symlink. * fhandler_process.cc (process_tab): Add entry for mounts file. (format_process_mounts): New function to implement mounts file.
This commit is contained in:
@ -40,6 +40,7 @@ static _off64_t format_proc_uptime (void *, char *&);
|
||||
static _off64_t format_proc_cpuinfo (void *, char *&);
|
||||
static _off64_t format_proc_partitions (void *, char *&);
|
||||
static _off64_t format_proc_self (void *, char *&);
|
||||
static _off64_t format_proc_mounts (void *, char *&);
|
||||
|
||||
/* names of objects in /proc */
|
||||
static const virt_tab_t proc_tab[] = {
|
||||
@ -54,6 +55,7 @@ static const virt_tab_t proc_tab[] = {
|
||||
{ "cpuinfo", FH_PROC, virt_file, format_proc_cpuinfo },
|
||||
{ "partitions", FH_PROC, virt_file, format_proc_partitions },
|
||||
{ "self", FH_PROC, virt_symlink, format_proc_self },
|
||||
{ "mounts", FH_PROC, virt_symlink, format_proc_mounts },
|
||||
{ "registry32", FH_REGISTRY, virt_directory, NULL },
|
||||
{ "registry64", FH_REGISTRY, virt_directory, NULL },
|
||||
{ "net", FH_PROCNET, virt_directory, NULL },
|
||||
@ -1127,4 +1129,11 @@ format_proc_self (void *, char *&destbuf)
|
||||
return __small_sprintf (destbuf, "%d", getpid ());
|
||||
}
|
||||
|
||||
static _off64_t
|
||||
format_proc_mounts (void *, char *&destbuf)
|
||||
{
|
||||
destbuf = (char *) crealloc_abort (destbuf, sizeof ("self/mounts"));
|
||||
return __small_sprintf (destbuf, "self/mounts");
|
||||
}
|
||||
|
||||
#undef print
|
||||
|
Reference in New Issue
Block a user