ndk-patches: remove stubs for getgrgid_r and getgrgid_r

These could have been removed when we dropped support for api-levels
below 24 (android-7).

Reported in termux/termux-packages#12974.
This commit is contained in:
Henrik Grimler 2022-11-09 21:57:06 +01:00
parent 54b2f89a01
commit 6e9a296e79
No known key found for this signature in database
GPG Key ID: B0076E490B71616B
1 changed files with 14 additions and 13 deletions

View File

@ -1,10 +1,11 @@
diff -u -r /home/fornwall/lib/android-ndk/sysroot/usr/include/grp.h ./usr/include/grp.h
--- /home/fornwall/lib/android-ndk/sysroot/usr/include/grp.h 2017-11-09 09:57:12.000000000 +0100
+++ ./usr/include/grp.h 2017-11-15 11:43:43.065533963 +0100
@@ -52,18 +52,11 @@
/* Note: Android has thousands and thousands of ids to iterate through. */
--- ./usr/include/grp.h.orig 2022-11-09 21:58:45.468821763 +0100
+++ ./usr/include/grp.h 2022-11-09 22:02:55.124538470 +0100
@@ -50,21 +50,15 @@
struct group* getgrgid(gid_t __gid);
struct group* getgrnam(const char* __name);
-/* Note: Android has thousands and thousands of ids to iterate through. */
-
-#if __ANDROID_API__ >= 26
-struct group* getgrent(void) __INTRODUCED_IN(26);
-
@ -13,15 +14,15 @@ diff -u -r /home/fornwall/lib/android-ndk/sysroot/usr/include/grp.h ./usr/includ
-#endif /* __ANDROID_API__ >= 26 */
-
-
-#if __ANDROID_API__ >= 24
-int getgrgid_r(gid_t __gid, struct group* __group, char* __buf, size_t __n, struct group** __result) __INTRODUCED_IN(24);
-int getgrnam_r(const char* __name, struct group* __group, char* __buf, size_t __n, struct group** __result) __INTRODUCED_IN(24);
-#endif /* __ANDROID_API__ >= 24 */
#if __ANDROID_API__ >= 24
int getgrgid_r(gid_t __gid, struct group* __group, char* __buf, size_t __n, struct group** __result) __INTRODUCED_IN(24);
int getgrnam_r(const char* __name, struct group* __group, char* __buf, size_t __n, struct group** __result) __INTRODUCED_IN(24);
#endif /* __ANDROID_API__ >= 24 */
+static struct group* getgrent(void) { return 0; }
+static void setgrent(void) {}
+static void endgrent(void) {}
+static int getgrgid_r(gid_t gid, struct group * grp, char * buf, size_t buflen, struct group ** result) { *result = 0; return 0; }
+static int getgrnam_r(const char * name, struct group * grp, char * buf, size_t buflen, struct group ** result) { *result = 0; return 0; }
+
int getgrouplist(const char* __user, gid_t __group, gid_t* __groups, int* __group_count);
int initgroups(const char* __user, gid_t __group);