[dpdk-dev] [RFC v3 4/6] eal: add a helper for reading string from sysfs
Stephen Hemminger
stephen at networkplumber.org
Tue Jun 1 07:39:22 CEST 2021
On Tue, 1 Jun 2021 11:06:42 +0800
Chenbo Xia <chenbo.xia at intel.com> wrote:
>
> +int
> +rte_eal_parse_sysfs_str(const char *filename, char *buf, unsigned long sz)
> +{
> + FILE *f;
> +
> + f = fopen(filename, "r");
> + if (f == NULL) {
> + RTE_LOG(ERR, EAL, "%s(): cannot open sysfs file %s\n",
> + __func__, filename);
Helpful to decode errno.
RTE_LOG(ERR, EAL, "%s(): cannot open sysfs file %s:%s\n",
__func__, filename, strerror(errno));
More information about the dev
mailing list