From c9d09431b982b44ebec5b1ca0913e80f13aba809 Mon Sep 17 00:00:00 2001 From: Yabin Cui Date: Fri, 13 Feb 2015 10:52:35 -0800 Subject: [PATCH] Declare getgrent/setgrent/endgrent as missing. Bug: 19340053 Change-Id: I42bfeda95e6f262e2e74ab47336ea346c2de7e4a --- libc/include/grp.h | 6 +++--- libc/include/sys/cdefs.h | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/libc/include/grp.h b/libc/include/grp.h index fc4d52031..ab900223a 100644 --- a/libc/include/grp.h +++ b/libc/include/grp.h @@ -54,9 +54,9 @@ __BEGIN_DECLS struct group *getgrgid(gid_t); struct group *getgrnam(const char *); #if __POSIX_VISIBLE >= 200112 || __XPG_VISIBLE -struct group *getgrent(void); -void setgrent(void); -void endgrent(void); +struct group *getgrent(void) __errorattr("This function is meaningless on Android."); +__errordecl(setgrent, "This function is meaningless on Android."); +__errordecl(endgrent, "This function is meaningless on Android."); int getgrgid_r(gid_t, struct group *, char *, size_t, struct group **); int getgrnam_r(const char *, struct group *, char *, diff --git a/libc/include/sys/cdefs.h b/libc/include/sys/cdefs.h index 48763d730..1d33895e9 100644 --- a/libc/include/sys/cdefs.h +++ b/libc/include/sys/cdefs.h @@ -335,13 +335,15 @@ #endif #if __GNUC_PREREQ(4, 3) -#define __errordecl(name, msg) extern void name(void) __attribute__((__error__(msg))) +#define __errorattr(msg) __attribute__((__error__(msg))) #define __warnattr(msg) __attribute__((__warning__(msg))) #else -#define __errordecl(name, msg) extern void name(void) +#define __errorattr(msg) #define __warnattr(msg) #endif +#define __errordecl(name, msg) extern void name(void) __errorattr(msg) + /* * Some BSD source needs these macros. * Originally they embedded the rcs versions of each source file