* Helper function to print out errors returned by libclockbound. */
| 53 | * Helper function to print out errors returned by libclockbound. |
| 54 | */ |
| 55 | void print_clockbound_err(const clockbound_err *err) { |
| 56 | if (err == NULL) { |
| 57 | return; |
| 58 | } |
| 59 | switch (err->kind) { |
| 60 | case CLOCKBOUND_ERR_SYSCALL: |
| 61 | fprintf(stderr, "%s(%d): %s: %s\n", format_err_kind(err->kind), |
| 62 | err->errno, strerror(err->errno), err->detail); |
| 63 | break; |
| 64 | case CLOCKBOUND_ERR_NONE: |
| 65 | case CLOCKBOUND_ERR_SEGMENT_MALFORMED: |
| 66 | case CLOCKBOUND_ERR_SEGMENT_NOT_INITIALIZED: |
| 67 | case CLOCKBOUND_ERR_SEGMENT_VERSION_NOT_SUPPORTED: |
| 68 | case CLOCKBOUND_ERR_CAUSALITY_BREACH: |
| 69 | fprintf(stderr, "%s(%d): %s\n", format_err_kind(err->kind), |
| 70 | err->errno, err->detail); |
| 71 | break; |
| 72 | default: |
| 73 | fprintf(stderr, "Unexpected error\n"); |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | int main(int argc, char *argv[]) { |
| 78 | char const* clockbound_shm_path = CLOCKBOUND_SHM_DEFAULT_PATH; |
no test coverage detected