open-vm-tools.
/*********************************************************
- * Copyright (C) 2008-2016 VMware, Inc. All rights reserved.
+ * Copyright (C) 2008-2017 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
int Posix_Getpwuid_r(uid_t uid, struct passwd *pw,
char *buf, size_t size, struct passwd **ppw);
struct passwd *Posix_Getpwent(void);
+void Posix_Endpwent(void);
struct group *Posix_Getgrnam(const char *name);
int Posix_Getgrnam_r(const char *name, struct group *gr,
char *buf, size_t size, struct group **pgr);
/*********************************************************
- * Copyright (C) 2008-2016 VMware, Inc. All rights reserved.
+ * Copyright (C) 2008-2017 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
#endif
}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Posix_Endpwent --
+ *
+ * POSIX endpwent()
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+Posix_Endpwent(void)
+{
+#if defined(__ANDROID__)
+ /*
+ * endpwent() not avail until Android O
+ * TODO: When Android O(Oreo) becomes mainstream, we can remove this #if
+ * Refer https://github.com/android-ndk/ndk/issues/77
+ */
+ return;
+#else
+ endpwent();
+#endif
+}
+
+
#if !defined(VM_SYSTEM_HAS_GETPWNAM_R) || \
!defined(VM_SYSTEM_HAS_GETPWUID_R) || \
!defined(VM_SYSTEM_HAS_GETGRNAM_R) // {
}
if (str == NULL && pwd != NULL) {
str = UtilGetHomeDirectory(pwd);
- endpwent();
+ Posix_Endpwent();
if (str == NULL) {
Log("Could not get home directory for user.\n");
}
#if !defined(_WIN32)
struct passwd *pwd = Posix_Getpwuid(getuid());
expand = UtilGetLoginName(pwd);
- endpwent();
+ Posix_Endpwent();
#else
DWORD n = ARRAYSIZE(bufW);
if (GetUserNameW(bufW, &n)) {
*-----------------------------------------------------------------------------
*/
-#ifdef __linux__
+#if defined(__linux__) && !defined(__ANDROID__)
static pid_t
vmw_pthread_getthreadid_np(void)
{
void
VThreadBase_ForgetSelf(void)
{
+#if !defined VMW_HAVE_TLS
+ char *buf;
+#endif
+
if (vmx86_debug) {
Log("Forgetting VThreadID %" FMTPD "d (\"%s\").\n",
VThread_CurID(), VThread_CurName());
#if defined VMW_HAVE_TLS
memset(vthreadName, '\0', sizeof vthreadName);
#else
- char *buf;
-
ASSERT(vthreadNameKey != 0);
ASSERT(!VThreadBase_IsInSignal());
Panic_DumpGuiResources();
-#if defined(_WIN32) || !defined(VMX86_TOOLS)
+#if (defined(_WIN32) || !defined(VMX86_TOOLS)) && !defined(__ANDROID__)
if (Panic_GetCoreDumpOnPanic()) {
CoreDump_CoreDump();
}