diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-03-18 07:25:23 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-03-18 15:36:58 +0100 |
commit | c904df573396d95957dc79b242b3a76911063089 (patch) | |
tree | be6406676689018e8af8a929b6a4ef5284f94c70 /cpukit/posix/include/rtems/posix/posixapi.h | |
parent | sptests/sptls02: Use GNU++11 (diff) | |
download | rtems-c904df573396d95957dc79b242b3a76911063089.tar.bz2 |
score: Add _Objects_Get_by_name()
Replace _Objects_Name_to_id_string() with _Objects_Get_by_name() since
all users of this function are interested in the object itself and not
the identifier.
Use the object allocator lock to protect the search.
Update #2555.
Diffstat (limited to 'cpukit/posix/include/rtems/posix/posixapi.h')
-rw-r--r-- | cpukit/posix/include/rtems/posix/posixapi.h | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/cpukit/posix/include/rtems/posix/posixapi.h b/cpukit/posix/include/rtems/posix/posixapi.h index 8fee7a4f32..0348e28e16 100644 --- a/cpukit/posix/include/rtems/posix/posixapi.h +++ b/cpukit/posix/include/rtems/posix/posixapi.h @@ -20,6 +20,7 @@ #define _RTEMS_POSIX_POSIXAPI_H #include <rtems/config.h> +#include <rtems/score/assert.h> #include <rtems/score/objectimpl.h> /** @@ -48,27 +49,15 @@ typedef enum { */ void _POSIX_Fatal_error( POSIX_Fatal_domain domain, int eno ); -/** - * @brief Queries the object identifier @a id for a @a name. - * - * @param[in] information Object information. - * @param[in] name Zero terminated name string to look up. - * @param[out] id Pointer for identifier. The pointer must be valid. - * @param[out] len Pointer for string length. The pointer must be valid. - * - * @retval 0 Successful operation. - * @retval EINVAL The @a name pointer is @c NULL or the @a name string has - * zero length. - * @retval ENAMETOOLONG The @a name string length is greater than or equal to - * @c NAME_MAX. - * @retval ENOENT Found no corresponding identifier. - */ -int _POSIX_Name_to_id( - Objects_Information *information, - const char *name, - Objects_Id *id, - size_t *len -); +extern const int _POSIX_Get_by_name_error_table[ 3 ]; + +RTEMS_INLINE_ROUTINE int _POSIX_Get_by_name_error( + Objects_Get_by_name_error error +) +{ + _Assert( (size_t) error < RTEMS_ARRAY_SIZE( _POSIX_Get_by_name_error_table ) ); + return _POSIX_Get_by_name_error_table[ error ]; +} /** @} */ |