Move prototypes for the non-standard include/semaphore.h file to the
non-standard include/tinyara/semaphore.h with the other non-standard
semaphore interfaces.
All credits should go to Gregory Nutt who wrote the original patch.
Change-Id: I970391b2a3510279e964db3cce2345a5db91f8eb
Signed-off-by: Gregory Nutt <gnutt@nuttx.org>
[Shin: backported
d5b4d848 from NuttX]
Signed-off-by: Heesub Shin <heesub.shin@samsung.com>
#include <tinyara/config.h>
#include <sys/types.h>
-#include <semaphore.h>
#include <assert.h>
+#include <tinyara/semaphore.h>
+
#ifdef CONFIG_PRIORITY_INHERITANCE
/****************************************************************************
*/
#endif
-#ifdef CONFIG_PRIORITY_INHERITANCE
-/* Non-standard interfaces to manage priority inheritance */
-int sem_getprotocol(FAR sem_t *sem, FAR int *protocol);
-int sem_setprotocol(FAR sem_t *sem, int protocol);
-#endif
-
#undef EXTERN
#ifdef __cplusplus
}
int sem_reset(FAR sem_t *sem, int16_t count);
+/****************************************************************************
+ * Function: sem_getprotocol
+ *
+ * Description:
+ * Return the value of the semaphore protocol attribute.
+ *
+ * Parameters:
+ * sem - A pointer to the semaphore whose attributes are to be
+ * queried.
+ * protocol - The user provided location in which to store the protocol
+ * value.
+ *
+ * Return Value:
+ * 0 if successful. Otherwise, -1 is returned and the errno value is set
+ * appropriately.
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_PRIORITY_INHERITANCE
+int sem_getprotocol(FAR sem_t *sem, FAR int *protocol);
+#endif
+
+/****************************************************************************
+ * Function: sem_setprotocol
+ *
+ * Description:
+ * Set semaphore protocol attribute.
+ *
+ * Parameters:
+ * sem - A pointer to the semaphore whose attributes are to be
+ * modified
+ * protocol - The new protocol to use
+ *
+ * Return Value:
+ * 0 if successful. Otherwise, -1 is returned and the errno value is set
+ * appropriately.
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_PRIORITY_INHERITANCE
+int sem_setprotocol(FAR sem_t *sem, int protocol);
+#endif
+
#undef EXTERN
#ifdef __cplusplus
}
#include <errno.h>
#include <debug.h>
+#include <tinyara/semaphore.h>
+
#include "pthread/pthread.h"
/****************************************************************************
#include <tinyara/config.h>
-#include <semaphore.h>
#include <assert.h>
#include <errno.h>
+#include <tinyara/semaphore.h>
+
#include "semaphore/semaphore.h"
#ifdef CONFIG_PRIORITY_INHERITANCE
"sem_destroy", "semaphore.h", "", "int", "FAR sem_t*"
"sem_open", "semaphore.h", "defined(CONFIG_FS_NAMED_SEMAPHORES)", "FAR sem_t*", "FAR const char*", "int", "..."
"sem_post", "semaphore.h", "", "int", "FAR sem_t*"
-"sem_setprotocol","semaphore.h","defined(CONFIG_PRIORITY_INHERITANCE)","int","FAR sem_t*","int"
+"sem_setprotocol","tinyara/semaphore.h","defined(CONFIG_PRIORITY_INHERITANCE)","int","FAR sem_t*","int"
"sem_timedwait", "semaphore.h", "", "int", "FAR sem_t*", "FAR const struct timespec *"
"sem_trywait", "semaphore.h", "", "int", "FAR sem_t*"
"sem_unlink", "semaphore.h", "defined(CONFIG_FS_NAMED_SEMAPHORES)", "int", "FAR const char*"