Skip to content

posix: implement confstr() #66866

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

Closed
Tracked by #51211
cfriedt opened this issue Dec 22, 2023 · 3 comments · Fixed by #70274
Closed
Tracked by #51211

posix: implement confstr() #66866

cfriedt opened this issue Dec 22, 2023 · 3 comments · Fixed by #70274
Assignees
Labels
area: POSIX POSIX API Library Enhancement Changes/Updates/Additions to existing features Good first issue Good for a first time contributor to take

Comments

@cfriedt
Copy link
Member

cfriedt commented Dec 22, 2023

This is part of the See POSIX Roadmap for LTSv3 (RFC #51211).

confstr() is required as part of POSIX_SINGLE_PROCESS Subprofiling Option Group.

For more information, please refer to https://pubs.opengroup.org/onlinepubs/9699919799/functions/confstr.html

@cfriedt cfriedt added Feature Request A request for a new feature Good first issue Good for a first time contributor to take area: POSIX POSIX API Library labels Dec 22, 2023
@cfriedt cfriedt self-assigned this Dec 22, 2023
@nashif nashif added Enhancement Changes/Updates/Additions to existing features and removed Feature Request A request for a new feature labels Jan 19, 2024
@moonlight83340
Copy link
Contributor

Any tips where to begin ? I have read the PR for sysconf. (#67500)
I think of conftstr a switch case function like but not sure if we could do it differently.

_CS_PATH
_CS_POSIX_V7_ILP32_OFF32_CFLAGS
_CS_POSIX_V7_ILP32_OFF32_LDFLAGS
_CS_POSIX_V7_ILP32_OFF32_LIBS
_CS_POSIX_V7_ILP32_OFFBIG_CFLAGS
_CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS
_CS_POSIX_V7_ILP32_OFFBIG_LIBS
_CS_POSIX_V7_LP64_OFF64_CFLAGS
_CS_POSIX_V7_LP64_OFF64_LDFLAGS
_CS_POSIX_V7_LP64_OFF64_LIBS
_CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS
_CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS
_CS_POSIX_V7_LPBIG_OFFBIG_LIBS
_CS_POSIX_V7_THREADS_CFLAGS
_CS_POSIX_V7_THREADS_LDFLAGS
_CS_POSIX_V7_WIDTH_RESTRICTED_ENVS
_CS_V7_ENV

_CS_POSIX_V6_ILP32_OFF32_CFLAGS
_CS_POSIX_V6_ILP32_OFF32_LDFLAGS
_CS_POSIX_V6_ILP32_OFF32_LIBS
_CS_POSIX_V6_ILP32_OFFBIG_CFLAGS
_CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS
_CS_POSIX_V6_ILP32_OFFBIG_LIBS
_CS_POSIX_V6_LP64_OFF64_CFLAGS
_CS_POSIX_V6_LP64_OFF64_LDFLAGS
_CS_POSIX_V6_LP64_OFF64_LIBS
_CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS
_CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
_CS_POSIX_V6_LPBIG_OFFBIG_LIBS
_CS_POSIX_V6_WIDTH_RESTRICTED_ENVS
_CS_V6_ENV

There are a lot of define, not sure of value that shoudl get.
Maybe I should try from basic implementation with return control and then go to a full implementation with the case I can match.

@cfriedt
Copy link
Member Author

cfriedt commented Feb 4, 2024

The constants could probably be an enumeration in unistd.h

The function itself should do some basic error checking (valid values of int name). If an invalid name is passed, it should return 0 and set errno to EINVAL.

Other than that, it should return 0 and not modify errno.

@moonlight83340
Copy link
Contributor

I think #70274 close that issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: POSIX POSIX API Library Enhancement Changes/Updates/Additions to existing features Good first issue Good for a first time contributor to take
Projects
None yet
3 participants