编译 Busybox 常遇到的问题 SYS_ioprio_set ioprio_get
来源:互联网 发布:微信订货系统源码 编辑:程序博客网 时间:2024/05/20 15:39
本文感谢简单平安的帮助,谢谢他的文章.
http://hi.baidu.com/caogos/item/fa24fc9c5f9189d91e427121
今天我编译Busybox遇到了编译不通过的问题,错误提示如下:
miscutils/ionice.c: In function `ioprio_set':miscutils/ionice.c:16: error: `SYS_ioprio_set' undeclared (first use in this function)miscutils/ionice.c:16: error: (Each undeclared identifier is reported only oncemiscutils/ionice.c:16: error: for each function it appears in.)miscutils/ionice.c: In function `ioprio_get':miscutils/ionice.c:21: error: `SYS_ioprio_get' undeclared (first use in this function)make[1]: *** [miscutils/ionice.o] Error 1make: *** [miscutils] Error 2[root@localhost busybox-1.16.0]#
可以看到错误提示 SYS_ioprio_set ioprio_get 未定义 .
我在网上搜了一下,很多人遇到这样的问题,这种未定义的报错很多.
解决办法很简单,呵呵,那是在知道的前提下.
有两个解决办法 :
第一个办法:
简单粗暴:将未定义的信息所在的文件在make menuconfig 中去除 .
我们这个错误信息中 ionice ,make menuconfig 进入配置界面,可以反斜杠加要找的文件来查找 .
按下 /
进入查找界面:
输入ionice 回车
有如下信息:
我们可以在 Miscellaneous Utilities 中查找到ionice 将其取消选择 ,再编译就可以通过 .
这种办法虽然可行,但是不是很完美 .
第二个方法:
到系统目录下的/usr/include
查找 # grep -rn SYS_ioprio_set ./
[root@localhost include]# pwd/usr/include[root@localhost include]# grep -rn SYS_ioprio_set ././bits/syscall.h:122:#define SYS_ioprio_set __NR_ioprio_set
再查找 __NR_ioprio_set .
[root@localhost include]# grep -rn __NR_ioprio_set ././asm/unistd.h:297:#define __NR_ioprio_set 289
SYS_ioprio_get 如上面的操作一样 .
我们将这些定义放到出错的ionice.c文件中
#include <sys/syscall.h>#include <asm/unistd.h>#include "libbb.h"#define __NR_ioprio_set 289#define __NR_ioprio_get 290#define SYS_ioprio_set __NR_ioprio_set#define SYS_ioprio_get __NR_ioprio_getstatic int ioprio_set(int which, int who, int ioprio){return syscall(SYS_ioprio_set, which, who, ioprio);}......
保存退出即可.
再执行make ,编译通过 .
CC util-linux/volume_id/reiserfs.o CC util-linux/volume_id/romfs.o CC util-linux/volume_id/sysv.o CC util-linux/volume_id/udf.o CC util-linux/volume_id/util.o CC util-linux/volume_id/volume_id.o CC util-linux/volume_id/xfs.o AR util-linux/volume_id/lib.a LINK busybox_unstrippedTrying libraries: crypt m Library crypt is not needed, excluding it Library m is needed, can't exclude it (yet)Final link with: m DOC busybox.pod DOC BusyBox.txt DOC BusyBox.1 DOC BusyBox.html[root@localhost busybox-1.16.0]#
- 编译 Busybox 常遇到的问题 SYS_ioprio_set ioprio_get
- 编译busybox是遇到的问题--- [netw…
- linux(ubuntu)编译busybox遇到的问题处理办法
- 编译busybox 遇到的一个编译错误
- CCS编译中常常遇到的问题以及解决办法
- VC++编译JSON源码常遇到的问题。
- 编译busybox所遇到的bug
- ubuntu 常遇到的问题
- 一些常遇到的问题
- eclipse常遇到的问题
- 指针常遇到的问题
- 根文件系统的制作,busybox编译以及中间遇到的问题
- 编译busybox是遇到的问题--- [networking/tcpudp.o] 错误 1
- 关于BusyBox动态编译的问题:
- linux 编译busybox出现的一些问题
- 编译busybox-1.3.2的时候遇到的错误解决办法
- 编译 busybox时问题
- busybox编译问题
- HttpWatch工具简介及使用技巧
- 自己写的实时爬取 CSDN 2012 博客之星 88位候选人排名
- QT QObject::connect函数的学习
- hdu 3648 Median Filter
- Introduction to the calculus of variations
- 编译 Busybox 常遇到的问题 SYS_ioprio_set ioprio_get
- 自动换行的css
- Equls 和==的区别
- 冒泡法小程序(1)
- 冒泡法小程序(2)
- note : 有些道理的话
- 各种容器特点总结—容器的选择问题
- php请求http
- 数组应用