各位大哥,今天编了个..busybox,源代码是在
www.busybox.net/download网上下的busybox-1.10.1 建材
make出现以下错误,.这些错误都怎么.改啊......服务器
都怎么分析 呢?
root@localho.st busybox-1.10.1].# make 鲜花
CC misc.utils/task.set.o 女人
miscutils/taskset..c:15: parse error before '*' to.ken电脑
miscutils/taskset.c:16: war.ning: function d.eclaration isn't a prototype.
miscutils/taskset.c: In function .`__fr.om_cpuset':.
miscutils/taskset.c:20: `CPU_SET.SIZE' undeclared (.fi.rst use in this function)<性病>
miscutils/taskset.c:20: (Each undeclared i.dentifier is rep.orted only once 婚庆
miscutils/taskset..c:20: for each funct.ion it appears in.).
miscutils/ta.skset.c:24: warning: implici.t declaration of .function `CPU_ISSET' 女人
miscuti.ls/taskset.c:24: .`mask' undeclared (first use in this function).
miscutils/taskset.c: In f..unction `taskset_main':电影
miscutils/taskset.c.:44: `cpu_set_t' undeclared (fir.st use in this function) 电子
miscutils/taskset.c:44: par.se error before ."mask"[成人用品]
miscutils/taskset.c:77: `.mask' undeclared (first use .in this function).
miscutils/taskset...c:95: warning: implicit declarati.on of function `CPU_ZERO'.
miscutils/taskset.c:96.: `CPU_SETSIZE' undeclared (first use in t.h.is function) 女人
miscutils/taskset.c:99: warning: implicit d.eclaration of function `CPU_SE.T'
m.ake[1].: *** [miscutils/taskset.o] Error 1 女人
make: *** [miscutils] Er.r.or 2虚拟主机
[
root@lo.calho.st busybox-1.10.1]#学习
taskset.c源文件如下.:.
/* vi: set sw=4 ts=4: *./.
/*
* taskset - retrieve or set a processe.s' CPU affinit.y 健康
* Copyri.ght. (c) 2006 Bernhard Fischer电影
*
* License.d under GPLv2 or later, see file LICENSE in this ta.rbal.l for details.( 游戏 )
*/
#include <.sched.h>投资
#incl.ude <getopt.h> /* optind. */[成人用品]
#include ."libbb.h"电影
#if ENABLE_FEATURE_T.AS.KSET_FANCY虚拟主机
#define TASKSET_PRIN.TF_MASK ".%s" 外汇
#define from_cpuset(x) __from._cpuset(&x).(广告)
/* craft a. string from the. mask */投资
static char *__from_cpus.et(cpu._set_t *mask)域名
{
int i;
char *ret = 0, *str. = x.zalloc(9); 美容
for (i = CPU_SETSIZE - 4; i >= 0; i. -.= 4) { 乙肝
ch.ar val = .0;( 游戏 )
. int off; 建材
for (off. =. 0; off <= 3; ++off) 外汇
. if (CPU_ISSET(i+off, ma.sk)).
. va.l |= 1<<off;外贸
. if (!re.t && val)( 游戏 )
. . ret = str;[成人用品]
. . *str++ = (val-'0'<=9) ? (val+48 ) : (val+87); 汽车
}
. return ret; 外汇
}
#else
#.define TASKSET_P.RINTF_MASK "%x"--------------彩票
/* (void*) cast. is for battlin.g gcc: */外贸
/* "derefe.rencing type-punned pointer wi.ll break strict-aliasing rules" */ 婚庆
#.define from_cpuset(mask) (*(unsign.ed*)(void*)&(mask))( 游戏 )
#endif
int taskset_.main(int argc, char **argv) MAIN_EXTERNALLY._VISIBLE;域名
int t.askset_main(int argc ATTRIBUTE_.UNUSED, char **argv) 外汇
{
cpu_set_t ma.sk;外贸
pid_t. pid = 0;.
unsig.ned opt_p; 乙肝
const char *c.urr.ent_new; 电子
char *pid_s.tr;(广告)
c.har *af.f = aff; /* for compiler */电影
. /.* NB: we mimic util-linux's taskset: -p does not take.
* an argument, i.e., ".-pN" is NO.T valid, only "-p N"! 健康
* Ind.eed, util-.linux-2.13-pre7 uses:.
* getopt_long(argc, arg.v, "+pch.V", ...), not "...p:..." */ 婚庆
opt_complementary =. "-1"; /* at lea.st 1 arg */教育
o.pt_p = g.etopt32(argv, "+p");.
. argv += optind;(广告)
. if (opt_p) {.
. pid_str = *argv+.+;.
if (*argv) { /* "-p <.aff> <pid> ...rest.is..ignored..." */[成人用品]
. . aff = pid_str; 乙肝
pid_str = .*argv; /* N.B: *argv != NULL. in this case */(广告)
. }健康
. /* else it was just "-.p <pid>", and *argv == NULL */健康
.pid = xatoul_r.ange(pid_str, 1, ((unsigned)(pid_t).ULONG_MAX) >> 1); 鲜花
. } else { 建材
. . aff = *argv++; /* <aff> <cmd...> */( 游戏 )
. i.f (!*argv) 电子
. bb_show_.usage(); 健康
}
. curren.t_new = "current\0new"; 健康
if (o.pt_p) {电影
print_aff:
. if (sched_getaffinity(pid, .sizeof(mask), &mask) < 0).
bb._perror_msg_and_die("can't %cet pid %d'.s affinity", 'g', p.id);.
printf.("pid %d's %s. affinity ma.sk: "TASKSET_PRINTF_MASK"\n", 鲜花
. . pid, current_new, from_cpuset(mask));.
. if (!*argv) {..
. /* Either it was just "-.p <pid>",健康
. * .or it was "-p <aff> <pid>" and we came here 鲜花
* for the second time.. (see goto below) */ 外汇
. re.turn EXIT_SUCCESS;.
. }<性病>
. *argv .= NULL; 女人
current_new .+.= 8; /* "new" */电影
}
{ /* Affinity was spec.ified, tran.slate it into cpu_set_t */ 杀毒
. . unsigned i; 美容
/* D.o not allow zero mask: */.虚拟主机
. unsigned long long m = xstrtoull_range(.aff, 0, 1, ULLONG_MA.X); 女人
.. CPU_ZERO(&mask); 女人
. fo.r (i = 0; i < CPU_SETSIZE; i++) {电影
unsigned long. long bit = (1.ULL << i);.
. if (bit & .m) 外汇
. . CPU_SET(i, &mask);.
. }投资
}
/* S.et pid's or our own (pid==0) affi.nity */.
if. (sched_setaffinity(pid, sizeof(ma.sk), &mask))虚拟主机
. . bb_perror_msg_and_die("can't %cet pid %d's affinity", 's'., pid);健康
if (!*argv) /* "-p. <aff> <pid> [...i.gnored...]" */电脑
.goto print_aff; /* print new a.ffinity and exit */.
. BB_EXECVP.(*argv, argv);服务器
bb_simple_perror_msg_a.nd_die(*argv.);电影
}
[ 本帖最后由 waveson-linux. 于 2009-4-.26 20:46 编辑 ].