如何获取syscall号码(而不编译)?

发布于 2025-01-27 12:46:01 字数 614 浏览 1 评论 0原文

我正在尝试从java调用syscalls,例如这个答案。 (具体来说,安装。)答案说要调用syscall

有没有办法以编程方式获取SYSCALL数字?

假设否,我必须在include文件中进行硬编码或挖掘它,您可以回答:

  • 在linux上,/usr/include/asm/unistd.h/usr/include/x86_64-linux-gnu/asm/unistd 在ubuntu x86_64上)和/usr/include/asm-generic/asm-generic/unistd.h?什么是asm-generic,为什么它具有不同的值?
  • 为什么Linux-ARM64仅具有asm-generic
  • 有没有更好的方法来调用Mount?它在什么库中?
  • MACOS和BSD呢?

I am trying to invoke syscalls from Java like in this answer. (Specifically, mount.) The answer says to invoke syscall.

Is there a way to get the syscall number programmatically?

Assuming no and I have to hard-code it or dig for it in include files, could you answer:

  • On Linux, What is the difference between /usr/include/asm/unistd.h (/usr/include/x86_64-linux-gnu/asm/unistd on Ubuntu x86_64) and /usr/include/asm-generic/unistd.h? What is asm-generic and why does it have different values?
  • Why does linux-arm64 only have asm-generic?
  • Is there a better way to call mount? What library is it in?
  • What about MacOS and BSD?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文