Subversion Repositories shark

Rev

Rev 894 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
886 trimarchi 1
//=====================================================================
2
//       FFFFFFIII   RRRRR      SSTTTTTTT
3
//      FF         IIR   RR    SS
4
//     FF           IR        SS
5
//    FFFFFF         RRRR    SSSSST      
6
//   FF       FI       RRR  SS
7
//  FF         II     RRR  SS
8
// FF           IIIIIR    RS 
9
//       
10
// Basic FSF(FIRST Scheduling Framework) contract management
11
// S.Ha.R.K. Implementation
12
//=====================================================================
13
 
14
#include "fsf.h"
15
#include <string.h>
16
 
17
static char *fsf_msg[]={
18
  "Too Many Task",
19
  "Bad argument",
20
  "Invalid synch object handle",
21
  "No renegotiation request",
22
  "Contract rejected",
23
  "Not scheduled calling thread",
24
  "Unbound error",
25
  "Unknown application scheduled thread",
26
  "No contracted server",
27
  "Not scheduled thread",
28
  "Too many service jobs",
29
  "Too many synch object",
30
  "Too many servers in synch object",
31
  "Too many events in synch object",
32
  "FSF internal error",
33
  "Too many servers",
34
  "Invalid scheduler reply",
35
  "Too many many pending replenishments",
36
  "System already initialized",
37
  "Shared object already initialized",
38
  "Shared object not initizialized",
39
  "Scheduling policy not compatible",
40
};
41
 
42
int fsf_strerror (int error, char *message, size_t size)
43
{
44
 
45
  if (error>FSF_ERR_BASE && error<FSF_ERR_BASE+FSF_ERR_MAX) {
46
    strncpy(message,  fsf_msg[error-FSF_ERR_BASE-1], size);
47
  } else return -1;
48
  return 0;
49
}