Rev 894 |
Go to most recent revision |
Blame |
Compare with Previous |
Last modification |
View Log
| RSS feed
//=====================================================================
// FFFFFFIII RRRRR SSTTTTTTT
// FF IIR RR SS
// FF IR SS
// FFFFFF RRRR SSSSST
// FF FI RRR SS
// FF II RRR SS
// FF IIIIIR RS
//
// Basic FSF(FIRST Scheduling Framework) contract management
// S.Ha.R.K. Implementation
//=====================================================================
#include "fsf.h"
#include <string.h>
static char *fsf_msg
[]={
"TOO_MANY_TASKS ",
"BAD_ARGUMENT ",
"INVALID_SYNCH_OBJ_HANDLE ",
"NO_RENEGOTIATION_REQUESTED ",
"CONTRACT_REJECTED ",
"NOT_SCHEDULED_CALLING_THREAD ",
"NOT_BOUND_THREAD ",
"UNKNOWN_SCHEDULED_THREAD ",
"NOT_CONTRACTED_SERVER ",
"NOT_SCHEDULED_THREAD ",
"TOO_MANY_SERVICE_JOBS ",
"TOO_MANY_SYNCH_OBJS ",
"TOO_MANY_SERVERS_IN_SYNCH_OBJ ",
"TOO_MANY_EVENTS_IN_SYNCH_OBJ ",
"INTERNAL_ERROR ",
"TOO_MANY_SERVERS ",
"INVALID_SCHEDULER_REPLY ",
"TOO_MANY_PENDING_REPLENISHMENTS",
"SYSTEM_ALREADY_INITIALIZED ",
"SHARED_OBJ_ALREADY_INITIALIZED ",
"SHARED_OBJ_NOT_INITIALIZED ",
"SCHED_POLICY_NOT_COMPATIBLE ",
"SERVER_WORKLOAD_NOT_COMPATIBLE ",
"ALREADY_BOUND ",
"WRONG_NETWORK ",
"TOO_LARGE ",
"BUFFER_FULL ",
"NO_SPACE ",
"NO_MESSAGES ",
"MODULE_NOT_SUPPORTED ",
"SYSTEM_NOT_INITIALIZED ",
"TOO_MANY_SHARED_OBJS ",
};
int fsf_strerror
(int error
, char *message
, size_t size
)
{
if (message
&& size
>0 && error
>FSF_ERR_BASE_VALUE
&& error
<=FSF_ERR_LAST_VALUE
) {
strncpy(message
, fsf_msg
[error
-FSF_ERR_BASE_VALUE
-1], size
);
} else return FSF_ERR_BAD_ARGUMENT
;
return 0;
}