博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
openbsd_OpenBSD对psutil的支持
阅读量:2536 次
发布时间:2019-05-11

本文共 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平台。 这是由 (感谢伙计!)和我自己在中贡献的。 代码更改的有趣部分是和 。

FreeBSD的差异 ( Differences with FreeBSD)

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有所不同。 除非特别说明,否则这些差异是由于内核无法本地提供信息(这意味着我们无法对此做任何事情)。

  • is not implemented. The kernel provides the necessary pieces but I didn’t do this yet (hopefully later).
  • ‘s involuntary field is always 0. but it is always set to 0.
  • (get and set) is not supported.
  • is determined by inspecting the command line so it may not always be available (return None). 
  • sin and sout (swap in and swap out) values are not available and hence are always set to 0.
  • always return None.
  • 未实现 。 内核提供了必要的部分,但我还没有做(希望以后)。
  • 的非自愿字段始终为但始终设置为0。
  • 不支持 (获取和设置)。
  • 通过检查命令行来确定 ,因此它可能并不总是可用(返回None)。
  • sin和sout(交换和换出)值不可用,因此始终设置为0。
  • 始终返回无。
Similarly to FreeBSD, also OpenBSD implementation of Process.open_files() is problematic as it is not able to return file paths (FreeBSD can sometimes). Other than these differences the functionalities are all there and pretty much the same, so overall I’m pretty satisfied with the result. 
与FreeBSD相似,Process.open_files()的OpenBSD实现也存在问题,因为它无法返回文件路径(FreeBSD有时可以)。 除了这些差异之外,功能都存在并且几乎相同,因此总的来说,我对结果非常满意。

关于BSD平台的注意事项 ( Considerations about BSD platforms)

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变体: NetBSDDragonflyBSD (按此顺序)。 大约一年前,有人提供了添加基本NetBSD支持的 ,因此很可能迟早会发生。

此版本中可用的其他增强功能 ( Other enhancements available in this release)

The only other enhancement is , which allows specifying a different location of /proc filesystem on Linux.

唯一的其他增强是 ,它允许在Linux上指定/ proc文件系统的其他位置。

外部讨论 ( External discussions)

翻译自:

openbsd

转载地址:http://utqwd.baihongyu.com/

你可能感兴趣的文章
电梯调度程序的UI设计
查看>>
转自 zera php中extends和implements的区别
查看>>
Array.of使用实例
查看>>
【Luogu】P2498拯救小云公主(spfa)
查看>>
如何获取网站icon
查看>>
几种排序写法
查看>>
java 多线程的应用场景
查看>>
dell support
查看>>
转:Maven项目编译后classes文件中没有dao的xml文件以及没有resources中的配置文件的问题解决...
查看>>
MTK android 设置里 "关于手机" 信息参数修改
查看>>
单变量微积分笔记6——线性近似和二阶近似
查看>>
补几天前的读书笔记
查看>>
HDU 1829/POJ 2492 A Bug's Life
查看>>
CKplayer:视频推荐和分享插件设置
查看>>
CentOS系统将UTC时间修改为CST时间
查看>>
redis常见面试题
查看>>
导航控制器的出栈
查看>>
玩转CSS3,嗨翻WEB前端,CSS3伪类元素详解/深入浅出[原创][5+3时代]
查看>>
iOS 9音频应用播放音频之播放控制暂停停止前进后退的设置
查看>>
Delphi消息小记
查看>>