Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

undefined reference to `getpri'

Status
Not open for further replies.

logic4fun

Programmer
Apr 24, 2003
85
US
Hi all,
I am trying to port one of my application from AIX to LINUX and this is a new linux box..and when i try to compile on LINUX for the following chunk of code it throws the afore said error.."undefined reference to 'getpri'" and the same code compiles very well in the AIX platform.

if (wrkpid != getpid() && (getpri(getpid()) != -1 || errno != ESRCH)) {
printf("Program already running - cancelling run %ld for %ld\n", getpid(), wrkpid);
exit(0);
}

i wanted to know am i missing any library in my box or can we use getpri() on linux box if we cannot any alternative function which checks for the running processes in the memory instance..
I tried using getpriority() doesnt really help as it returns the nice value. where as getpri() returns the scheduling priority.

THANKS in advance

Logic4fun
 
This might be a more compiler specific question, (rather than Linux/AIX) but what compiler are you using on the various plattforms? gcc?
 
Yup on the AIX box it was XLC and on LInUX box it is GCC..
 
logic4fun,
Linux does not have a getpri function call like AIX does. The calls you would be looking for in Linux would be either sched_getparm(...) or possibly sched_getscheduler(...). These are POSIX calls that are defined in sched.h .

Hope that helps.
 
Opps, that should have been sched_getparam not sched_getparm.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top