Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib/posix-sysinfo: Provide _SC_GETPW_R_SIZE_MAX #936

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/nolibc/include/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,13 @@ extern "C" {
#define _SC_OPEN_MAX 4
#define _SC_PAGE_SIZE 30
#define _SC_PAGESIZE _SC_PAGE_SIZE
#define _SC_GETPW_R_SIZE_MAX 70
#define _SC_PHYS_PAGES 85
#define _SC_AVPHYS_PAGES 86
#define _SC_NPROCESSORS_CONF 83
#define _SC_NPROCESSORS_ONLN 84

long sysconf(int);
#endif

#include <nolibc-internal/shareddefs.h>
Expand Down
5 changes: 5 additions & 0 deletions lib/posix-sysinfo/sysinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ long sysconf(int name)
if (name == _SC_PAGESIZE)
return __PAGE_SIZE;

#ifdef CONFIG_LIBPOSIX_USER
if (name == _SC_GETPW_R_SIZE_MAX)
return -1;
#endif /* CONFIG_LIBPOSIX_USER */

#ifdef CONFIG_HAVE_PAGING
if (name == _SC_PHYS_PAGES) {
struct uk_pagetable *pt;
Expand Down