Rev 894 | Go to most recent revision | Details | Compare with Previous | 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[]={ |
||
963 | trimarchi | 18 | "TOO_MANY_TASKS ", |
19 | "BAD_ARGUMENT ", |
||
20 | "INVALID_SYNCH_OBJ_HANDLE ", |
||
21 | "NO_RENEGOTIATION_REQUESTED ", |
||
22 | "CONTRACT_REJECTED ", |
||
23 | "NOT_SCHEDULED_CALLING_THREAD ", |
||
24 | "NOT_BOUND_THREAD ", |
||
25 | "UNKNOWN_SCHEDULED_THREAD ", |
||
26 | "NOT_CONTRACTED_SERVER ", |
||
27 | "NOT_SCHEDULED_THREAD ", |
||
28 | "TOO_MANY_SERVICE_JOBS ", |
||
29 | "TOO_MANY_SYNCH_OBJS ", |
||
30 | "TOO_MANY_SERVERS_IN_SYNCH_OBJ ", |
||
31 | "TOO_MANY_EVENTS_IN_SYNCH_OBJ ", |
||
32 | "INTERNAL_ERROR ", |
||
33 | "TOO_MANY_SERVERS ", |
||
34 | "INVALID_SCHEDULER_REPLY ", |
||
35 | "TOO_MANY_PENDING_REPLENISHMENTS", |
||
36 | "SYSTEM_ALREADY_INITIALIZED ", |
||
37 | "SHARED_OBJ_ALREADY_INITIALIZED ", |
||
38 | "SHARED_OBJ_NOT_INITIALIZED ", |
||
39 | "SCHED_POLICY_NOT_COMPATIBLE ", |
||
40 | "SERVER_WORKLOAD_NOT_COMPATIBLE ", |
||
41 | "ALREADY_BOUND ", |
||
42 | "WRONG_NETWORK ", |
||
43 | "TOO_LARGE ", |
||
44 | "BUFFER_FULL ", |
||
45 | "NO_SPACE ", |
||
46 | "NO_MESSAGES ", |
||
47 | "MODULE_NOT_SUPPORTED ", |
||
48 | "SYSTEM_NOT_INITIALIZED ", |
||
49 | "TOO_MANY_SHARED_OBJS ", |
||
886 | trimarchi | 50 | }; |
51 | |||
52 | int fsf_strerror (int error, char *message, size_t size) |
||
53 | { |
||
963 | trimarchi | 54 | if (message && size>0 && error>FSF_ERR_BASE_VALUE && error<=FSF_ERR_LAST_VALUE) { |
55 | strncpy(message, fsf_msg[error-FSF_ERR_BASE_VALUE-1], size); |
||
56 | } else return FSF_ERR_BAD_ARGUMENT; |
||
886 | trimarchi | 57 | return 0; |
58 | } |