[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: mountlist: libmount support on Linux
From: |
Pádraig Brady |
Subject: |
Re: mountlist: libmount support on Linux |
Date: |
Wed, 27 Aug 2014 17:15:09 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 |
On 08/27/2014 03:08 PM, Fridolin Pokorny wrote:
> diff --git a/lib/mountlist.c b/lib/mountlist.c
Cool, this fits well.
It would be good to mention the functionality and
performance benefits in the changelog.
> +#ifdef MOUNTED_PROC_MOUNTINFO
> +static const char *
> +mountinfo_path (void) {
> + static char filename[sizeof ("/proc//mountinfo") + 13]; /* 13 to hold a
> PID */
> +
> + sprintf (filename, "/proc/%u/mountinfo", getpid ());
> +
> + return filename;
> +}
I dislike the above as it precludes concurrent usage.
You could avoid that issue by allocating on the heap,
but can't this be simplified by using /proc/self/mountinfo ?
thanks!
Pádraig.