将一个C++代码应用程序从Solaris移植到Linux和实时标题问题
问题描述:
请帮忙,我使用的工具是kdevelop和qt4。例如,在我的main.cpp中有错误;将一个C++代码应用程序从Solaris移植到Linux和实时标题问题
Error: sys/procset.h: No such files or directory
Error: sys/priocntl.h: No such files or directory
Error: sys/tspriocntl.h: No such files or directory
Error: sys/rtpriocntl.h: No such files or directory
In function 'int main(int. char**)':
Error: 'pcparms_t' was not declared in this scope
Error: expected ';' before 'pcparms'
Error: 'rtparms_t' was not declared in this scope
Error: 'rtparmsp' was not declared in this scope
Error: 'pcinfo_t' was not declared in this scope
Error: expected ';' before 'pcinfo'
Error: 'rtinfo_t' was not declared in this scope
Error: 'rtinfop' was not declared in this scope
warning: unused variable 'lret'
warning: unused variable 'priority'
...
...
...
*Exited with Status:2 *
我找不到实时在我的Centos 5 Linux上的头。另外,我不知道上面这些头文件对于Linux的等价性。我知道我必须为包含头文件的Solaris和Linux添加If语句,并且我不知道if/else语句中将包含哪些头文件。
当我通过评论他们的实时头文件和函数为solaris的实时函数删除头,我让它运行。
//pcparms_t pcparms;
//rtparms_t *rtparmsp;
//pcinfo_t pcinfo;
//rtinfo_t *rtinfop;
我的问题是什么是实时头和功能的Linux或等同于Linux操作系统。我的应用程序代码是C++和qt4之间的混合。在QT4的一面是他们需要使用实时功能?在Solaris的C++上,我是否需要实时功能?如果是,我可以在哪里找到它们,或者他们在打什么电话,我在哪里放置它们?
答
这不是一个真正的QT相关问题,但更多的是移植Solaris-> Linux问题。
sys/procset.h
sys/priocntl.h
sys/tspriocntl.h
sys/rtpriocntl.h
这些文件都是Solaris特定的系统调用。它们是priocntlset的一部分 - 广义的进程调度器控制。
从手册页
priocntlset(2) System Calls priocntlset(2)
NAME
priocntlset - generalized process scheduler control
SYNOPSIS
#include <sys/types.h>
#include <sys/procset.h>
#include <sys/priocntl.h>
#include <sys/rtpriocntl.h>
#include <sys/tspriocntl.h>
#include <sys/iapriocntl.h>
#include <sys/fsspriocntl.h>
#include <sys/fxpriocntl.h>
long priocntlset(procset_t *psp, int cmd, /* arg */ ...);
DESCRIPTION
The priocntlset() function changes the scheduling properties of running
processes. priocntlset() has the same functions as the priocntl() func-
tion, but a more general way of specifying the set of processes whose
scheduling properties are to be changed.
NOTES
Due to the lack of a priocntl() system call on Linux and FreeBSD...
,其中的进程Solaris和Linux之间处理的方式是不同的。这两个系统都是Unix的变体,但是你所寻找的特定系统调用没有Linux的等价物。基本上priocntlset用于(重新)安排进程。我没有及时了解最新的Linux内核,或者有什么调度程序可用,但2.6(或2.4)内核中的任何优秀书籍都会有一个关于调度示例的部分。
在Linux机器上启动的好地方是man syscalls
。
你做了一个'找到procset.h'或'find/| grep“procset.h”'找出那个文件在哪里? – Blender 2011-05-11 16:48:38