PTHREAD_STACK_MIN is not defined

264 views
Skip to first unread message

Uma Sankar

unread,
Apr 15, 2010, 8:09:19 AM4/15/10
to android-porting
Hi I am trying to compile ltp/testcases/kernel/sched/cfs-scheduler/
hackbench.c file and I am getting error like "error: 'PAGE_SIZE'
undeclared (first use in this function)
"
It seems macro for PTHREAD_STACK_MIN is defined as PAGE_SIZE but its
not able to find the declaration for PAGE_SIZE macro.

Any help in this regard is appreciable and find the error function and
include files below.
Thanks

Include files:
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/wait.h>
#include <sys/time.h>
#include <sys/poll.h>
#include <limits.h>

Error function:

pthread_t create_worker(void *ctx, void *(*func)(void *))
{
pthread_attr_t attr;
pthread_t childid;
int err;

if (process_mode) {
/* process mode */
/* Fork the receiver. */
switch (fork()) {
case -1: barf("fork()");
case 0:
(*func) (ctx);
exit(0);
}

return (pthread_t) 0;
}

if (pthread_attr_init(&attr) != 0)
barf("pthread_attr_init:");

#ifndef __ia64__
if (pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN) != 0) ---->
Error
barf("pthread_attr_setstacksize");
#endif

if ((err=pthread_create(&childid, &attr, func, ctx)) != 0) {
fprintf(stderr, "pthread_create failed: %s (%d)\n", strerror(err),
err);
exit(-1);
}
return (childid);
}

Reply all
Reply to author
Forward
0 new messages