本文共 3452 字,大约阅读时间需要 11 分钟。
openbsd
OK, this is a big one: starting from version 3.3.0 (released just now) will officially support OpenBSD platforms. This was contributed by (thanks dude!) and myself in . The interesting parts of the code changes are and .
好的,这是一个很大的问题:从3.3.0版(刚刚发布)开始, 将正式支持OpenBSD平台。 这是由 (感谢伙计!)和我自己在中贡献的。 代码更改的有趣部分是和 。
As expected, OpenBSD implementation is very similar to FreeBSD‘s (which was already in place), that is why I decided to merge most of it in a single C file () and use 2 separate C files for when the two implementations differed too much: and . In terms of functionality here’s the differences with FreeBSD. Unless specified, these differences are due to the kernel which does not provide the information natively (meaning we can’t do anything about it).
不出所料,OpenBSD的实现与FreeBSD的非常相似。 (已经存在),这就是为什么我决定将其中的大多数合并到一个C文件( )中,并在两个实现的差异太大时使用2个单独的C文件的原因: 和 。 就功能而言,这与FreeBSD有所不同。 除非特别说明,否则这些差异是由于内核无法本地提供信息(这意味着我们无法对此做任何事情)。
psutil has been supporting FreeBSD basically (year 2009). At the time it made sense to support FreeBSD instead of other BSD variants because it is the , followed by OpenBSD and NetBSD. Compared to FreeBSD, OpenBSD appears to be more “minimal” both in terms of facilities provided by the kernel and the number of system administration tools available. One thing which I appreciate a lot about FreeBSD is that the source code of all CLI tools installed on the system is available under /usr/bin/src, which was a big help for implementing all psutil APIs. OpenBSD source code is but it uses CSV and I am not sure it includes the source code for all CLI tools. There are still two more BSD variants for which it may be worth to add support for: NetBSD and DragonflyBSD (in this order). About a year ago some guy provided a for adding basic NetBSD support so it is likely that will happen sooner or later.
(2009年) psutil就一直在支持FreeBSD 。 当时,支持FreeBSD而不是其他BSD变体是有意义的,因为它是 ,其次是OpenBSD和NetBSD。 与FreeBSD相比,无论是在内核提供的功能还是在可用的系统管理工具数量上,OpenBSD似乎都“最小”。 对于FreeBSD,我非常感激的是,系统上安装的所有CLI工具的源代码都位于/ usr / bin / src下 ,这对实现所有psutil API很有帮助。 使用OpenBSD源代码,但是它使用CSV,但我不确定它是否包含所有CLI工具的源代码。 还有另外两个值得支持的BSD变体: NetBSD和DragonflyBSD (按此顺序)。 大约一年前,有人提供了添加基本NetBSD支持的 ,因此很可能迟早会发生。
The only other enhancement is , which allows specifying a different location of /proc filesystem on Linux.
唯一的其他增强是 ,它允许在Linux上指定/ proc文件系统的其他位置。
翻译自:
openbsd
转载地址:http://utqwd.baihongyu.com/