-
Notifications
You must be signed in to change notification settings - Fork 5
/
xerrors.h
33 lines (28 loc) · 1.18 KB
/
xerrors.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <stdbool.h>
#include <assert.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <pthread.h>
#include <semaphore.h>
// thread
void xperror(int en, char *msg);
int xpthread_create(pthread_t *thread, const pthread_attr_t *attr,
void *(*start_routine) (void *), void *arg, int linea, const char *file);
int xpthread_join(pthread_t thread, void **retval, int linea, const char *file);
// mutex
int xpthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *attr, int linea, const char *file);
int xpthread_mutex_destroy(pthread_mutex_t *mutex, int linea, const char *file);
int xpthread_mutex_lock(pthread_mutex_t *mutex, int linea, const char *file);
int xpthread_mutex_unlock(pthread_mutex_t *mutex, int linea, const char *file);
//semaphores
int xsem_init(sem_t *sem, int pshared, unsigned int value, int linea, const char *file);
int xsem_post(sem_t *sem, int linea, const char *file);
int xsem_wait(sem_t *sem, int linea, const char *file);
int xsem_destroy(sem_t *sem, int linea, const char *file);