Skip to content

Commit f13ba3b

Browse files
committed
va: include <unistd.h> for getuid/getgid in secure_getenv fallback
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: #888 Signed-off-by: Carl.Zhang <carl.zhang@intel.com>
1 parent 28388a0 commit f13ba3b

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

va/va_internal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ extern "C" {
3434
/* No setuid/setgid on Windows, secure_getenv is just getenv */
3535
#define secure_getenv getenv
3636
#else
37+
#include <unistd.h>
3738
static inline char * secure_getenv(const char *name)
3839
{
3940
if (getuid() == geteuid() && getgid() == getegid())

0 commit comments

Comments
 (0)