Skip to content

va: include <unistd.h> for getuid/getgid in secure_getenv fallback#889

Open
XinfengZhang wants to merge 1 commit into
intel:masterfrom
XinfengZhang:fix/va-internal-unistd-include
Open

va: include <unistd.h> for getuid/getgid in secure_getenv fallback#889
XinfengZhang wants to merge 1 commit into
intel:masterfrom
XinfengZhang:fix/va-internal-unistd-include

Conversation

@XinfengZhang

Copy link
Copy Markdown
Contributor

Fixes #888

On platforms like NetBSD (and other non-glibc systems), getuid(),
geteuid(), getgid(), and getegid() are not implicitly available —
they require an explicit #include <unistd.h> per POSIX. Without it,
the build fails with undefined function errors in the secure_getenv
fallback in va/va_internal.h.

The fix adds the missing include inside the #else branch that is
only compiled on non-Windows platforms where HAVE_SECURE_GETENV is
not defined.

On platforms like NetBSD (and other non-glibc systems), getuid(),
geteuid(), getgid(), and getegid() are not implicitly available.
They require an explicit include of <unistd.h> per POSIX. Without
it the build fails with undefined function errors.

Fixes: intel#888
Signed-off-by: Carl.Zhang <carl.zhang@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2.24.0 on NetBSD: build fails for undefined getuid()

1 participant