summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPhilip Guenthe <guenther@cvs.openbsd.org>2012-10-01 00:21:21 +0000
committerPhilip Guenthe <guenther@cvs.openbsd.org>2012-10-01 00:21:21 +0000
commitda717fda3d77ba64d24924bca0770b98c4ccd42a (patch)
tree3aaba41352225e83a37987fad2b152aae89222a0 /include
parenta5aa4d002911d63c10d7ef67567902b0a4c8cb9c (diff)
More compliance fixes: hiding non-standard stuff behind __BSD_VISIBLE,
making files stand-alone, some __restrict additions. tweaks kettenis@; ports testing and fixes landry@ and jasper@ ok millert@
Diffstat (limited to 'include')
-rw-r--r--include/dlfcn.h58
-rw-r--r--include/glob.h5
-rw-r--r--include/grp.h6
-rw-r--r--include/time.h14
4 files changed, 49 insertions, 34 deletions
diff --git a/include/dlfcn.h b/include/dlfcn.h
index 3cf5fd78422..c7758d04d48 100644
--- a/include/dlfcn.h
+++ b/include/dlfcn.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dlfcn.h,v 1.11 2007/05/29 04:47:17 jason Exp $ */
+/* $OpenBSD: dlfcn.h,v 1.12 2012/10/01 00:21:19 guenther Exp $ */
/* $NetBSD: dlfcn.h,v 1.2 1995/06/05 19:38:00 pk Exp $ */
/*
@@ -36,34 +36,11 @@
#include <sys/cdefs.h>
-/*
- * Structure filled in by dladdr().
- */
-typedef struct dl_info {
- const char *dli_fname; /* Pathname of shared object. */
- void *dli_fbase; /* Base address of shared object. */
- const char *dli_sname; /* Name of nearest symbol. */
- void *dli_saddr; /* Address of nearest symbol. */
-} Dl_info;
-
-/*
- * User interface to the run-time linker.
- */
-__BEGIN_DECLS
-extern void *dlopen(const char *, int);
-extern int dlclose(void *);
-extern void *dlsym(void *, const char *);
-extern int dlctl(void *, int, void *);
-extern const char *dlerror(void);
-extern int dladdr(const void *, Dl_info *);
-__END_DECLS
-
/* Values for dlopen `mode'. */
#define RTLD_LAZY 1
#define RTLD_NOW 2
#define RTLD_GLOBAL 0x100
#define RTLD_LOCAL 0x000
-#define DL_LAZY RTLD_LAZY /* Compat */
#define RTLD_TRACE 0x200
/*
@@ -73,6 +50,18 @@ __END_DECLS
#define RTLD_DEFAULT ((void *) -2) /* Use default search algorithm. */
#define RTLD_SELF ((void *) -3) /* Search the caller itself. */
+#if __BSD_VISIBLE
+
+/*
+ * Structure filled in by dladdr().
+ */
+typedef struct dl_info {
+ const char *dli_fname; /* Pathname of shared object. */
+ void *dli_fbase; /* Base address of shared object. */
+ const char *dli_sname; /* Name of nearest symbol. */
+ void *dli_saddr; /* Address of nearest symbol. */
+} Dl_info;
+
/*
* dlctl() commands
*/
@@ -84,4 +73,25 @@ __END_DECLS
#define DL_SETTHREADLCK 2
#define DL_SETBINDLCK 3
+#define DL_LAZY RTLD_LAZY /* Compat */
+
+#endif /* __BSD_VISIBLE */
+
+
+/*
+ * User interface to the run-time linker.
+ */
+__BEGIN_DECLS
+void *dlopen(const char *, int);
+int dlclose(void *);
+void *dlsym(void *__restrict, const char *__restrict);
+const char *dlerror(void);
+
+#if __BSD_VISIBLE
+int dladdr(const void *, Dl_info *);
+int dlctl(void *, int, void *);
+#endif /* __BSD_VISIBLE */
+
+__END_DECLS
+
#endif /* _DLFCN_H_ */
diff --git a/include/glob.h b/include/glob.h
index f602e71edcb..106110cfabd 100644
--- a/include/glob.h
+++ b/include/glob.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: glob.h,v 1.11 2010/09/24 13:32:55 djm Exp $ */
+/* $OpenBSD: glob.h,v 1.12 2012/10/01 00:21:19 guenther Exp $ */
/* $NetBSD: glob.h,v 1.5 1994/10/26 00:55:56 cgd Exp $ */
/*
@@ -90,7 +90,8 @@ typedef struct {
#endif
__BEGIN_DECLS
-int glob(const char *, int, int (*)(const char *, int), glob_t *);
+int glob(const char *__restrict, int, int (*)(const char *, int),
+ glob_t *__restrict);
void globfree(glob_t *);
__END_DECLS
diff --git a/include/grp.h b/include/grp.h
index f4aa1539655..655e89e79c3 100644
--- a/include/grp.h
+++ b/include/grp.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: grp.h,v 1.9 2011/04/25 20:10:10 sthen Exp $ */
+/* $OpenBSD: grp.h,v 1.10 2012/10/01 00:21:19 guenther Exp $ */
/* $NetBSD: grp.h,v 1.7 1995/04/29 05:30:40 cgd Exp $ */
/*-
@@ -58,10 +58,12 @@ struct group {
__BEGIN_DECLS
struct group *getgrgid(gid_t);
struct group *getgrnam(const char *);
-#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 || __XPG_VISIBLE
+#if __BSD_VISIBLE || __XPG_VISIBLE
struct group *getgrent(void);
void setgrent(void);
void endgrent(void);
+#endif
+#if __BSD_VISIBLE || __POSIX_VISIBLE >= 199506 || __XPG_VISIBLE
int getgrgid_r(gid_t, struct group *, char *,
size_t, struct group **);
int getgrnam_r(const char *, struct group *, char *,
diff --git a/include/time.h b/include/time.h
index a53da7996b3..ead4ccf6650 100644
--- a/include/time.h
+++ b/include/time.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: time.h,v 1.22 2012/05/10 19:13:12 kettenis Exp $ */
+/* $OpenBSD: time.h,v 1.23 2012/10/01 00:21:20 guenther Exp $ */
/* $NetBSD: time.h,v 1.9 1994/10/26 00:56:35 cgd Exp $ */
/*
@@ -123,21 +123,23 @@ double difftime(time_t, time_t);
struct tm *gmtime(const time_t *);
struct tm *localtime(const time_t *);
time_t mktime(struct tm *);
-size_t strftime(char *, size_t, const char *, const struct tm *)
+size_t strftime(char *__restrict, size_t, const char *__restrict,
+ const struct tm *__restrict)
__attribute__ ((__bounded__(__string__,1,2)));
time_t time(time_t *);
#if __XPG_VISIBLE >= 400
-char *strptime(const char *, const char *, struct tm *);
+char *strptime(const char *__restrict, const char *__restrict,
+ struct tm *__restrict);
#endif
#if __POSIX_VISIBLE >= 199506
-char *asctime_r(const struct tm *, char *)
+char *asctime_r(const struct tm *__restrict, char *__restrict)
__attribute__ ((__bounded__(__minbytes__,2,26)));
char *ctime_r(const time_t *, char *)
__attribute__ ((__bounded__(__minbytes__,2,26)));
-struct tm *gmtime_r(const time_t *, struct tm *);
-struct tm *localtime_r(const time_t *, struct tm *);
+struct tm *gmtime_r(const time_t *__restrict, struct tm *__restrict);
+struct tm *localtime_r(const time_t *__restrict, struct tm *__restrict);
#endif
#if __POSIX_VISIBLE