sysconf: Implement _SC_ATEXIT_MAX query
and remove the incorrect macro ATEXIT_MAX Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> Change-Id: Ia5d7dafc50e942f62f95137313c34741c6dd60ba
This commit is contained in:
parent
f24c71be32
commit
1e166f7ecb
|
@ -48,12 +48,6 @@
|
|||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* The number of functions that may be registered to be called
|
||||
* at program exit.
|
||||
*/
|
||||
|
||||
#define ATEXIT_MAX 1
|
||||
|
||||
/* Values for seeking */
|
||||
|
||||
#define SEEK_SET 0 /* From the start of the file */
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
#include <nuttx/config.h>
|
||||
|
||||
#include <unistd.h>
|
||||
#include <sched.h>
|
||||
#include <errno.h>
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -225,6 +226,13 @@ long sysconf(int name)
|
|||
case _SC_OPEN_MAX:
|
||||
return CONFIG_NFILE_DESCRIPTORS;
|
||||
|
||||
case _SC_ATEXIT_MAX:
|
||||
#ifdef CONFIG_SCHED_EXIT_MAX
|
||||
return CONFIG_SCHED_EXIT_MAX;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
default:
|
||||
#if 0 /* Assume valid but not implemented for the time being */
|
||||
errcode = EINVAL;
|
||||
|
|
Loading…
Reference in New Issue