如何在 QNX 中仅执行 1 次"top"(c++ 编程)
How to execute "top" only 1 time in QNX (c++ programming)
我正在尝试为 QNX 编写简单的应用程序。我安装了 qnx momentics ide 并将其连接到 QNX 虚拟机,并尝试执行"top"命令
#include <cstdlib>
#include <iostream>
#include <process.h>
#include <string>
using namespace std;
int main(int argc, char *argv[]) {
system("top");
return EXIT_SUCCESS;
}
我正在获取并获取结果,直到我在 QNX 虚拟机中手动杀死"顶部"进程。但我只需要 1 次。有什么想法吗?
此页面建议您应该将system("top")
更改为system("top -i 1")
。
top -i 1
是仅获取一次迭代的正确语法。 -n #
用于节点计数。
相关文章:
- 这对"With a stackless coroutine, only the top-level routine may be suspended."意味着什么
- 为什么 STL 容器适配器堆栈中的 top 返回常量引用?
- 在我自己的堆栈中实现top的问题
- 在C++中使用链表的堆栈实现中,访问结构体headNode成员count和top会导致运行时错误
- "top"值不会改变我推送或弹出堆栈的次数
- NDK 构建中的异常"error: expected ';' after top level declarator"
- std::move() with priority_queue.top()
- priority_queue.top() 不返回正确的对象
- 使用 top() 时收到错误"cannot dereference out of range deque iterator"
- C++ priority_queue pop() and top() discrepancy
- QPixmap,如何确保它是'always on top'
- 当队列为空时,priority_queue pop()和top()的C++行为
- 调用 emptyStack.top() 时返回的内容
- 如何使深渊中的对象易于配置"from the top"?
- 在老板层次结构中查找"top"老板仅适用于某些测试用例
- 在Linux上使用QT,有没有办法禁用"Always on Top"?
- 如何实现stack :: top()函数
- 'top'程序用于在屏幕上重新显示数据的技术是什么?
- 为什么priority_queue没有 front() 但 top()
- C++和 Java 数据结构的重叠:堆栈"top"与"peek"