OctopOS  0.6.0
Data communication bus for SPACE HAUC
Functions
utility.cpp File Reference
#include "../include/utility.h"

Functions

intptr_t * connect_shm ()
 
int semsetall (int sem_group, int number_in_group, int value)
 
int p (int sem_group, int donut_type)
 
int v (int sem_group, int donut_type)
 

Function Documentation

◆ connect_shm()

intptr_t* connect_shm ( )

function for connecting shared memmory to address space.

Returns
A pointer to the top of the shared memory space

◆ p()

int p ( int  sem,
int  counter 
)

Decraments a semaphore.

Parameters
semThe semaphore to access
counterthe counter to decrament
Returns
value of system call. fail if < 0.

◆ semsetall()

int semsetall ( int  sem_group,
int  number_in_group,
int  value 
)

Initializes all counters in a semaphore.

Parameters
sem_groupThe semaphore to initializes.
number_in_groupNumber of counters in the group.
valueThe initial value to set.
Returns
value of system call. fail if < 0.

◆ v()

int v ( int  sem,
int  counter 
)

Incraments a semaphore.

Parameters
semThe semaphore to access
counterthe counter to incraments
Returns
value of system call. fail if < 0.