This one uses "seq_file", i.e. normal FILE stream just works.
const char *p = procfs_file_alloca(pid, "limits");
_cleanup_free_ char *limits = NULL;
- r = read_full_virtual_file(p, &limits, NULL);
+ r = read_full_file(p, &limits, /* ret_size = */ NULL);
if (r < 0)
return -EPERM; /* propagate original permission error if we can't access the limits file */
_cleanup_strv_free_ char **l = NULL;
- l = strv_split(limits, "\n");
+ l = strv_split_newlines(limits);
if (!l)
return -ENOMEM;