Skip to content

net_if_duplex_speed: handle ENOTTY from ioctl(SIOCETHTOOL) - #2985

Open
fabiancrt wants to merge 1 commit into
giampaolo:masterfrom
fabiancrt:linux-net-if-stats-enotty
Open

net_if_duplex_speed: handle ENOTTY from ioctl(SIOCETHTOOL)#2985
fabiancrt wants to merge 1 commit into
giampaolo:masterfrom
fabiancrt:linux-net-if-stats-enotty

Conversation

@fabiancrt

Copy link
Copy Markdown
Contributor

Summary

Description

On the setup reported in #2693, ioctl(SIOCETHTOOL) returns ENOTTY
while retrieving interface duplex/speed. Since ENOTTY is not handled,
it propagates as OSError and makes net_if_stats() fail entirely.

Treat ENOTTY like the existing EOPNOTSUPP, EINVAL, and EBUSY
cases, returning unknown duplex and speed 0 instead.

This follows the same handling added for EBUSY in #2732.

@github-actions github-actions Bot added badexc psutil raises something other than NoSuchProcess, AccessDenied, ZombieProcess or TimeoutExpired bug type linux platform : Linux specific labels Aug 26, 2026
TrueFurina added a commit to TrueFurina/psutil that referenced this pull request Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

badexc psutil raises something other than NoSuchProcess, AccessDenied, ZombieProcess or TimeoutExpired bug type linux platform : Linux specific

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Linux on Apple ARM - psutil.net_if_stats() - OSError: [Errno 25] Inappropriate ioctl for device (originated from ioctl(SIOCETHTOOL))

1 participant