2001-03-21 17:06:22 +01:00
|
|
|
/* semaphore.h: POSIX semaphore interface
|
|
|
|
|
2007-02-07 18:22:40 +01:00
|
|
|
Copyright 2001, 2003, 2007 Red Hat, Inc.
|
2001-03-21 17:06:22 +01:00
|
|
|
|
|
|
|
Written by Robert Collins <rbtcollins@hotmail.com>
|
|
|
|
|
|
|
|
This file is part of Cygwin.
|
|
|
|
|
|
|
|
This software is a copyrighted work licensed under the terms of the
|
|
|
|
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
|
|
|
details. */
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
|
|
#ifndef _SEMAPHORE_H
|
|
|
|
#define _SEMAPHORE_H
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __INSIDE_CYGWIN__
|
2003-01-09 22:14:33 +01:00
|
|
|
typedef struct __sem_t {char __dummy;} *sem_t;
|
2001-03-21 17:06:22 +01:00
|
|
|
#endif
|
|
|
|
|
2007-02-20 16:48:04 +01:00
|
|
|
#define SEM_FAILED ((sem_t *) 0)
|
2001-03-21 17:06:22 +01:00
|
|
|
|
|
|
|
/* Semaphores */
|
2007-02-20 16:48:04 +01:00
|
|
|
int sem_init (sem_t *sem, int pshared, unsigned int value);
|
|
|
|
int sem_destroy (sem_t *sem);
|
2003-10-27 12:48:29 +01:00
|
|
|
sem_t *sem_open (const char *name, int oflag, ...);
|
|
|
|
int sem_close (sem_t *sem);
|
2007-02-20 16:48:04 +01:00
|
|
|
int sem_unlink (const char *name);
|
|
|
|
int sem_wait (sem_t *sem);
|
|
|
|
int sem_trywait (sem_t *sem);
|
|
|
|
int sem_timedwait (sem_t *sem, const struct timespec *abstime);
|
|
|
|
int sem_post (sem_t *sem);
|
|
|
|
int sem_getvalue (sem_t *sem, int *sval);
|
2001-03-21 17:06:22 +01:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* _SEMAPHORE_H */
|