iOS 上可以进行系统调用吗?

发布于 2024-08-02 12:38:48 字数 56 浏览 4 评论 0原文

是否可以进行系统调用,例如执行ls -la,并在您的应用程序中使用结果?

Is it possible to make a system call, such as executing ls -la, and use the result in your app?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

时间海 2024-08-09 12:38:49

通常,当有人说系统调用时,他们的意思是通过定义的入口点之一调用内核。虽然它在 iPhone 上在技术上是可行的,但您总是最好通过 libSystem 垫片,因为调用接口可能不稳定(例如在 Mac OS X 上)。我怀疑苹果会喜欢你这样做,但我怀疑没有人真正考虑过这一点,而且他们不太可能注意到。

我不认为这就是你的意思。我想你想使用 ISO/IEC 9899:1990 (C90) C 库函数“系统”。答案是否定的,你不能。

Usually when someone says system call they mean calling into the kernel through one of the defined entry points. While its technically possible on iPhone, you are always better of going through the libSystem shims because the call interface is probably not stable (it isn't on Mac OS X for instance). I doubt Apple would like it if you did that, but I suspect no one as really thought about it much and they are unlikely to notice.

I don't think that is what you mean though. I think you want to use ISO/IEC 9899:1990 (C90) C libraray function "system". The answer to that is no, you can't.

吻风 2024-08-09 12:38:49

遗憾的是 iOS 下的 syscall.h 是一个私有 api。虽然您可以在私人应用程序中使用它,但遗憾的是,Apple 不允许您使用 syscall() API 进行 App Store 提交。

Sadly syscall.h under iOS is a private api. While you can use it in private applications Apple will not allow you to use the syscall() API for App Store submissions unfortunately.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文