libc/sysconf: add _SC_GETPW_R_SIZE_MAX

pass tlpi example: https://man7.org/tlpi/code/online/dist/users_groups/t_getpwnam_r.c.html

Signed-off-by: chenzhijia <chenzhijia@xiaomi.com>
This commit is contained in:
chenzhijia 2024-04-08 14:54:47 +08:00 committed by Xiang Xiao
parent a763ed1e07
commit 1086a05e50
2 changed files with 7 additions and 0 deletions

View file

@ -57,6 +57,9 @@
#undef _POSIX_MEMLOCK_RANGE
#undef _POSIX_FSYNC
#define _POSIX_SYNCHRONIZED_IO 1
#ifdef CONFIG_LIBC_PASSWD_LINESIZE
# define _POSIX_GETPW_R_SIZE_MAX CONFIG_LIBC_PASSWD_LINESIZE
#endif
#define _POSIX_VERSION 201712L
#define _POSIX_PRIORITIZED_IO _POSIX_VERSION

View file

@ -223,6 +223,10 @@ long sysconf(int name)
return _POSIX_PRIORITIZED_IO;
case _SC_AIO_MAX:
return _POSIX_AIO_MAX;
#ifdef CONFIG_LIBC_PASSWD_LINESIZE
case _SC_GETPW_R_SIZE_MAX:
return _POSIX_GETPW_R_SIZE_MAX;
#endif
case _SC_CPUTIME:
return _POSIX_CPUTIME;
case _SC_THREAD_CPUTIME: