doc: fix posix wrapper documentation
This commit is contained in:
parent
364e60d84c
commit
26ab4829d7
@ -7,7 +7,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup sys_posix
|
* @ingroup posix
|
||||||
* @{
|
* @{
|
||||||
* @file posix_io.h
|
* @file posix_io.h
|
||||||
* @brief POSIX-like IO
|
* @brief POSIX-like IO
|
||||||
@ -31,14 +31,57 @@ extern "C" {
|
|||||||
#define READ 2
|
#define READ 2
|
||||||
#define WRITE 3
|
#define WRITE 3
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief POSIX IO ringbuffer
|
||||||
|
*/
|
||||||
struct posix_iop_t {
|
struct posix_iop_t {
|
||||||
|
/** number of bytes */
|
||||||
int nbytes;
|
int nbytes;
|
||||||
|
/** array for the ringbuffer */
|
||||||
char *buffer;
|
char *buffer;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Opens a file descriptor - represented by a corresponding thread
|
||||||
|
*
|
||||||
|
* @param[in] pid The thread managing the fd to open
|
||||||
|
* @param[in] flags Access modes
|
||||||
|
*
|
||||||
|
* @return 0 on success
|
||||||
|
* @return a negative value in error case
|
||||||
|
*/
|
||||||
int posix_open(int pid, int flags);
|
int posix_open(int pid, int flags);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Closes an open file descriptor
|
||||||
|
*
|
||||||
|
* @param[in] pid The opened thread
|
||||||
|
*
|
||||||
|
* @return 0 on success
|
||||||
|
* @return a negative value in error case
|
||||||
|
*/
|
||||||
int posix_close(int pid);
|
int posix_close(int pid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Reads from an open file descriptor
|
||||||
|
*
|
||||||
|
* @param[in] pid The thread managing the open fd
|
||||||
|
* @param[out] buffer Buffer to fill
|
||||||
|
* @param[in] bufsize Read up to that many bytes into @p buffer
|
||||||
|
*
|
||||||
|
* @return the number of read bytes
|
||||||
|
*/
|
||||||
int posix_read(int pid, char *buffer, int bufsize);
|
int posix_read(int pid, char *buffer, int bufsize);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Writes to an open file descriptor
|
||||||
|
*
|
||||||
|
* @param[in] pid The thread managing the open fd
|
||||||
|
* @param[in] buffer Buffer to write
|
||||||
|
* @param[in] bufsize Write that many bytes from @p buffer
|
||||||
|
*
|
||||||
|
* @return the number of written bytes
|
||||||
|
*/
|
||||||
int posix_write(int pid, char *buffer, int bufsize);
|
int posix_write(int pid, char *buffer, int bufsize);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @defgroup sys_posix POSIX wrapper for RIOT
|
* @defgroup posix POSIX wrapper for RIOT
|
||||||
* @brief POSIX header files
|
* @brief POSIX header files
|
||||||
* @see <a href="http://pubs.opengroup.org/onlinepubs/9699919799/">
|
* @see <a href="http://pubs.opengroup.org/onlinepubs/9699919799/">
|
||||||
* The Open Group Specifications Issue 7
|
* The Open Group Specifications Issue 7
|
||||||
|
|||||||
@ -20,8 +20,13 @@ extern "C" {
|
|||||||
/** Value returned if `sem_open' failed. */
|
/** Value returned if `sem_open' failed. */
|
||||||
#define SEM_FAILED ((sem_t *) 0)
|
#define SEM_FAILED ((sem_t *) 0)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Semaphore struct
|
||||||
|
*/
|
||||||
typedef struct sem {
|
typedef struct sem {
|
||||||
|
/** the value of the semaphore */
|
||||||
volatile unsigned int value;
|
volatile unsigned int value;
|
||||||
|
/** list of threads waiting for the semaphore */
|
||||||
priority_queue_t queue;
|
priority_queue_t queue;
|
||||||
} sem_t;
|
} sem_t;
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup sys_posix
|
* @ingroup posix
|
||||||
* @{
|
* @{
|
||||||
*
|
*
|
||||||
* @file strings.h
|
* @file strings.h
|
||||||
@ -73,6 +73,7 @@ int strncasecmp(const char *s1, const char *s2, size_t n);
|
|||||||
* @param[in] s1 a string.
|
* @param[in] s1 a string.
|
||||||
* @param[in] s2 another string.
|
* @param[in] s2 another string.
|
||||||
* @param[in] n number of bytes to be compared
|
* @param[in] n number of bytes to be compared
|
||||||
|
* @param[in] l locale, not used in RIOT
|
||||||
*
|
*
|
||||||
* @return A value greater 0 if, ignoring the case of the character, *s1* is
|
* @return A value greater 0 if, ignoring the case of the character, *s1* is
|
||||||
* greater than *s2* up to n bytes, less than 0 if smaller, and 0 if
|
* greater than *s2* up to n bytes, less than 0 if smaller, and 0 if
|
||||||
@ -109,6 +110,7 @@ int strncasecmp(const char *s1, const char *s2, size_t n);
|
|||||||
*
|
*
|
||||||
* @param[in] s1 a string.
|
* @param[in] s1 a string.
|
||||||
* @param[in] s2 another string.
|
* @param[in] s2 another string.
|
||||||
|
* @param[in] l locale, not used in RIOT
|
||||||
*
|
*
|
||||||
* @return A value greater 0 if, ignoring the case of the character, *s1* is
|
* @return A value greater 0 if, ignoring the case of the character, *s1* is
|
||||||
* greater than *s2*, less than 0 if smaller, and 0 if equal
|
* greater than *s2*, less than 0 if smaller, and 0 if equal
|
||||||
|
|||||||
@ -55,6 +55,10 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
int close(int fildes);
|
int close(int fildes);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @name Microseconds data type
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
#ifndef __USECONDS_T_TYPE
|
#ifndef __USECONDS_T_TYPE
|
||||||
#if !(defined(__MACH__) || defined(__FreeBSD__))
|
#if !(defined(__MACH__) || defined(__FreeBSD__))
|
||||||
typedef unsigned long __USECONDS_T_TYPE;
|
typedef unsigned long __USECONDS_T_TYPE;
|
||||||
@ -66,6 +70,7 @@ typedef __darwin_useconds_t __useconds_t;
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
typedef __useconds_t useconds_t;
|
typedef __useconds_t useconds_t;
|
||||||
|
/** @} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief the caller will sleep for given amount of micro seconds
|
* @brief the caller will sleep for given amount of micro seconds
|
||||||
|
|||||||
@ -32,11 +32,16 @@ extern "C" {
|
|||||||
* @note condition attributes are currently NOT USED in RIOT condition variables
|
* @note condition attributes are currently NOT USED in RIOT condition variables
|
||||||
*/
|
*/
|
||||||
typedef struct pthread_condattr_t {
|
typedef struct pthread_condattr_t {
|
||||||
|
/** dumdidum */
|
||||||
int __dummy;
|
int __dummy;
|
||||||
} pthread_condattr_t;
|
} pthread_condattr_t;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Condition variable
|
||||||
|
*
|
||||||
|
* @warning fields are managed by cv functions, don't touch
|
||||||
|
*/
|
||||||
typedef struct pthread_cond_t {
|
typedef struct pthread_cond_t {
|
||||||
/* fields are managed by cv functions, don't touch */
|
|
||||||
priority_queue_t queue; /**< Threads currently waiting to be signaled. */
|
priority_queue_t queue; /**< Threads currently waiting to be signaled. */
|
||||||
} pthread_cond_t;
|
} pthread_cond_t;
|
||||||
|
|
||||||
|
|||||||
@ -37,6 +37,7 @@ typedef struct pthread_attr
|
|||||||
* @brief This structure is unused right now, and only exists for POSIX compatibility.
|
* @brief This structure is unused right now, and only exists for POSIX compatibility.
|
||||||
*/
|
*/
|
||||||
struct sched_param {
|
struct sched_param {
|
||||||
|
/** Todo is the greates magician in the land of RIOT */
|
||||||
int todo; /* TODO */
|
int todo; /* TODO */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user