2014-12-11 22:25:02 +03:00
# include "defs.h"
# include <sched.h>
# include "xlat/schedulers.h"
2015-04-07 04:36:50 +03:00
SYS_FUNC ( sched_getscheduler )
2014-12-11 22:25:02 +03:00
{
if ( entering ( tcp ) ) {
tprintf ( " %d " , ( int ) tcp - > u_arg [ 0 ] ) ;
} else if ( ! syserror ( tcp ) ) {
tcp - > auxstr = xlookup ( schedulers , tcp - > u_rval ) ;
if ( tcp - > auxstr ! = NULL )
return RVAL_STR ;
}
return 0 ;
}
2015-04-07 04:36:50 +03:00
SYS_FUNC ( sched_setscheduler )
2014-12-11 22:25:02 +03:00
{
if ( entering ( tcp ) ) {
tprintf ( " %d, " , ( int ) tcp - > u_arg [ 0 ] ) ;
printxval ( schedulers , tcp - > u_arg [ 1 ] , " SCHED_??? " ) ;
2015-07-17 19:12:22 +03:00
tprints ( " , " ) ;
printnum_int ( tcp , tcp - > u_arg [ 2 ] , " %d " ) ;
2014-12-11 22:25:02 +03:00
}
return 0 ;
}
2015-04-07 04:36:50 +03:00
SYS_FUNC ( sched_getparam )
2014-12-11 22:25:02 +03:00
{
2015-07-17 19:12:22 +03:00
if ( entering ( tcp ) )
2014-12-11 22:25:02 +03:00
tprintf ( " %d, " , ( int ) tcp - > u_arg [ 0 ] ) ;
2015-07-17 19:12:22 +03:00
else
printnum_int ( tcp , tcp - > u_arg [ 1 ] , " %d " ) ;
2014-12-11 22:25:02 +03:00
return 0 ;
}
2015-04-07 04:36:50 +03:00
SYS_FUNC ( sched_setparam )
2014-12-11 22:25:02 +03:00
{
if ( entering ( tcp ) ) {
2015-07-17 19:12:22 +03:00
tprintf ( " %d, " , ( int ) tcp - > u_arg [ 0 ] ) ;
printnum_int ( tcp , tcp - > u_arg [ 1 ] , " %d " ) ;
2014-12-11 22:25:02 +03:00
}
return 0 ;
}
2015-04-07 04:36:50 +03:00
SYS_FUNC ( sched_get_priority_min )
2014-12-11 22:25:02 +03:00
{
if ( entering ( tcp ) ) {
printxval ( schedulers , tcp - > u_arg [ 0 ] , " SCHED_??? " ) ;
}
return 0 ;
}
2015-04-07 04:36:50 +03:00
SYS_FUNC ( sched_rr_get_interval )
2014-12-11 22:25:02 +03:00
{
if ( entering ( tcp ) ) {
2015-07-17 19:12:22 +03:00
tprintf ( " %d, " , ( int ) tcp - > u_arg [ 0 ] ) ;
2014-12-11 22:25:02 +03:00
} else {
if ( syserror ( tcp ) )
2015-07-17 19:12:22 +03:00
printaddr ( tcp - > u_arg [ 1 ] ) ;
2014-12-11 22:25:02 +03:00
else
print_timespec ( tcp , tcp - > u_arg [ 1 ] ) ;
}
return 0 ;
}