#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include "log.h"
#include "types.h"
Go to the source code of this file.
Copyright (c) 2016-2017, ETH Zurich, Computer Engineering Group
Definition at line 5 of file sem.h.
| int remove_sem |
( |
int |
sem_id | ) |
|
| int set_sem |
( |
int |
sem_id, |
|
|
int |
sem_num, |
|
|
int |
val |
|
) |
| |
Set value to semaphore
- Parameters
-
| sem_id | ID of semaphore set |
| sem_num | Number of semaphore in set |
| val | Value to be set to semaphore |
- Returns
- SUCCESS on success (access granted), TIME_OUT on time out, FAILURE otherwise
Definition at line 85 of file sem.c.
References ERROR, FAILURE, NO_FLAG, rl_log(), SEM_SET_TIME_OUT, SUCCESS, and TIME_OUT.
Referenced by handle_data_buffer(), main(), print_data(), and pru_sample().
| int wait_sem |
( |
int |
sem_id, |
|
|
int |
sem_num, |
|
|
int |
time_out |
|
) |
| |
Wait on a semaphore until access granted
- Parameters
-
| sem_id | ID of semaphore set |
| sem_num | Number of semaphore in set |
| time_out | Maximum waiting time |
- Returns
- SUCCESS on success (access granted), TIME_OUT on time out, FAILURE otherwise
Definition at line 52 of file sem.c.
References ERROR, FAILURE, INFO, NO_FLAG, rl_log(), SUCCESS, TIME_OUT, and WARNING.
Referenced by handle_data_buffer(), main(), and print_data().