Rudiments
semaphoreset.h
1 // Copyright (c) 1999-2018 David Muse
2 // See the COPYING file for more information.
3 
4 #ifndef RUDIMENTS_SEMAPHORESET_H
5 #define RUDIMENTS_SEMAPHORESET_H
6 
7 #include <rudiments/private/semaphoresetincludes.h>
8 
44 class RUDIMENTS_DLLSPEC semaphoreset {
45  public:
46 
49 
54 
58 
65 
75  bool create(key_t key, mode_t permissions,
76  int32_t semcount, const int32_t *values);
77 
81  bool attach(key_t key, int32_t semcount);
82 
87  bool createOrAttach(key_t key, mode_t permissions,
88  int32_t semcount, const int32_t *values);
89 
97  void dontRemove();
98 
101  bool forceRemove();
102 
104  int32_t getId() const;
105 
107  bool wait(int32_t index);
108 
118  bool wait(int32_t index, int32_t seconds,
119  int32_t nanoseconds);
120 
122  bool signal(int32_t index);
123 
124 
127  bool waitWithUndo(int32_t index);
128 
139  bool waitWithUndo(int32_t index,
140  int32_t seconds, int32_t nanoseconds);
141 
144  bool signalWithUndo(int32_t index);
145 
146 
148  bool setValue(int32_t index, int32_t value);
149 
151  int32_t getValue(int32_t index);
152 
153 
160  bool setUserName(const char *username);
161 
169  bool setGroupName(const char *groupname);
170 
173  bool setUserId(uid_t uid);
174 
177  bool setGroupId(gid_t gid);
178 
182 
183 
195  const char *getUserName();
196 
208  const char *getGroupName();
209 
212  uid_t getUserId();
213 
216  gid_t getGroupId();
217 
219  mode_t getPermissions();
220 
221 
224  int32_t getWaitingForZero(int32_t index);
225 
228  int32_t getWaitingForIncrement(int32_t index);
229 
234 
239 
242  static bool supported();
243 
244  #include <rudiments/private/semaphoreset.h>
245 };
246 
247 #endif
Definition: permissions.h:28
Definition: semaphoreset.h:44
bool wait(int32_t index, int32_t seconds, int32_t nanoseconds)
bool createOrAttach(key_t key, mode_t permissions, int32_t semcount, const int32_t *values)
bool supportsUndoSemaphoreOperations()
bool create(key_t key, mode_t permissions, int32_t semcount, const int32_t *values)
mode_t getPermissions()
void dontRemove()
bool setPermissions(mode_t permissions)
bool forceRemove()
gid_t getGroupId()
void retryInterruptedOperations()
bool setUserId(uid_t uid)
bool signalWithUndo(int32_t index)
static bool supported()
int32_t getId() const
bool setUserName(const char *username)
uid_t getUserId()
bool wait(int32_t index)
bool setGroupId(gid_t gid)
bool setGroupName(const char *groupname)
bool setValue(int32_t index, int32_t value)
void dontRetryInterruptedOperations()
bool attach(key_t key, int32_t semcount)
int32_t getWaitingForIncrement(int32_t index)
int32_t getWaitingForZero(int32_t index)
bool supportsTimedSemaphoreOperations()
bool waitWithUndo(int32_t index)
bool waitWithUndo(int32_t index, int32_t seconds, int32_t nanoseconds)
bool signal(int32_t index)
const char * getGroupName()
const char * getUserName()
int32_t getValue(int32_t index)