File:  [DVB] / dietlibc / include / semaphore.h
Revision 1.2: download - view: text, annotated - select for diffs
Wed Sep 21 07:33:08 2005 UTC (18 years, 8 months ago) by leitner
Branches: MAIN
CVS tags: HEAD
  update syscalls
  lots of fixes from Markus FX Oberhumer:
    * better signal handling error detection
    * setjmp.S on i386
    * getenv on i386
    * sys/stat.h -malign-double fix
    * update fcntl.h for MIPS to 2.6.13 version
    * jmp_buf is 40*8 instead of 58*8 on ppc64.
    * This patch fixes the section of the TOC entries on ppc64
    * libstdc++ updates for gcc 4
    * remove cstddef and cwchar (no longer needed)
    * int -> ssize_t for read and write
    * sigjmp.c: __mask_was_saved was not set in all cases!
    * another round of ILP64 cleanups

#ifndef __SEMAPHORE_H__
#define __SEMAPHORE_H__

#include <time.h>
#include <pthread.h>

__BEGIN_DECLS

typedef struct {
  pthread_mutex_t lock;
  pthread_cond_t cond;
  int value;
  uint32_t magic;
} sem_t;

#define SEM_FAILED	((sem_t*)0)
#define SEM_VALUE_MAX	((int)((~0u)>>1))
#define SEM_MAGIC	0x35d108f2

int sem_destroy(sem_t*sem) __THROW;
int sem_getvalue(sem_t*sem,int*sval) __THROW;
int sem_init(sem_t*sem,int pshared,unsigned int value) __THROW;
int sem_post(sem_t*sem) __THROW;
int sem_trywait(sem_t*sem) __THROW;
int sem_wait(sem_t*sem) __THROW;

sem_t*sem_open(const char*name,int oflag,...) __THROW;
int sem_close(sem_t*sem) __THROW;
int sem_unlink(const char*name) __THROW;

int sem_timedwait(sem_t*sem,const struct timespec*abstime) __THROW;

__END_DECLS

#endif

LinuxTV legacy CVS <linuxtv.org/cvs>