Browse Source

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@
OPENBSD_5_3
guenther 11 years ago
parent
commit
930b578553
4 changed files with 49 additions and 34 deletions
  1. +34
    -24
      src/include/dlfcn.h
  2. +3
    -2
      src/include/glob.h
  3. +4
    -2
      src/include/grp.h
  4. +8
    -6
      src/include/time.h

+ 34
- 24
src/include/dlfcn.h View File

@ -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_ */

+ 3
- 2
src/include/glob.h View File

@ -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


+ 4
- 2
src/include/grp.h View File

@ -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 *,


+ 8
- 6
src/include/time.h View File

@ -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


Loading…
Cancel
Save