-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Conversation
✅ Checkpatch passed Beep boop! I ran Unikraft's
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andreittr we should define _SC_GETPW_R_SIZE_MAX
in nolibc/include/unistd.h
, otherwise the build fails when using nolibc
.
Calling code expects sysconf(_SC_GETPW_R_SIZE_MAX) to be either -1 or a non-zero value for an initial buffer size. The previous default value of 0 is outside of specifications and can cause unintended behavior. This change makes sysconf(_SC_GETPW_R_SIZE_MAX) return -1. Signed-off-by: Andrei Tatar <andrei@unikraft.io>
5eecf9c
to
b8cc0a3
Compare
Update: added define of _SC_GETPW_R_SIZE_MAX to nolibc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@John-Ted , please take a look, so I can then approve it and have it merged. |
I'm trying to compile the helloworld app to print the
|
Whoops, seems |
This change adds a missing declaration of `sysconf()` in the unistd.h header provided by nolibc, complementing the _SC_* constants. Signed-off-by: Andrei Tatar <andrei@unikraft.io>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything works fine now. Thanks!
Reviewed-by: Ioan-Teodor Teugea ioan_teodor.teugea@stud.acs.upb.ro
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved-by: Razvan Deaconescu razvand@unikraft.io
This change adds a missing declaration of `sysconf()` in the unistd.h header provided by nolibc, complementing the _SC_* constants. Signed-off-by: Andrei Tatar <andrei@unikraft.io> Reviewed-by: Ioan-Teodor Teugea <ioan_teodor.teugea@stud.acs.upb.ro> Approved-by: Razvan Deaconescu <razvand@unikraft.io> Tested-by: Unikraft CI <monkey@unikraft.io> GitHub-Closes: #936
Description of changes
Calling code expects
sysconf(_SC_GETPW_R_SIZE_MAX)
to be either -1 or a non-zero value for an initial buffer size. The previous default value of 0 is outside of specifications and can cause unintended behavior. This change makessysconf(_SC_GETPW_R_SIZE_MAX)
return -1.See
man 3 getpwuid
for the specifications forsysconf(_SC_GETPW_R_SIZE_MAX)
.Prerequisite checklist
checkpatch.uk
on your commit series before opening this PR;Base target
Additional configuration
CONFIG_LIBPOSIX_USER=y
andCONFIG_LIBPOSIX_SYSINFO=y
.