compat code reorg

This commit is contained in:
christos 2005-09-13 01:44:32 +00:00
parent 5b84b3983f
commit 66412e7240
13 changed files with 57 additions and 153 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: dirent.h,v 1.23 2005/08/19 02:05:59 christos Exp $ */
/* $NetBSD: dirent.h,v 1.24 2005/09/13 01:44:32 christos Exp $ */
/*-
* Copyright (c) 1989, 1993
@ -86,15 +86,7 @@ struct _dirdesc {
__BEGIN_DECLS
int closedir(DIR *);
void rewinddir(DIR *);
#ifdef __LIBC12_SOURCE__
DIR *opendir(const char *);
struct dirent12 *readdir(DIR *);
int readdir_r(DIR *, struct dirent12 * __restrict,
struct dirent12 ** __restrict);
struct dirent *__readdir30(DIR *);
int __readdir_r30(DIR *, struct dirent * __restrict,
struct dirent ** __restrict);
#else
#ifndef __LIBC12_SOURCE__
DIR *opendir(const char *) __RENAME(__opendir30);
DIR *__opendir30(const char *) __RENAME(__opendir30);
struct dirent *readdir(DIR *) __RENAME(__readdir30);
@ -107,17 +99,7 @@ long telldir(const DIR *);
#endif /* defined(_NETBSD_SOURCE) || defined(_XOPEN_SOURCE) */
#if defined(_NETBSD_SOURCE)
void __seekdir(DIR *, long);
#ifdef __LIBC12_SOURCE__
DIR *__opendir2(const char *, int);
DIR *__opendir230(const char *, int);
int scandir(const char *, struct dirent12 ***,
int (*)(const struct dirent12 *), int (*)(const void *, const void *));
int __scandir30(const char *, struct dirent ***,
int (*)(const struct dirent *), int (*)(const void *, const void *));
int getdents(int, char *, size_t);
int getdirentries(int, char *, int, long *);
int __getdents30(int, char *, size_t);
#else
#ifndef __LIBC12_SOURCE__
DIR *__opendir2(const char *, int) __RENAME(__opendir230);
int scandir(const char *, struct dirent ***,
int (*)(const struct dirent *), int (*)(const void *, const void *))

View File

@ -1,4 +1,4 @@
/* $NetBSD: errno.h,v 1.7 2005/02/03 04:39:32 perry Exp $ */
/* $NetBSD: errno.h,v 1.8 2005/09/13 01:44:32 christos Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1993
@ -50,9 +50,11 @@ int *__errno(void);
#endif
#if defined(_NETBSD_SOURCE)
#ifndef __LIBC12_SOURCE__
extern __const int sys_nerr __RENAME(__sys_nerr14);
extern __const char *__const *sys_errlist __RENAME(__sys_errlist14);
#endif
#endif
__END_DECLS
#endif /* !_ERRNO_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: fts.h,v 1.13 2005/08/19 02:05:59 christos Exp $ */
/* $NetBSD: fts.h,v 1.14 2005/09/13 01:44:32 christos Exp $ */
/*
* Copyright (c) 1989, 1993
@ -126,21 +126,13 @@ typedef struct _ftsent {
#include <sys/cdefs.h>
__BEGIN_DECLS
#ifdef __LIBC12_SOURCE__
FTSENT *fts_children(FTS *, int);
int fts_close(FTS *);
FTS *fts_open(char * const *, int,
int (*)(const FTSENT **, const FTSENT **));
FTSENT *fts_read(FTS *);
int fts_set(FTS *, FTSENT *, int);
#else
#ifndef __LIBC12_SOURCE__
FTSENT *fts_children(FTS *, int) __RENAME(__fts_children30);
int fts_close(FTS *) __RENAME(__fts_close30);
FTS *fts_open(char * const *, int,
int (*)(const FTSENT **, const FTSENT **))
__RENAME(__fts_open30);
int (*)(const FTSENT **, const FTSENT **)) __RENAME(__fts_open30);
FTSENT *fts_read(FTS *) __RENAME(__fts_read30);
int fts_set(FTS *, FTSENT *, int) __RENAME(__fts_set30);
int fts_set(FTS *, FTSENT *, int) __RENAME(__fts_set30);
#endif
__END_DECLS

View File

@ -1,4 +1,4 @@
/* $NetBSD: glob.h,v 1.19 2005/02/03 04:39:32 perry Exp $ */
/* $NetBSD: glob.h,v 1.20 2005/09/13 01:44:32 christos Exp $ */
/*
* Copyright (c) 1989, 1993
@ -42,6 +42,10 @@
#include <sys/types.h>
#include <sys/stat.h>
#ifndef __gl_stat_t
#define __gl_stat_t struct stat
#endif
typedef struct {
int gl_pathc; /* Count of total paths so far. */
int gl_matchc; /* Count of paths matching pattern. */
@ -59,13 +63,8 @@ typedef struct {
void (*gl_closedir)(void *);
struct dirent *(*gl_readdir)(void *);
void *(*gl_opendir)(const char *);
#ifdef __LIBC12_SOURCE__
int (*gl_lstat)(const char *, struct stat12 *);
int (*gl_stat)(const char *, struct stat12 *);
#else
int (*gl_lstat)(const char *, struct stat *);
int (*gl_stat)(const char *, struct stat *);
#endif
int (*gl_lstat)(const char *, __gl_stat_t *);
int (*gl_stat)(const char *, __gl_stat_t *);
} glob_t;
#define GLOB_APPEND 0x0001 /* Append to output from previous call. */
@ -94,15 +93,10 @@ typedef struct {
#endif
__BEGIN_DECLS
#ifdef __LIBC12_SOURCE__
#ifndef __LIBC12_SOURCE__
int glob(const char * __restrict, int,
int (*)(const char *, int), glob_t * __restrict);
void globfree(glob_t *);
#else
int glob(const char * __restrict, int,
int (*)(const char *, int), glob_t * __restrict)
__RENAME(__glob13);
void globfree(glob_t *) __RENAME(__globfree13);
int (*)(const char *, int), glob_t * __restrict) __RENAME(__glob13);
void globfree(glob_t *) __RENAME(__globfree13);
#endif
__END_DECLS

View File

@ -1,4 +1,4 @@
/* $NetBSD: ndbm.h,v 1.13 2004/04/28 00:10:52 kleink Exp $ */
/* $NetBSD: ndbm.h,v 1.14 2005/09/13 01:44:32 christos Exp $ */
/*-
* Copyright (c) 1990, 1993
@ -60,11 +60,7 @@
typedef struct {
void *dptr;
#if defined(__LIBC12_SOURCE__)
int dsize; /* XXX */
#else
size_t dsize; /* XPG4.2 */
#endif
} datum;
typedef DB DBM;
@ -80,13 +76,7 @@ int dbm_clearerr(DBM *);
#if defined(_NETBSD_SOURCE)
int dbm_dirfno(DBM *);
#endif
#if defined(__LIBC12_SOURCE__)
int dbm_delete(DBM *, datum);
datum dbm_fetch(DBM *, datum);
datum dbm_firstkey(DBM *);
datum dbm_nextkey(DBM *);
int dbm_store(DBM *, datum, datum, int);
#else
#ifndef __LIBC12_SOURCE__
int dbm_delete(DBM *, datum) __RENAME(__dbm_delete13);
datum dbm_fetch(DBM *, datum) __RENAME(__dbm_fetch13);
datum dbm_firstkey(DBM *) __RENAME(__dbm_firstkey13);

View File

@ -1,4 +1,4 @@
/* $NetBSD: regex.h,v 1.12 2005/02/03 04:39:32 perry Exp $ */
/* $NetBSD: regex.h,v 1.13 2005/09/13 01:44:32 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -78,11 +78,7 @@
#include <sys/types.h>
/* types */
#if 1 /* __LIBC12_SOURCE__ - should go away */
typedef off_t regoff_t;
#else
typedef size_t regoff_t;
#endif
typedef struct {
int re_magic;

View File

@ -1,4 +1,4 @@
/* $NetBSD: setjmp.h,v 1.22 2005/04/15 16:58:13 christos Exp $ */
/* $NetBSD: setjmp.h,v 1.23 2005/09/13 01:44:32 christos Exp $ */
/*-
* Copyright (c) 1990, 1993
@ -58,21 +58,15 @@ typedef long jmp_buf[_JBLEN] _JB_ATTRIBUTES;
#include <sys/cdefs.h>
__BEGIN_DECLS
#ifdef __LIBC12_SOURCE__
int __setjmp14(jmp_buf);
void __longjmp14(jmp_buf, int) __attribute__((__noreturn__));
int __sigsetjmp14(sigjmp_buf, int);
void __siglongjmp14(sigjmp_buf, int) __attribute__((__noreturn__));
#else /* !__LIBC12_SOURCE__ */
int setjmp(jmp_buf) __RENAME(__setjmp14);
void longjmp(jmp_buf, int) __RENAME(__longjmp14)
#ifndef __LIBC12_SOURCE__
int setjmp(jmp_buf) __RENAME(__setjmp14);
void longjmp(jmp_buf, int) __RENAME(__longjmp14)
__attribute__((__noreturn__));
#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \
defined(_NETBSD_SOURCE)
int sigsetjmp(sigjmp_buf, int) __RENAME(__sigsetjmp14);
void siglongjmp(sigjmp_buf, int) __RENAME(__siglongjmp14)
int sigsetjmp(sigjmp_buf, int) __RENAME(__sigsetjmp14);
void siglongjmp(sigjmp_buf, int) __RENAME(__siglongjmp14)
__attribute__((__noreturn__));
#endif /* not ANSI */
#endif /* __LIBC12_SOURCE__ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: signal.h,v 1.43 2005/03/22 20:25:31 kleink Exp $ */
/* $NetBSD: signal.h,v 1.44 2005/09/13 01:44:32 christos Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -72,32 +72,9 @@ int __libc_thr_sigsetmask(int, const sigset_t *, sigset_t *);
#endif /* __LIBPTHREAD_SOURCE__ */
#endif
#ifdef __LIBC12_SOURCE__
int sigaction(int, const struct sigaction13 * __restrict,
struct sigaction13 * __restrict);
int __sigaction14(int, const struct sigaction * __restrict,
struct sigaction * __restrict);
int sigaddset(sigset13_t *, int);
int __sigaddset14(sigset_t *, int);
int sigdelset(sigset13_t *, int);
int __sigdelset14(sigset_t *, int);
int sigemptyset(sigset13_t *);
int __sigemptyset14(sigset_t *);
int sigfillset(sigset13_t *);
int __sigfillset14(sigset_t *);
int sigismember(const sigset13_t *, int);
int __sigismember14(const sigset_t *, int);
int sigpending(sigset13_t *);
int __sigpending14(sigset_t *);
int sigprocmask(int, const sigset13_t * __restrict,
sigset13_t * __restrict);
int __sigprocmask14(int, const sigset_t * __restrict,
sigset_t * __restrict);
int sigsuspend(const sigset13_t *);
int __sigsuspend14(const sigset_t *);
#else /* !__LIBC12_SOURCE__ */
#ifndef __LIBC12_SOURCE__
int sigaction(int, const struct sigaction * __restrict,
struct sigaction * __restrict) __RENAME(__sigaction14);
struct sigaction * __restrict) __RENAME(__sigaction14);
int sigaddset(sigset_t *, int) __RENAME(__sigaddset14);
int sigdelset(sigset_t *, int) __RENAME(__sigdelset14);
int sigemptyset(sigset_t *) __RENAME(__sigemptyset14);
@ -105,15 +82,18 @@ int sigfillset(sigset_t *) __RENAME(__sigfillset14);
int sigismember(const sigset_t *, int) __RENAME(__sigismember14);
int sigpending(sigset_t *) __RENAME(__sigpending14);
int sigprocmask(int, const sigset_t * __restrict, sigset_t * __restrict)
__RENAME(__sigprocmask14);
__RENAME(__sigprocmask14);
int sigsuspend(const sigset_t *) __RENAME(__sigsuspend14);
#if defined(__GNUC__) && defined(__STDC__)
#if (defined(__GNUC__) && defined(__STDC__)) || defined(_SIGINLINE)
#ifndef errno
int *__errno(void);
#define errno (*__errno())
#endif
extern __inline int
#ifndef _SIGINLINE
#define _SIGINLINE extern inline
#endif
_SIGINLINE int
sigaddset(sigset_t *set, int signo)
{
if (signo <= 0 || signo >= _NSIG) {
@ -124,7 +104,7 @@ sigaddset(sigset_t *set, int signo)
return (0);
}
extern __inline int
_SIGINLINE int
sigdelset(sigset_t *set, int signo)
{
if (signo <= 0 || signo >= _NSIG) {
@ -135,7 +115,7 @@ sigdelset(sigset_t *set, int signo)
return (0);
}
extern __inline int
_SIGINLINE int
sigismember(const sigset_t *set, int signo)
{
if (signo <= 0 || signo >= _NSIG) {
@ -145,20 +125,20 @@ sigismember(const sigset_t *set, int signo)
return (__sigismember(set, signo));
}
extern __inline int
_SIGINLINE int
sigemptyset(sigset_t *set)
{
__sigemptyset(set);
return (0);
}
extern __inline int
_SIGINLINE int
sigfillset(sigset_t *set)
{
__sigfillset(set);
return (0);
}
#endif /* __GNUC__ && __STDC__ */
#endif /* (__GNUC__ && __STDC__) || _LIBC */
#endif /* !__LIBC12_SOURCE__ */
/*
@ -169,13 +149,9 @@ sigfillset(sigset_t *set)
int killpg(pid_t, int);
int siginterrupt(int, int);
int sigstack(const struct sigstack *, struct sigstack *);
#ifdef __LIBC12_SOURCE__
int sigaltstack(const struct sigaltstack13 * __restrict,
struct sigaltstack13 * __restrict);
int __sigaltstack14(const stack_t * __restrict, stack_t * __restrict);
#else
#ifndef __LIBC12_SOURCE__
int sigaltstack(const stack_t * __restrict, stack_t * __restrict)
__RENAME(__sigaltstack14);
__RENAME(__sigaltstack14);
#endif
int sighold(int);
int sigignore(int);
@ -209,7 +185,6 @@ void psignal(unsigned int, const char *);
#endif /* __PSIGNAL_DECLARED */
int sigblock(int);
int sigsetmask(int);
int sigvec(int, struct sigvec *, struct sigvec *);
#endif /* _NETBSD_SOURCE */
#endif /* _POSIX_C_SOURCE || _XOPEN_SOURCE || _NETBSD_SOURCE */

View File

@ -1,4 +1,4 @@
/* $NetBSD: stdlib.h,v 1.70 2005/06/11 22:58:42 christos Exp $ */
/* $NetBSD: stdlib.h,v 1.71 2005/09/13 01:44:32 christos Exp $ */
/*-
* Copyright (c) 1990, 1993
@ -222,10 +222,7 @@ unsigned long long int
#if (_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE - 0) >= 600 || \
defined(_NETBSD_SOURCE)
int setenv(const char *, const char *, int);
#ifdef __LIBC12_SOURCE__
void unsetenv(const char *);
int __unsetenv13(const char *);
#else
#ifndef __LIBC12_SOURCE__
int unsetenv(const char *) __RENAME(__unsetenv13);
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: time.h,v 1.34 2005/02/03 04:39:32 perry Exp $ */
/* $NetBSD: time.h,v 1.35 2005/09/13 01:44:32 christos Exp $ */
/*
* Copyright (c) 1989, 1993
@ -100,11 +100,7 @@ time_t time(time_t *);
#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \
defined(_NETBSD_SOURCE)
#ifdef __LIBC12_SOURCE__
#define CLK_TCK 100
#else
#ifndef __LIBC12_SOURCE__
/*
* CLK_TCK uses libc's internal __sysconf() to retrieve the machine's
* HZ. The value of _SC_CLK_TCK is 39 -- we hard code it so we do not
@ -112,7 +108,7 @@ time_t time(time_t *);
*/
long __sysconf(int);
#define CLK_TCK (__sysconf(39))
#endif
#endif
extern __aconst char *tzname[2];
@ -162,14 +158,10 @@ time_t posix2time(time_t);
time_t timegm(struct tm *);
time_t timeoff(struct tm *, long);
time_t timelocal(struct tm *);
#ifdef __LIBC12_SOURCE__
char *timezone(int, int);
#endif
void tzsetwall(void);
struct tm *offtime(const time_t *, long);
#endif /* _NETBSD_SOURCE */
#endif /* !_ANSI_SOURCE */
__END_DECLS
#endif /* !_TIME_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: unistd.h,v 1.104 2005/06/11 22:54:43 christos Exp $ */
/* $NetBSD: unistd.h,v 1.105 2005/09/13 01:44:32 christos Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@ -269,10 +269,7 @@ int symlink(const char *, const char *);
void sync(void);
useconds_t ualarm(useconds_t, useconds_t);
int usleep(useconds_t);
#ifdef __LIBC12_SOURCE__
pid_t vfork(void);
pid_t __vfork14(void);
#else
#ifndef __LIBC12_SOURCE__
pid_t vfork(void) __RENAME(__vfork14);
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: utmpx.h,v 1.12 2005/02/03 04:39:32 perry Exp $ */
/* $NetBSD: utmpx.h,v 1.13 2005/09/13 01:44:32 christos Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -122,13 +122,9 @@ struct utmpx *pututxline(const struct utmpx *);
#if defined(_NETBSD_SOURCE)
int updwtmpx(const char *, const struct utmpx *);
int lastlogxname(const char *);
#ifdef __LIBC12_SOURCE__
struct lastlogx *getlastlogx(uid_t, struct lastlogx *);
struct lastlogx *__getlastlogx13(const char *, uid_t, struct lastlogx *);
#else
#ifndef __LIBC12_SOURCE__
struct lastlogx *getlastlogx(const char *, uid_t, struct lastlogx *)
__RENAME(__getlastlogx13);
__RENAME(__getlastlogx13);
#endif
int updlastlogx(const char *, uid_t, struct lastlogx *);
struct utmp;

View File

@ -1,4 +1,4 @@
/* $NetBSD: vis.h,v 1.15 2005/02/03 04:39:32 perry Exp $ */
/* $NetBSD: vis.h,v 1.16 2005/09/13 01:44:32 christos Exp $ */
/*-
* Copyright (c) 1990, 1993
@ -83,10 +83,7 @@ int strvisx(char *, const char *, size_t, int);
int strsvisx(char *, const char *, size_t, int, const char *);
int strunvis(char *, const char *);
int strunvisx(char *, const char *, int);
#ifdef __LIBC12_SOURCE__
int unvis(char *, int, int *, int);
int __unvis13(char *, int, int *, int);
#else
#ifndef __LIBC12_SOURCE__
int unvis(char *, int, int *, int) __RENAME(__unvis13);
#endif
__END_DECLS