- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
我正在摆弄系统调用。我添加了两个新的,并通过调用 syscall
验证了它们的工作。
我希望系统调用号位于 header 中,这样用户空间就不必明确知道系统调用号。
在 arch/x86/syscalls/syscall_64.tbl
我有:
317 64 krun_read_msrs sys_krun_read_msrs
318 64 krun_reset_msrs sys_krun_reset_msrs
一些 grepping 表明 kbuild 已经为新的系统调用自动生成了宏:
$ ag __NR_krun *
arch/x86/include/generated/uapi/asm/unistd_64.h
321:#define __NR_krun_read_msrs 317
322:#define __NR_krun_reset_msrs 318
文件名表明我不需要手动添加条目,但这与 Linux 内核文档所说的相反:
Some architectures (e.g. x86) have their own architecture-specific syscall tables, but several other architectures share a generic syscall table. Add your new system call to the generic list by adding an entry to the list in include/uapi/asm-generic/unistd.h:
#define __NR_xyzzy 292
__SYSCALL(__NR_xyzzy, sys_xyzzy)
好吧,我的系统调用是特定于 x86_64 的,因为它们读取和写入仅在 Intel 芯片中发现的 MSR。因此,在此之后,我开始挖掘,看看是否可以为我的 amd64 系统找到 arch-specific header。
您可能希望它位于 arch/x86_64
下,但其中根本没有包含。所以我假设 x86_64 继承自 x86
。在这种情况下,arch-specific header 应该是:
arch/x86/include/uapi/asm/unistd.h
如果你打开它,它只是一个基于 arch 的小包装器:
# ifdef __i386__
# include <asm/unistd_32.h>
# elif defined(__ILP32__)
# include <asm/unistd_x32.h>
# else
# include <asm/unistd_64.h>
# endif
所以这大概是为了获取 /usr/include/x86_64-linux-gnu/asm/unistd.h
而设计的,但这还不包括我的新系统调用编号。
我希望 headers_install
目标安装新的 header (也许),但遗憾的是它没有。
我很困惑。我是否应该手动将新系统调用添加到文件中?如果是哪个文件?如果没有,我如何将自动生成的 __NR_*
宏暴露给标准位置的用户空间?
谢谢
最佳答案
好吧,我有一个部分答案。部分因为它是特定于 Debian 的。
如果您在内核源代码中使用make deb-pkg
目标,那么将在父目录中创建.deb
包。如果您随后安装这些,那么您的 header 将安装到系统中。
在对上述内核执行此操作后:
$ grep krun /usr/include
/usr/include/asm/unistd_64.h:#define __NR_krun_read_msrs 317
/usr/include/asm/unistd_64.h:#define __NR_krun_reset_msrs 318
关于c - 实现系统调用时,如何将系统调用号暴露给用户空间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45286525/
我对 DBT 还很陌生,正在尝试探索如何进行曝光。我已经阅读了文档 ( https://docs.getdbt.com/docs/building-a-dbt-project/exposures ),
我对 DBT 还很陌生,正在尝试探索如何进行曝光。我已经阅读了文档 ( https://docs.getdbt.com/docs/building-a-dbt-project/exposures ),
这在Python中合法吗?似乎有效... 谢谢 # with these lines you not need global variables anymore if __name__ == '__m
我正在尝试使用 tomcat Docker 镜像打包一个 war 文件。我正在尝试在图像中公开 tomcat 端口以供外部访问。 这是我的docker文件 FROM tomcat8:3.0.0 C
我一直在尝试通过 ip 连接到 docker 容器,但再次失败。当我使用“docker inspect container-id”时,我得到了这个结果。 我的虚拟盒子默认设置是: 有人可以帮我解决这个
我知道要在 docker 容器中公开端口,您可以使用 -p标志(例如 -p 1-100:1-100 )。但是有没有一种很好的方法可以将大部分可能的端口从容器暴露给主机?例如,如果我在位于 VM 中的容
我正在开发一个带有 ktor 应用程序的 Kotlin,并且我使用暴露为 ORM。我有一个引用另一个表的表。这种关系是多对一的。前任: object Users : IdTable() { ov
我正在尝试学习 polymer ,并且正在尝试制作一个基本的消息传递框架。所以我创建了一个名为 messages-framework 的小 polymer 元素,它将显示消息,并在 3 秒后删除该消息
我的问题很简单也很笼统:当调用 RESTFUL API 时,无论是我的还是外部的,将 token 暴露在前端是否是常见做法/可以?例如,在 Google map api 的文档中,他们建议使用以下代码
我们有一个包含 1000 万条记录的数据库表。我们不想使用 auto_increment,因为那样会让我们的用户知道我们有多少条记录。我们不想将其暴露给我们的竞争对手。我看到的问题是使用 UUID 或
我有以下用户表对象和实体类: object UserTable : IntIdTable() { val name = varchar("name", 256) } class User(id
对于部署在 Google kubernetes 引擎上的基于微服务的示例架构,我需要帮助来验证我的理解: 我们知道服务应该对 pod 副本集的流量进行负载平衡。 当我们创建一个 nginx 入口 Co
String caminhoFoto = getExternalFilesDir(null) + "/"+ System.currentTimeMillis() +".jpg";
我目前正在编写一个用 Parcel js 打包的 TypeScript 模块化库。应用程序将使用该库来实现特定功能。消费应用程序/网页将在其 html 中添加对我的库的引用,例如。 我想在我的库中公
mongodb 生成的 ID 在您的所有文档中都是唯一的,将其暴露给客户端的风险是什么?就像我有一个 ID 为 12345676543 的用户名 James,将它暴露给 url 是明智的吗 examp
场景:假设攻击者通过对.apk文件进行逆向工程,获取了应用中使用的Push Registration Service的SENDER ID。攻击者开发了一个类似的虚假应用程序,它具有相同/不同的包名,并
当使用 Spring Boot starter 进行 graphql 时,数据获取时抛出的所有异常都在输出控制台中显示为“执行查询时的内部服务器错误”我希望我抛出的 e.message() 的 Gra
我正在尝试使用 Docker 运行 ASP.NET Core 应用程序,并且我想将外部 wwwroot 文件夹公开给容器,以便当我从外部对其进行更改时,它们会自动对我的应用程序可用。这可能吗,使用卷?
我构建了一个 WCF 服务,它为 Web 应用程序公开自身,它接受一个对象并在客户端机器上打印数据。在我的开发机器上运行良好,该服务在我安装它的任何机器上启动并运行。我可以在客户端机器的 Web 浏览
我似乎无法弄清楚这一点。我有一个使用 scikit-learn 训练的模型,保存到一个 .pkl 文件中,我想制作一个 API 来根据它进行预测。 我已经有了进行预测的代码,它在控制台/单元测试中运行
我是一名优秀的程序员,十分优秀!