int ul_path_next_dirent(struct path_cxt *pc, DIR **sub, const char *dirname, struct dirent **d);
-FILE *ul_prefix_fopen(const char *prefix, const char *path, const char *mode);
-
#ifdef HAVE_CPU_SET_T
# include "cpuset.h"
return 1;
}
-/*
- * Like fopen() but, @path is always prefixed by @prefix. This function is
- * useful in case when ul_path_* API is overkill.
- */
-FILE *ul_prefix_fopen(const char *prefix, const char *path, const char *mode)
-{
- char buf[PATH_MAX];
-
- if (!path)
- return NULL;
- if (!prefix)
- return fopen(path, mode);
- if (*path == '/')
- path++;
-
- snprintf(buf, sizeof(buf), "%s/%s", prefix, path);
- return fopen(buf, mode);
-}
-
#ifdef HAVE_CPU_SET_T
static int ul_path_cpuparse(struct path_cxt *pc, cpu_set_t **set, int maxcpus, int islist, const char *path, va_list ap)
{
if (virt->vendor == VIRT_VENDOR_XEN) {
uint32_t features;
- fd = ul_prefix_fopen(cxt->prefix, "r", _PATH_SYS_HYP_FEATURES);
+ fd = ul_path_fopen(cxt->rootfs, "r", _PATH_SYS_HYP_FEATURES);
if (fd && fscanf(fd, "%x", &features) == 1) {
/* Xen PV domain */