From: Lionel Sambuc Date: Thu, 17 Jan 2013 23:06:11 +0000 (+0100) Subject: Fixing cross build i386 on minix X-Git-Tag: v3.2.1~78 X-Git-Url: http://zhaoyanbai.com/repos/man.dnssec-importkey.html?a=commitdiff_plain;h=96836647f83b60298d50ea928fceb41ae1779911;p=minix.git Fixing cross build i386 on minix --- diff --git a/lib/libc/db/hash/ndbmdatum.c b/lib/libc/db/hash/ndbmdatum.c index 2ae7a2790..561e28793 100644 --- a/lib/libc/db/hash/ndbmdatum.c +++ b/lib/libc/db/hash/ndbmdatum.c @@ -160,7 +160,7 @@ dbm_store(DBM *db, datum key, datum data, int flags) (u_int)((flags == DBM_INSERT) ? R_NOOVERWRITE : 0))); } -#ifdef __minix +#if defined(__minix) && defined(__weak_alias) __weak_alias(dbm_delete, __dbm_delete13) __weak_alias(dbm_fetch, __dbm_fetch13) __weak_alias(dbm_firstkey, __dbm_firstkey13) diff --git a/lib/libc/gen/alphasort.c b/lib/libc/gen/alphasort.c index 4ea5dba4e..e6f166b4c 100644 --- a/lib/libc/gen/alphasort.c +++ b/lib/libc/gen/alphasort.c @@ -58,6 +58,6 @@ alphasort(const void *d1, const void *d2) (*(const struct dirent *const *)d2)->d_name)); } -#ifdef __minix +#if defined(__minix) && defined(__weak_alias) __weak_alias(alphasort, __alphasort30) #endif diff --git a/lib/libc/gen/fts.c b/lib/libc/gen/fts.c index bcf005b1f..16af0d43b 100644 --- a/lib/libc/gen/fts.c +++ b/lib/libc/gen/fts.c @@ -1235,7 +1235,7 @@ bail: return ret; } -#ifdef __minix +#if defined(__minix) && defined(__weak_alias) __weak_alias(fts_children, __fts_children60) __weak_alias(fts_close, __fts_close60) __weak_alias(fts_open, __fts_open60) diff --git a/lib/libc/gen/getpwent.c b/lib/libc/gen/getpwent.c index 61020f75b..a3f912eca 100644 --- a/lib/libc/gen/getpwent.c +++ b/lib/libc/gen/getpwent.c @@ -2604,7 +2604,7 @@ setpwent(void) mutex_unlock(&_pwmutex); } -#ifdef __minix +#if defined(__minix) && defined(__weak_alias) __weak_alias(getpwent, __getpwent50) __weak_alias(getpwent_r, __getpwent_r50) __weak_alias(getpwnam, __getpwnam50) diff --git a/lib/libc/gen/glob.c b/lib/libc/gen/glob.c index 220ac7658..d4068dd5c 100644 --- a/lib/libc/gen/glob.c +++ b/lib/libc/gen/glob.c @@ -1169,7 +1169,7 @@ qprintf(const char *str, Char *s) } #endif -#ifdef __minix +#if defined(__minix) && defined(__weak_alias) __weak_alias(glob, __glob30) __weak_alias(globfree, __globfree30) #endif diff --git a/lib/libc/gen/minix/utime.c b/lib/libc/gen/minix/utime.c index df212b90d..ab91a0000 100644 --- a/lib/libc/gen/minix/utime.c +++ b/lib/libc/gen/minix/utime.c @@ -23,6 +23,6 @@ int utime(const char *name, const struct utimbuf *timp) return(_syscall(VFS_PROC_NR, UTIME, &m)); } -#ifdef __minix +#if defined(__minix) && defined(__weak_alias) __weak_alias(utime, __utime50) #endif diff --git a/lib/libc/gen/pwcache.c b/lib/libc/gen/pwcache.c index bda04a8e4..ffe840cab 100644 --- a/lib/libc/gen/pwcache.c +++ b/lib/libc/gen/pwcache.c @@ -642,6 +642,6 @@ main(int argc, char *argv[]) #endif /* TEST_PWCACHE */ #endif /* !HAVE_PWCACHE_USERDB */ -#ifdef __minix +#if defined(__minix) && defined(__weak_alias) __weak_alias(pwcache_userdb, __pwcache_userdb50) #endif diff --git a/lib/libc/gen/readdir.c b/lib/libc/gen/readdir.c index 59f5105ac..136d881db 100644 --- a/lib/libc/gen/readdir.c +++ b/lib/libc/gen/readdir.c @@ -146,7 +146,7 @@ readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result) return (0); } -#ifdef __minix +#if defined(__minix) && defined(__weak_alias) __weak_alias(readdir, __readdir30) __weak_alias(readdir_r, __readdir_r30) __weak_alias(readdir_unlocked, ___readdir_unlocked50) diff --git a/lib/libc/gen/scandir.c b/lib/libc/gen/scandir.c index 740928940..80964fef4 100644 --- a/lib/libc/gen/scandir.c +++ b/lib/libc/gen/scandir.c @@ -155,6 +155,6 @@ bad: return -1; } -#ifdef __minix +#if defined(__minix) && defined(__weak_alias) __weak_alias(scandir, __scandir30) #endif diff --git a/lib/libc/gen/sigsetops.c b/lib/libc/gen/sigsetops.c index 5dfa50a85..9e8b6c0b4 100644 --- a/lib/libc/gen/sigsetops.c +++ b/lib/libc/gen/sigsetops.c @@ -45,7 +45,7 @@ __RCSID("$NetBSD: sigsetops.c,v 1.16 2010/07/31 00:04:43 joerg Exp $"); #include #include -#ifdef __minix +#if defined(__minix) && defined(__weak_alias) __weak_alias(sigaddset, __sigaddset14) __weak_alias(sigdelset, __sigdelset14) __weak_alias(sigemptyset, __sigemptyset14) diff --git a/lib/libc/gen/time.c b/lib/libc/gen/time.c index da0db1034..0e85066b6 100644 --- a/lib/libc/gen/time.c +++ b/lib/libc/gen/time.c @@ -56,6 +56,6 @@ time(time_t *t) return (time_t)tt.tv_sec; } -#ifdef __minix +#if defined(__minix) && defined(__weak_alias) __weak_alias(time, __time50) #endif diff --git a/lib/libc/gen/utmp.c b/lib/libc/gen/utmp.c index 2b3698201..ae722fc28 100644 --- a/lib/libc/gen/utmp.c +++ b/lib/libc/gen/utmp.c @@ -105,6 +105,6 @@ utmpname(const char *fname) return 1; } -#ifdef __minix +#if defined(__minix) && defined(__weak_alias) __weak_alias(getutent, __getutent50) #endif diff --git a/lib/libc/gen/utmpx.c b/lib/libc/gen/utmpx.c index 43fd1f08b..deab17dec 100644 --- a/lib/libc/gen/utmpx.c +++ b/lib/libc/gen/utmpx.c @@ -518,7 +518,7 @@ updlastlogx(const char *fname, uid_t uid, struct lastlogx *ll) return error; } -#ifdef __minix +#if defined(__minix) && defined(__weak_alias) __weak_alias(getlastlogx, __getlastlogx50) __weak_alias(getutmp, __getutmp50) __weak_alias(getutmpx, __getutmpx50) diff --git a/lib/libc/locale/setlocale.c b/lib/libc/locale/setlocale.c index 469a1c063..6b7ab52d7 100644 --- a/lib/libc/locale/setlocale.c +++ b/lib/libc/locale/setlocale.c @@ -109,6 +109,6 @@ setlocale(int category, const char *locale) return __setlocale(category, locale); } -#ifdef __minix +#if defined(__minix) && defined(__weak_alias) __weak_alias(setlocale, __setlocale50) #endif diff --git a/lib/libc/stdlib/unsetenv.c b/lib/libc/stdlib/unsetenv.c index eb1c21ff9..21086d816 100644 --- a/lib/libc/stdlib/unsetenv.c +++ b/lib/libc/stdlib/unsetenv.c @@ -105,6 +105,6 @@ unsetenv(const char *name) return 0; } -#ifdef __minix +#if defined(__minix) && defined(__weak_alias) __weak_alias(unsetenv, __unsetenv13) #endif diff --git a/lib/libc/sys-minix/getdents.c b/lib/libc/sys-minix/getdents.c index 58a696b2e..ef17e5440 100644 --- a/lib/libc/sys-minix/getdents.c +++ b/lib/libc/sys-minix/getdents.c @@ -14,6 +14,6 @@ ssize_t getdents(int fd, char *buffer, size_t nbytes) return _syscall(VFS_PROC_NR, GETDENTS, &m); } -#ifdef __minix +#if defined(__minix) && defined(__weak_alias) __weak_alias(getdents, __getdents30) #endif diff --git a/lib/libc/sys-minix/getitimer.c b/lib/libc/sys-minix/getitimer.c index 7407ce702..e6f382f0e 100644 --- a/lib/libc/sys-minix/getitimer.c +++ b/lib/libc/sys-minix/getitimer.c @@ -19,6 +19,6 @@ int getitimer(int which, struct itimerval *value) return _syscall(PM_PROC_NR, ITIMER, &m); } -#ifdef __minix +#if defined(__minix) && defined(__weak_alias) __weak_alias(getitimer, __getitimer50) #endif diff --git a/lib/libc/sys-minix/mknod.c b/lib/libc/sys-minix/mknod.c index 885e3a245..606e0205c 100644 --- a/lib/libc/sys-minix/mknod.c +++ b/lib/libc/sys-minix/mknod.c @@ -19,6 +19,6 @@ int mknod(const char *name, mode_t mode, dev_t dev) return(_syscall(VFS_PROC_NR, MKNOD, &m)); } -#ifdef __minix +#if defined(__minix) && defined(__weak_alias) __weak_alias(mknod, __mknod50) #endif diff --git a/lib/libc/sys-minix/nanosleep.c b/lib/libc/sys-minix/nanosleep.c index 5e1f4e3d5..5478d9a3b 100644 --- a/lib/libc/sys-minix/nanosleep.c +++ b/lib/libc/sys-minix/nanosleep.c @@ -91,6 +91,6 @@ int nanosleep(const struct timespec *rqtp, struct timespec *rmtp) } -#ifdef __minix +#if defined(__minix) && defined(__weak_alias) __weak_alias(nanosleep, __nanosleep50) #endif diff --git a/lib/libc/sys-minix/select.c b/lib/libc/sys-minix/select.c index c54333992..a703d7cf1 100644 --- a/lib/libc/sys-minix/select.c +++ b/lib/libc/sys-minix/select.c @@ -21,6 +21,6 @@ int select(int nfds, } -#ifdef __minix +#if defined(__minix) && defined(__weak_alias) __weak_alias(select, __select50) #endif diff --git a/lib/libc/sys-minix/setitimer.c b/lib/libc/sys-minix/setitimer.c index f85a2292e..1552b9ddc 100644 --- a/lib/libc/sys-minix/setitimer.c +++ b/lib/libc/sys-minix/setitimer.c @@ -25,6 +25,6 @@ int setitimer(int which, const struct itimerval *__restrict value, return _syscall(PM_PROC_NR, ITIMER, &m); } -#ifdef __minix +#if defined(__minix) && defined(__weak_alias) __weak_alias(setitimer, __setitimer50) #endif diff --git a/lib/libc/sys-minix/settimeofday.c b/lib/libc/sys-minix/settimeofday.c index 602c952c5..ae0e6b578 100644 --- a/lib/libc/sys-minix/settimeofday.c +++ b/lib/libc/sys-minix/settimeofday.c @@ -14,6 +14,6 @@ int settimeofday(const struct timeval *tp, const void *tzp) return stime(&sec); } -#ifdef __minix +#if defined(__minix) && defined(__weak_alias) __weak_alias(settimeofday, __settimeofday50) #endif diff --git a/lib/libc/sys-minix/shmctl.c b/lib/libc/sys-minix/shmctl.c index 656d19236..ee6265e9d 100644 --- a/lib/libc/sys-minix/shmctl.c +++ b/lib/libc/sys-minix/shmctl.c @@ -41,6 +41,6 @@ int shmctl(int shmid, int cmd, struct shmid_ds *buf) return r; } -#ifdef __minix +#if defined(__minix) && defined(__weak_alias) __weak_alias(shmctl, __shmctl50) #endif diff --git a/lib/libc/sys-minix/sigaction.c b/lib/libc/sys-minix/sigaction.c index 50501465a..2bb96c818 100644 --- a/lib/libc/sys-minix/sigaction.c +++ b/lib/libc/sys-minix/sigaction.c @@ -19,6 +19,6 @@ int sigaction(int sig, const struct sigaction *act, struct sigaction *oact) return(_syscall(PM_PROC_NR, SIGACTION, &m)); } -#ifdef __minix +#if defined(__minix) && defined(__weak_alias) __weak_alias(sigaction, __sigaction14) #endif diff --git a/lib/libc/sys-minix/sigpending.c b/lib/libc/sys-minix/sigpending.c index f701cfce7..e52f5edc5 100644 --- a/lib/libc/sys-minix/sigpending.c +++ b/lib/libc/sys-minix/sigpending.c @@ -14,6 +14,6 @@ sigset_t *set; return(m.m_type); } -#ifdef __minix +#if defined(__minix) && defined(__weak_alias) __weak_alias(sigpending, __sigpending14) #endif diff --git a/lib/libc/sys-minix/sigprocmask.c b/lib/libc/sys-minix/sigprocmask.c index f4462a948..4770e8074 100644 --- a/lib/libc/sys-minix/sigprocmask.c +++ b/lib/libc/sys-minix/sigprocmask.c @@ -23,6 +23,6 @@ sigset_t *oset; return(m.m_type); } -#ifdef __minix +#if defined(__minix) && defined(__weak_alias) __weak_alias(sigprocmask, __sigprocmask14) #endif diff --git a/lib/libc/sys-minix/sigsuspend.c b/lib/libc/sys-minix/sigsuspend.c index c7948ca26..64a402334 100644 --- a/lib/libc/sys-minix/sigsuspend.c +++ b/lib/libc/sys-minix/sigsuspend.c @@ -13,6 +13,6 @@ const sigset_t *set; return(_syscall(PM_PROC_NR, SIGSUSPEND, &m)); } -#ifdef __minix +#if defined(__minix) && defined(__weak_alias) __weak_alias(sigsuspend, __sigsuspend14) #endif diff --git a/lib/libc/time/difftime.c b/lib/libc/time/difftime.c index 2f55eb2f7..0849bc856 100644 --- a/lib/libc/time/difftime.c +++ b/lib/libc/time/difftime.c @@ -71,6 +71,6 @@ difftime(const time_t time1, const time_t time0) (unsigned long) (-(time1 + 1)) + 1); } -#ifdef __minix +#if defined(__minix) && defined(__weak_alias) __weak_alias(difftime, __difftime50) #endif diff --git a/lib/libc/time/localtime.c b/lib/libc/time/localtime.c index ba092bbd7..ec46c2171 100644 --- a/lib/libc/time/localtime.c +++ b/lib/libc/time/localtime.c @@ -2261,7 +2261,7 @@ posix2time(time_t t) #endif /* defined STD_INSPIRED */ -#ifdef __minix +#if defined(__minix) && defined(__weak_alias) __weak_alias(gmtime, __gmtime50) __weak_alias(gmtime_r, __gmtime_r50) __weak_alias(offtime, __offtime50) diff --git a/lib/libutil/login.c b/lib/libutil/login.c index 38d0ca9ac..c3b61cca0 100644 --- a/lib/libutil/login.c +++ b/lib/libutil/login.c @@ -69,4 +69,6 @@ login(const struct utmp *ut) } } +#if defined(__minix) && defined(__weak_alias) __weak_alias(login, __login50) +#endif diff --git a/lib/libutil/login_cap.c b/lib/libutil/login_cap.c index 27d07fe50..593888e40 100644 --- a/lib/libutil/login_cap.c +++ b/lib/libutil/login_cap.c @@ -995,5 +995,7 @@ multiply(u_quad_t n1, u_quad_t n2) return (m); } +#if defined(__minix) && defined(__weak_alias) __weak_alias(login_getpwclass, __login_getpwclass50) __weak_alias(setusercontext, __setusercontext50) +#endif diff --git a/lib/libutil/loginx.c b/lib/libutil/loginx.c index ee2c6b3ae..7a07b0267 100644 --- a/lib/libutil/loginx.c +++ b/lib/libutil/loginx.c @@ -53,4 +53,6 @@ loginx(const struct utmpx *ut) (void)updwtmpx(_PATH_WTMPX, ut); } +#if defined(__minix) && defined(__weak_alias) __weak_alias(loginx, __loginx50) +#endif diff --git a/lib/libutil/passwd.c b/lib/libutil/passwd.c index 5c2055596..5c0cbca5b 100644 --- a/lib/libutil/passwd.c +++ b/lib/libutil/passwd.c @@ -662,6 +662,8 @@ pw_getpwconf(char *data, size_t max, const struct passwd *pwd, } } +#if defined(__minix) && defined(__weak_alias) __weak_alias(pw_copy, __pw_copy50) __weak_alias(pw_copyx, __pw_copyx50) __weak_alias(pw_getpwconf, __pw_getpwconf50) +#endif diff --git a/usr.sbin/mtree/compare.c b/usr.sbin/mtree/compare.c index 6090967f6..7686f4242 100644 --- a/usr.sbin/mtree/compare.c +++ b/usr.sbin/mtree/compare.c @@ -151,11 +151,10 @@ utimes(const char *path, const struct timeval times[2]) int compare(NODE *s, FTSENT *p) { -#if defined(__minix) u_int32_t len, val; -#else - u_int32_t len, val, flags; -#endif /* defined(__minix) */ +#if HAVE_STRUCT_STAT_ST_FLAGS + u_int32_t flags; +#endif int fd, label; const char *cp, *tab; #if !defined(NO_MD5) || !defined(NO_RMD160) || !defined(NO_SHA1) || !defined(NO_SHA2) diff --git a/usr.sbin/mtree/create.c b/usr.sbin/mtree/create.c index 264aa8b17..8f0e0db12 100644 --- a/usr.sbin/mtree/create.c +++ b/usr.sbin/mtree/create.c @@ -317,9 +317,9 @@ statd(FTS *t, FTSENT *parent, uid_t *puid, gid_t *pgid, mode_t *pmode, gid_t sgid; uid_t suid; mode_t smode; -#if !defined(__minix) +#if HAVE_STRUCT_STAT_ST_FLAGS u_long sflags = 0; -#endif /* !defined(__minix) */ +#endif const char *name = NULL; gid_t savegid; uid_t saveuid; diff --git a/usr.sbin/mtree/verify.c b/usr.sbin/mtree/verify.c index 4b7e83d82..11aa8dab1 100644 --- a/usr.sbin/mtree/verify.c +++ b/usr.sbin/mtree/verify.c @@ -168,9 +168,9 @@ miss(NODE *p, char *tail) int create; char *tp; const char *type; -#if !defined(__minix) +#if HAVE_STRUCT_STAT_ST_FLAGS u_int32_t flags; -#endif /* !defined(__minix) */ +#endif for (; p; p = p->next) { if (p->flags & F_OPT && !(p->flags & F_VISIT))