diff --git a/include/unistd.h b/include/unistd.h index 10463f28b5dc1..3c576d6e1f99d 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -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 diff --git a/libs/libc/unistd/lib_sysconf.c b/libs/libc/unistd/lib_sysconf.c index eff4e718e2dc6..a35120e5d1a15 100644 --- a/libs/libc/unistd/lib_sysconf.c +++ b/libs/libc/unistd/lib_sysconf.c @@ -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: