diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-05-03 12:55:00 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-05-04 07:24:29 +0200 |
commit | e4fd35ddcb3c3a456e825a7542b302b13c4cb51f (patch) | |
tree | 64bcc7c8ee220d4faa3cc0489437fc87bd083a94 | |
parent | score: Optimize _Objects_Get_local() (diff) | |
download | rtems-e4fd35ddcb3c3a456e825a7542b302b13c4cb51f.tar.bz2 |
confdefs.h: Fix named object size estimate
Account for the terminating null character. Use _POSIX_PATH_MAX instead
of NAME_MAX according to _POSIX_Semaphore_Manager_initialization() and
_POSIX_Message_queue_Manager_initialization().
-rw-r--r-- | cpukit/sapi/include/confdefs.h | 5 | ||||
-rw-r--r-- | testsuites/psxtests/psxconfig01/init.c | 10 |
2 files changed, 8 insertions, 7 deletions
diff --git a/cpukit/sapi/include/confdefs.h b/cpukit/sapi/include/confdefs.h index ceed2a4b9d..e4e5331ef4 100644 --- a/cpukit/sapi/include/confdefs.h +++ b/cpukit/sapi/include/confdefs.h @@ -2514,8 +2514,9 @@ extern rtems_initialization_tasks_table Initialization_tasks[]; * This is an internal macro. */ #define _Configure_POSIX_Named_Object_RAM(_number, _size) \ - _Configure_Object_RAM( (_number), _size ) + \ - (_Configure_Max_Objects(_number) * _Configure_From_workspace(NAME_MAX) ) + (_Configure_Object_RAM(_number, _size) \ + + _Configure_Max_Objects(_number) \ + * _Configure_From_workspace(_POSIX_PATH_MAX + 1)) /** * This configuration parameter specifies the maximum number of diff --git a/testsuites/psxtests/psxconfig01/init.c b/testsuites/psxtests/psxconfig01/init.c index 1edd9ba9d8..9f3c134a6d 100644 --- a/testsuites/psxtests/psxconfig01/init.c +++ b/testsuites/psxtests/psxconfig01/init.c @@ -200,7 +200,7 @@ typedef struct { static area region_areas [CONFIGURE_MAXIMUM_REGIONS]; #endif -static char posix_name [NAME_MAX]; +static char posix_name [_POSIX_PATH_MAX + 1]; #if !defined(RTEMS_SMP) static void *task_var; @@ -208,10 +208,10 @@ static char posix_name [NAME_MAX]; static char *get_posix_name(char a, char b, char c, int i) { - posix_name [NAME_MAX - 5] = a; - posix_name [NAME_MAX - 4] = b; - posix_name [NAME_MAX - 3] = c; - posix_name [NAME_MAX - 2] = 'A' + i; + posix_name [_POSIX_PATH_MAX - 4] = a; + posix_name [_POSIX_PATH_MAX - 3] = b; + posix_name [_POSIX_PATH_MAX - 2] = c; + posix_name [_POSIX_PATH_MAX - 1] = 'A' + i; return posix_name; } |