From 9ee4905abb0e52f65a7bbbb307f93a120d856eff Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Thu, 2 Sep 2021 15:57:05 +0200 Subject: [PATCH] include: make all functions __hidden Signed-off-by: Christian Brauner --- src/include/fexecve.h | 4 +++- src/include/getgrgid_r.h | 4 +++- src/include/getline.h | 4 +++- src/include/lxcmntent.h | 13 ++++++++----- src/include/netns_ifaddrs.h | 4 ++-- src/include/openpty.h | 7 +++++-- src/include/prlimit.h | 6 ++++-- src/include/strchrnul.h | 2 +- src/include/strlcat.h | 3 ++- src/include/strlcpy.h | 3 ++- 10 files changed, 33 insertions(+), 17 deletions(-) diff --git a/src/include/fexecve.h b/src/include/fexecve.h index f822c18f65..4c0a8b0f5d 100644 --- a/src/include/fexecve.h +++ b/src/include/fexecve.h @@ -21,7 +21,9 @@ #ifndef _LXC_FEXECVE_H #define _LXC_FEXECVE_H +#include "../lxc/compiler.h" #include -extern int fexecve(int fd, char *const argv[], char *const envp[]); + +__hidden extern int fexecve(int fd, char *const argv[], char *const envp[]); #endif /* _LXC_FEXECVE_H */ diff --git a/src/include/getgrgid_r.h b/src/include/getgrgid_r.h index d01395b612..6a8c418c95 100644 --- a/src/include/getgrgid_r.h +++ b/src/include/getgrgid_r.h @@ -26,7 +26,9 @@ #include #include -extern int getgrgid_r(gid_t gid, struct group *gr, char *buf, size_t size, +#include "../lxc/compiler.h" + +__hidden extern int getgrgid_r(gid_t gid, struct group *gr, char *buf, size_t size, struct group **res); #endif /* _GETGRGID_R_H */ diff --git a/src/include/getline.h b/src/include/getline.h index 68452daf18..cbf9db925f 100644 --- a/src/include/getline.h +++ b/src/include/getline.h @@ -32,6 +32,8 @@ #include -extern ssize_t getline(char **outbuf, size_t *outsize, FILE *fp); +#include "../lxc/compiler.h" + +__hidden extern ssize_t getline(char **outbuf, size_t *outsize, FILE *fp); #endif diff --git a/src/include/lxcmntent.h b/src/include/lxcmntent.h index 1d45d4826b..f8954b4510 100644 --- a/src/include/lxcmntent.h +++ b/src/include/lxcmntent.h @@ -21,6 +21,8 @@ #ifndef _LXCMNTENT_H #define _LXCMNTENT_H +#include "../lxc/compiler.h" + #if IS_BIONIC struct mntent { @@ -32,20 +34,21 @@ struct mntent int mnt_passno; }; -extern struct mntent *getmntent (FILE *stream); -extern struct mntent *getmntent_r (FILE *stream, struct mntent *mp, char *buffer, int bufsiz); +__hidden extern struct mntent *getmntent(FILE *stream); +__hidden extern struct mntent *getmntent_r(FILE *stream, struct mntent *mp, + char *buffer, int bufsiz); #endif #if !defined(HAVE_SETMNTENT) || IS_BIONIC -FILE *setmntent (const char *file, const char *mode); +__hidden FILE *setmntent(const char *file, const char *mode); #endif #if !defined(HAVE_ENDMNTENT) || IS_BIONIC -int endmntent (FILE *stream); +__hidden int endmntent(FILE *stream); #endif #if !defined(HAVE_HASMNTOPT) || IS_BIONIC -extern char *hasmntopt (const struct mntent *mnt, const char *opt); +__hidden extern char *hasmntopt(const struct mntent *mnt, const char *opt); #endif #endif diff --git a/src/include/netns_ifaddrs.h b/src/include/netns_ifaddrs.h index d3f1d6eef8..1dc3448acb 100644 --- a/src/include/netns_ifaddrs.h +++ b/src/include/netns_ifaddrs.h @@ -12,8 +12,8 @@ extern "C" { #include #include -#include "compiler.h" -#include "memory_utils.h" +#include "../lxc/compiler.h" +#include "../lxc/memory_utils.h" struct netns_ifaddrs { struct netns_ifaddrs *ifa_next; diff --git a/src/include/openpty.h b/src/include/openpty.h index 8d4699f9a0..6302caea3e 100644 --- a/src/include/openpty.h +++ b/src/include/openpty.h @@ -6,12 +6,15 @@ #include #include +#include "../lxc/memory_utils.h" + /* * Create pseudo tty ptx pty pair with @__name and set terminal * attributes according to @__termp and @__winp and return handles for both * ends in @__aptx and @__apts. */ -extern int openpty(int *ptx, int *pty, char *name, const struct termios *termp, - const struct winsize *winp); +__hidden extern int openpty(int *ptx, int *pty, char *name, + const struct termios *termp, + const struct winsize *winp); #endif diff --git a/src/include/prlimit.h b/src/include/prlimit.h index 9b91e8b6cc..a36b795289 100644 --- a/src/include/prlimit.h +++ b/src/include/prlimit.h @@ -32,10 +32,12 @@ #include #include +#include "../lxc/memory_utils.h" + #define RLIM_SAVED_CUR RLIM_INFINITY #define RLIM_SAVED_MAX RLIM_INFINITY -int prlimit(pid_t, int, const struct rlimit*, struct rlimit*); -int prlimit64(pid_t, int, const struct rlimit64*, struct rlimit64*); +__hidden int prlimit(pid_t, int, const struct rlimit *, struct rlimit *); +__hidden int prlimit64(pid_t, int, const struct rlimit64 *, struct rlimit64 *); #endif diff --git a/src/include/strchrnul.h b/src/include/strchrnul.h index 70a0d94421..94e291700e 100644 --- a/src/include/strchrnul.h +++ b/src/include/strchrnul.h @@ -20,6 +20,6 @@ License along with the GNU C Library; if not, see . */ -#include "compiler.h" +#include "../lxc/compiler.h" __hidden extern char *strchrnul(const char *s, int c_in); diff --git a/src/include/strlcat.h b/src/include/strlcat.h index 60f7d8e053..748c3a6c20 100644 --- a/src/include/strlcat.h +++ b/src/include/strlcat.h @@ -22,8 +22,9 @@ #ifndef _STRLCAT_H #define _STRLCAT_H +#include "../lxc/compiler.h" #include -extern size_t strlcat(char *src, const char *append, size_t len); +__hidden extern size_t strlcat(char *src, const char *append, size_t len); #endif diff --git a/src/include/strlcpy.h b/src/include/strlcpy.h index 419cecf381..996e542cfe 100644 --- a/src/include/strlcpy.h +++ b/src/include/strlcpy.h @@ -22,8 +22,9 @@ #ifndef _STRLCPY_H #define _STRLCPY_H +#include "../lxc/compiler.h" #include -extern size_t strlcpy(char *, const char *, size_t); +__hidden extern size_t strlcpy(char *, const char *, size_t); #endif