Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenBSD / NetBSD: open_files()'s path is always empty #1030

Open
giampaolo opened this issue Apr 28, 2017 · 1 comment
Open

OpenBSD / NetBSD: open_files()'s path is always empty #1030

giampaolo opened this issue Apr 28, 2017 · 1 comment

Comments

@giampaolo
Copy link
Owner

giampaolo commented Apr 28, 2017

Contrarily from FreeBSD it appears OpenBSD / NetBSD do not save the path in the kinfo_file struct:

psutil/psutil/_psutil_bsd.c

Lines 488 to 503 in 5e543ef

#ifdef PSUTIL_FREEBSD
if ((kif->kf_type == KF_TYPE_VNODE) &&
(kif->kf_vnode_type == KF_VTYPE_VREG))
{
py_tuple = Py_BuildValue("(si)", kif->kf_path, kif->kf_fd);
#elif PSUTIL_OPENBSD
if ((kif->f_type == DTYPE_VNODE) &&
(kif->v_type == VREG))
{
py_tuple = Py_BuildValue("(si)", "", kif->fd_fd);
#elif PSUTIL_NETBSD
if ((kif->ki_ftype == DTYPE_VNODE) &&
(kif->ki_vtype == VREG))
{
py_tuple = Py_BuildValue("(si)", "", kif->ki_fd);
#endif

....which makes the method completely useless (well except for file ids...).
Filing this ticket as a reminder to look into whether I've missed something but if paths can't be determined this shall me removed.

@giampaolo
Copy link
Owner Author

Also, in case of removal this should be resolved before 5.3.0 so that we can break backward compatibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant