Clean up NetBSD libc Minix port.

This patch add the proper .if/.else/.endif to the Makefiles, add places I forgot #ifdef __minix and remove newlines.
This commit is contained in:
Gianluca Guida 2011-02-15 16:31:16 +00:00
parent ad4dda469f
commit 3c9575aadc
34 changed files with 2294 additions and 59 deletions

View file

@ -17,7 +17,9 @@
# The Hesiod functions are always in libc. To choose that getpwent() and friends
# actually call the Hesiod functions, put -DHESIOD on the CPPFLAGS line below.
.if defined(__MINIX)
.include "minix-config.inc"
.endif
.include "Makefile.inc"
LIB= c
@ -42,17 +44,21 @@ assym.h: ${ARCHDIR}/genassym.cf
mv -f assym.h.tmp assym.h
.endif
.if !defined(__MINIX)
# The following controls how to build compatibility code for old NetBSD
# binaries. If BUILDCOLD is yes, then we build a separate library; otherwise
# we include the code in libc.
#BUILDCOLD?= no
#.if "${BUILDCOLD}" == "yes"
#SUBDIR=compat
#.include <bsd.subdir.mk>
#.else
#COMPATDIR=${.CURDIR}/compat
#.include "${.CURDIR}/compat/Makefile.inc"
#.endif
BUILDCOLD?= no
.if "${BUILDCOLD}" == "yes"
SUBDIR=compat
.include <bsd.subdir.mk>
.else
COMPATDIR=${.CURDIR}/compat
.include "${.CURDIR}/compat/Makefile.inc"
.endif
.else
BUILDCOLD= no
.endif
.include "${.CURDIR}/../../common/lib/libc/Makefile.inc"
.include "${.CURDIR}/atomic/Makefile.inc"
@ -62,11 +68,16 @@ assym.h: ${ARCHDIR}/genassym.cf
.include "${.CURDIR}/citrus/Makefile.inc"
.endif
.include "${.CURDIR}/compat-43/Makefile.inc"
#.include "${.CURDIR}/dlfcn/Makefile.inc"
.ifndef(__MINIX)
.include "${.CURDIR}/dlfcn/Makefile.inc"
.endif
.include "${.CURDIR}/gdtoa/Makefile.inc"
.include "${.CURDIR}/gen/Makefile.inc"
.if defined(__MINIX)
# gmon needs profil()
#.include "${.CURDIR}/gmon/Makefile.inc"
.else
.include "${.CURDIR}/gmon/Makefile.inc"
.endif
.include "${.CURDIR}/hash/Makefile.inc"
.include "${.CURDIR}/iconv/Makefile.inc"
.include "${.CURDIR}/inet/Makefile.inc"
@ -86,8 +97,11 @@ assym.h: ${ARCHDIR}/genassym.cf
.include "${.CURDIR}/regex/Makefile.inc"
.endif
.include "${.CURDIR}/resolv/Makefile.inc"
# RPC needs pollts and a reserved port allocator.
#.include "${.CURDIR}/rpc/Makefile.inc"
.if defined(__MINIX)
# RPC needs pollts() and a reserved port allocator.
.else
.include "${.CURDIR}/rpc/Makefile.inc"
.endif
.include "${.CURDIR}/ssp/Makefile.inc"
.include "${.CURDIR}/stdio/Makefile.inc"
.include "${.CURDIR}/stdlib/Makefile.inc"
@ -95,7 +109,11 @@ assym.h: ${ARCHDIR}/genassym.cf
.include "${.CURDIR}/termios/Makefile.inc"
.include "${.CURDIR}/thread-stub/Makefile.inc"
.include "${.CURDIR}/time/Makefile.inc"
.if defined(__MINIX)
.include "${.CURDIR}/sys-minix/Makefile.inc"
.else
.include "${.CURDIR}/sys/Makefile.inc"
.endif
.include "${.CURDIR}/uuid/Makefile.inc"
.if (${MKYP} != "no")
.include "${.CURDIR}/yp/Makefile.inc"

View file

@ -19,17 +19,22 @@
USE_FORT?= yes
USE_SHLIBDIR= no
.if defined(__MINIX)
USE_SHLIBDIR= no
.else
USE_SHLIBDIR= yes
.endif
CITRUS?= yes
USE_LIBTRE= no
NETBSDSRCDIR= ${MINIXSRCDIR}
.include <bsd.own.mk>
WARNS=4
CPPFLAGS+= -D_LIBC -DLIBC_SCCS -DSYSLIBC_SCCS #-D_REENTRANT
.if defined(__MINIX)
CPPFLAGS+= -D_LIBC -DLIBC_SCSS -DSYSLIBC_SCSS
.else
CPPFLAGS+= -D_LIBC -DLIBC_SCCS -DSYSLIBC_SCCS -D_REENTRANT
.endif
.if (${USE_HESIOD} != "no")
CPPFLAGS+= -DHESIOD

View file

@ -1,3 +1,5 @@
# $NetBSD: Makefile.inc,v 1.20 2006/06/17 18:04:23 uwe Exp $
#SRCS+= __sigaction14_sigtramp.c __sigtramp2.S
.if !defined(__MINIX)
SRCS+= __sigaction14_sigtramp.c __sigtramp2.S
.endif

View file

@ -7,13 +7,18 @@ SRCS+= alloca.S byte_swap_2.S byte_swap_4.S fabs.S \
SRCS+= setjmp.S _setjmp.S sigsetjmp.S
# Already defined in sys-minix /* __minix */
#SRCS+= resumecontext.S swapcontext.S
.if defined(__MINIX)
# Already defined in sys-minix
.else
SRCS+= resumecontext.S swapcontext.S
.endif
# objects built from C sources
#SRCS+= bswap64.c _lwp.c makecontext.c
# __minix
SRCS+= bswap64.c
.if defined(__MINIX)
SRCS+= bswap64.c
.else
SRCS+= bswap64.c _lwp.c makecontext.c
.endif
# Common ieee754 constants and functions
SRCS+= infinityf_ieee754.c infinity_ieee754.c

View file

@ -4,15 +4,20 @@
# compat-43 sources
.PATH: ${ARCHDIR}/compat-43 ${.CURDIR}/compat-43
# unsupported by Minix
.if defined(__MINIX)
# Unsupported by Minix
# gethostid.c sethostid.c setpgrp.c setrgid.c setruid.c sigcompat.c
SRCS+= creat.c getdtablesize.c \
killpg.c \
SRCS+= creat.c getdtablesize.c killpg.c
.else
SRCS+= creat.c getdtablesize.c gethostid.c \
killpg.c sethostid.c setpgrp.c \
setrgid.c setruid.c sigcompat.c
.if !defined(AUDIT)
SRCS+= getwd.c
.endif
.endif
# XXX this is to get <compat/sys/signal.h>
CPPFLAGS.sigcompat.c+= -I${NETBSDSRCDIR}/sys

View file

@ -2,8 +2,12 @@
# from: @(#)Makefile.inc 8.6 (Berkeley) 5/4/95
# gen sources
.PATH: ${.CURDIR}/gen/minix ${ARCHDIR}/gen ${.CURDIR}/gen
.if defined(__MINIX)
.PATH: ${.CURDIR}/gen/minix
.endif
.PATH: ${ARCHDIR}/gen ${.CURDIR}/gen
.if defined(__MINIX)
# Unsupported by Minix.
# closefrom.c confstr.c extattr.c getdevmajor.c getmntinfo.c \
# pthread_atfork.c setdomainname.c sethostname.c setproctitle.c \
@ -47,6 +51,36 @@ SRCS+= _errno.c alarm.c alphasort.c arc4random.c assert.c basename.c clock.c \
toupper_.c ualarm.c ulimit.c uname.c unvis.c usleep.c utime.c utmp.c \
utmpx.c valloc.c vis.c warn.c warnx.c \
vwarn.c vwarnx.c verr.c verrx.c wait.c waitpid.c wordexp.c
.else
SRCS+= _errno.c alarm.c alphasort.c arc4random.c assert.c basename.c clock.c \
closedir.c closefrom.c confstr.c ctermid.c ctype_.c daemon.c \
dehumanize_number.c devname.c dirname.c disklabel.c err.c errx.c \
errlist.c errno.c execl.c execle.c execlp.c execv.c execvp.c \
extattr.c fmtcheck.c fmtmsg.c fnmatch.c fstab.c ftok.c \
fts.c ftw.c getbsize.c getcap.c getcwd.c \
getdevmajor.c getdomainname.c getgrent.c \
getgrouplist.c getgroupmembership.c gethostname.c \
getloadavg.c getlogin.c getmntinfo.c \
getnetgrent.c getpagesize.c \
getpass.c getprogname.c getpwent.c getttyent.c \
getusershell.c glob.c humanize_number.c initdir.c initgroups.c \
isascii.c isatty.c isctype.c lockf.c nftw.c \
nice.c nlist.c nlist_aout.c \
nlist_coff.c nlist_ecoff.c nlist_elf32.c nlist_elf64.c opendir.c \
pause.c popen.c psignal.c pthread_atfork.c ptree.c pwcache.c \
pw_scan.c raise.c randomid.c rb.c readdir.c rewinddir.c \
scandir.c seekdir.c setdomainname.c \
sethostname.c setjmperr.c setmode.c setproctitle.c setprogname.c \
shquote.c shquotev.c sighold.c sigignore.c siginterrupt.c \
siglist.c signal.c signame.c sigrelse.c \
sigset.c sigsetops.c sleep.c \
stringlist.c sysconf.c sysctl.c sysctlbyname.c sysctlgetmibinfo.c \
sysctlnametomib.c syslog.c telldir.c time.c \
times.c toascii.c tolower_.c ttyname.c ttyslot.c \
toupper_.c ualarm.c ulimit.c uname.c unvis.c usleep.c utime.c utmp.c \
utmpx.c valloc.c vis.c wait.c wait3.c waitpid.c warn.c warnx.c \
vwarn.c vwarnx.c verr.c verrx.c wordexp.c
.endif
# indirect reference stubs, to be removed soon.
SRCS+= _err.c _errx.c \
@ -178,7 +212,12 @@ CPPFLAGS.isctype.c+= -I${LIBCDIR}/locale
CPPFLAGS.tolower_.c+= -I${LIBCDIR}/locale
CPPFLAGS.toupper_.c+= -I${LIBCDIR}/locale
errlist.c: errlist-minix.awk ${NETBSDSRCDIR}/nbsd_include/sys/errno.h
.if defined(__MINIX)
errlist.c: errlist-minix.awk ${MINIXSRCDIR}/nbsd_include/sys/errno.h
${TOOL_AWK} -f ${.ALLSRC} > ${.TARGET}
.else
errlist.c: errlist.awk ${NETBSDSRCDIR}/sys/sys/errno.h
${TOOL_AWK} -f ${.ALLSRC} > ${.TARGET}
.endif
CLEANFILES+= errlist.c

View file

@ -13,7 +13,9 @@ __RCSID("$NetBSD: _verr.c,v 1.10 2005/09/13 01:44:09 christos Exp $");
#if defined(__indr_reference)
__indr_reference(_verr, verr)
#else
#include <sys/ansi.h>
#ifdef __minix
#include <stdarg.h>
#endif
__dead void _verr(int, const char *, _BSD_VA_LIST_);

View file

@ -13,7 +13,9 @@ __RCSID("$NetBSD: _verrx.c,v 1.10 2005/09/13 01:44:09 christos Exp $");
#if defined(__indr_reference)
__indr_reference(_verrx, verrx)
#else
#include <sys/ansi.h>
#ifdef __minix
#include <stdarg.h>
#endif
__dead void _verrx(int, const char *, _BSD_VA_LIST_);

View file

@ -13,7 +13,9 @@ __RCSID("$NetBSD: _vwarn.c,v 1.10 2005/09/13 01:44:09 christos Exp $");
#if defined(__indr_reference)
__indr_reference(_vwarn, vwarn)
#else
#ifdef __minix
#include <stdarg.h>
#endif
void _vwarn(const char *, _BSD_VA_LIST_);

View file

@ -13,7 +13,9 @@ __RCSID("$NetBSD: _vwarnx.c,v 1.10 2005/09/13 01:44:09 christos Exp $");
#if defined(__indr_reference)
__indr_reference(_vwarnx, vwarnx)
#else
#ifdef __minix
#include <stdarg.h>
#endif
void _vwarnx(const char *, _BSD_VA_LIST_);

View file

@ -13,6 +13,7 @@ __RCSID("$NetBSD: _warn.c,v 1.10 2005/09/13 01:44:09 christos Exp $");
#if defined(__indr_reference)
__indr_reference(_warn, warn)
#else
#include <stdarg.h>
void _vwarn(const char *, _BSD_VA_LIST_);
@ -23,7 +24,11 @@ warn(const char *fmt, ...)
va_list ap;
va_start(ap, fmt);
#ifdef __minix
_vwarn(fmt, ap);
#else
_vwarn(eval, fmt, ap);
#endif
va_end(ap);
}
#endif

View file

@ -24,7 +24,11 @@ warnx(const char *fmt, ...)
va_list ap;
va_start(ap, fmt);
#ifdef __minix
_vwarnx(fmt, ap);
#else
_vwarnx(eval, fmt, ap);
#endif
va_end(ap);
}

View file

@ -814,6 +814,7 @@ _dns_getgrgid(void *nsrv, void *nscb, va_list ap)
#else
gid_t gid = va_arg(ap, gid_t);
#endif
int rv, rerror;
_DIAGASSERT(retval != NULL);
@ -1168,6 +1169,7 @@ _nis_getgrgid(void *nsrv, void *nscb, va_list ap)
#else
gid_t gid = va_arg(ap, gid_t);
#endif
int rv, rerror;
_DIAGASSERT(retval != NULL);
@ -1430,7 +1432,11 @@ __grscan_compat(int *retval, struct group *grp, char *buffer, size_t buflen,
crv = nsdispatch(NULL, compatgiddtab,
NSDB_GROUP_COMPAT, "getgrgid_r",
__nsdefaultnis,
#ifdef __minix
&cretval, (int)gid,
#else
&cretval, gid,
#endif
&cgrp, filebuf, sizeof(filebuf), &cgrpres);
}
if (crv != NS_SUCCESS) { /* not found */
@ -1632,7 +1638,11 @@ static int
_compat_getgrgid(void *nsrv, void *nscb, va_list ap)
{
struct group **retval = va_arg(ap, struct group **);
gid_t gid = va_arg(ap, int);
#ifdef __minix
gid_t gid = (gid_t)va_arg(ap, int);
#else
gid_t gid = va_arg(ap, gid_t);
#endif
int rv, rerror;
@ -1759,6 +1769,7 @@ getgrent(void)
NS_COMPAT_CB(_compat_getgrent, NULL)
NS_NULL_CB
};
mutex_lock(&__grmutex);
rv = nsdispatch(NULL, dtab, NSDB_GROUP, "getgrent", __nsdefaultcompat,
&retval);
@ -1810,7 +1821,11 @@ getgrgid(gid_t gid)
mutex_lock(&__grmutex);
rv = nsdispatch(NULL, dtab, NSDB_GROUP, "getgrgid", __nsdefaultcompat,
#ifdef __minix
&retval, (int)gid);
#else
&retval, gid);
#endif
mutex_unlock(&__grmutex);
return (rv == NS_SUCCESS) ? retval : NULL;
}
@ -1837,7 +1852,11 @@ getgrgid_r(gid_t gid, struct group *grp, char *buffer, size_t buflen,
retval = 0;
mutex_lock(&__grmutex);
rv = nsdispatch(NULL, dtab, NSDB_GROUP, "getgrgid_r", __nsdefaultcompat,
#ifdef __minix
&retval, (int)gid, grp, buffer, buflen, result);
#else
&retval, gid, grp, buffer, buflen, result);
#endif
mutex_unlock(&__grmutex);
switch (rv) {
case NS_SUCCESS:

View file

@ -321,8 +321,8 @@ _compat_ggm_search(void *cookie, struct group **groupres)
&rerror, cp->uname, (int)cp->agroup, cp->groups, cp->maxgrp, cp->groupc);
#else
&rerror, cp->uname, cp->agroup, cp->groups, cp->maxgrp, cp->groupc);
#endif
if (crv == NS_SUCCESS)
crv = NS_NOTFOUND; /* indicate "no more +: entries" */

View file

@ -1929,7 +1929,6 @@ _passwdcompat_pwscan(struct passwd *pw, char *buffer, size_t buflen,
NSDB_PASSWD_COMPAT, "getpwuid_r", __nsdefaultnis,
&crv, uid, pw, buffer, buflen, &cpw);
#endif
break;
default:
abort();

View file

@ -39,6 +39,7 @@
#define _GROUP_COMPAT /* "group" defaults to compat, so always provide it */
#ifndef __minix /* should be _REENTRANT */
/*
* mutex to serialize the public group(5) functions use of the
@ -46,6 +47,7 @@
*/
extern mutex_t __grmutex;
#endif
/*
* files methods
*/

View file

@ -34,8 +34,6 @@
__RCSID("$NetBSD: initdir.c,v 1.1 2010/09/26 02:26:59 yamt Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
#ifdef __minix

View file

@ -47,7 +47,6 @@ __RCSID("$NetBSD: readdir.c,v 1.25 2010/09/16 02:38:50 yamt Exp $");
#endif
#include "extern.h"
#include <sys/param.h>
#include <dirent.h>

View file

@ -82,6 +82,7 @@ ttyname_r(int fd, char *buf, size_t len)
if (len <= DEVSZ) {
return ERANGE;
}
#ifndef __minix
/* If it is a pty, deal with it quickly */
if (ioctl(fd, TIOCPTSNAME, &ptm) != -1) {
@ -91,7 +92,6 @@ ttyname_r(int fd, char *buf, size_t len)
return 0;
}
#endif
/* Must be a terminal. */
if (tcgetattr(fd, &ttyb) == -1)
return errno;

View file

@ -376,6 +376,7 @@ updwtmpx(const char *file, const struct utmpx *utx)
return -1;
}
int
utmpxname(const char *fname)
{
@ -500,7 +501,6 @@ updlastlogx(const char *fname, uid_t uid, struct lastlogx *ll)
if (flock(db->fd(db), LOCK_EX) < 0)
return -1;
#endif
key.data = &uid;
key.size = sizeof(uid);
data.data = ll;

View file

@ -398,6 +398,7 @@ _mcleanup(void)
if (p->state == GMON_PROF_ERROR)
warnx("%s: tos overflow", __func__);
#ifdef __minix
clockinfo.profhz = sysconf(_SC_CLK_TCK);
#else /* !__minix */

View file

@ -56,7 +56,11 @@ __writelockenv(void)
}
static __inline bool
#ifdef __minix
__unlockenv(void)
#else /* Bug-to-bug compatibility? */
__unlocklockenv(void)
#endif
{
return true;
}

View file

@ -4,7 +4,7 @@
* Copyright (c) 1997-2004 The NetBSD Foundation, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, ith or without
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright

View file

@ -3,6 +3,7 @@
# Makefile fragment shared across several parts that want to look
# inside libc's include tree.
.if defined(__MINIX)
.if defined(LIBC_MACHINE_ARCH) && \
exists(${MINIXSRCDIR}/lib/nbsd_libc/arch/${LIBC_MACHINE_ARCH}/SYS.h)
ARCHSUBDIR= ${LIBC_MACHINE_ARCH}
@ -17,3 +18,19 @@ ARCHSUBDIR= ${MACHINE_CPU}
.endif
ARCHDIR= ${MINIXSRCCDIR}/lib/nbsd_libc/arch/${ARCHSUBDIR}
.else
.if defined(LIBC_MACHINE_ARCH) && \
exists(${NETBSDSRCDIR}/lib/libc/arch/${LIBC_MACHINE_ARCH}/SYS.h)
ARCHSUBDIR= ${LIBC_MACHINE_ARCH}
.elif exists(${NETBSDSRCDIR}/lib/libc/arch/${MACHINE_ARCH}/SYS.h)
ARCHSUBDIR= ${MACHINE_ARCH}
.elif exists(${NETBSDSRCDIR}/lib/libc/arch/${MACHINE_CPU}/SYS.h)
ARCHSUBDIR= ${MACHINE_CPU}
.else
.BEGIN:
@echo no ARCHDIR for ${MACHINE_ARCH} nor ${MACHINE_CPU}
@false
.endif
ARCHDIR= ${NETBSDSRCDIR}/lib/libc/arch/${ARCHSUBDIR}
.endif

View file

@ -162,7 +162,6 @@ __setlocale(int category, const char *name)
return NULL;
}
char *
setlocale(int category, const char *locale)
{

View file

@ -7,9 +7,12 @@ CPPFLAGS+= -nostdinc -O -D__minix -D_POSIX_SOURCE -I${NETBSDINCLUDES} -D_NETBSD
AFLAGS+= -nostdinc -D__minix -I${NETBSDINCLUDES}
CITRUS=yes
USE_INET6=no
MKYP=no #requires RPC
USE_JEMALLOC=no
USE_FORT=no
USE_LIBTRE=no

File diff suppressed because it is too large Load diff

View file

@ -63,6 +63,7 @@ __guard_setup(void)
if (__stack_chk_guard[0] != 0)
return;
#ifndef __minix
mib[0] = CTL_KERN;
mib[1] = KERN_ARND;

View file

@ -2,8 +2,13 @@
# @(#)Makefile.inc 8.2 (Berkeley) 9/5/93
# net sources
.PATH: ${ARCHDIR}/net ${.CURDIR}/net/minix ${.CURDIR}/net
.if defined(__MINIX)
.PATH: ${.CURDIR}/net/minix
.endif
.PATH: ${ARCHDIR}/net ${.CURDIR}/net
.if defined(__MINIX)
# Not supported by minix: iso_addr.c link_addr.c sockatmark.c
SRCS+= __cmsg_alignbytes.c base64.c ethers.c gethnamaddr.c getifaddrs.c \
getnetnamadr.c getnetent.c getpeereid.c \
getprotobyname.c getprotobynumber.c getprotoent.c \
@ -11,11 +16,19 @@ SRCS+= __cmsg_alignbytes.c base64.c ethers.c gethnamaddr.c getifaddrs.c \
getservbyname.c getservbyport.c getservent.c \
getservbyname_r.c getservbyport_r.c getservent_r.c \
nsdispatch.c nslexer.l nsparser.y nsap_addr.c \
rcmd.c recv.c send.c sethostent.c
# Not supported by Minix:
# sockatmark.c
rcmd.c recv.c send.c sethostent.c
.else
SRCS+= __cmsg_alignbytes.c base64.c ethers.c gethnamaddr.c getifaddrs.c \
getnetnamadr.c getnetent.c getpeereid.c \
getprotobyname.c getprotobynumber.c getprotoent.c \
getprotobyname_r.c getprotobynumber_r.c getprotoent_r.c \
getservbyname.c getservbyport.c getservent.c \
getservbyname_r.c getservbyport_r.c getservent_r.c \
iso_addr.c linkaddr.c \
nsdispatch.c nslexer.l nsparser.y nsap_addr.c \
rcmd.c recv.c send.c sethostent.c \
sockatmark.c
.endif
.if (${MKHESIOD} != "no")
SRCS+= hesiod.c
@ -25,9 +38,9 @@ SRCS+= getaddrinfo.c getnameinfo.c
.if (${USE_INET6} != "no")
SRCS+= ip6opt.c rthdr.c vars6.c
.endif
# Not supported by minix
#SRCS+= if_indextoname.c if_nameindex.c if_nametoindex.c
# iso_addr.c linkaddr.c \
.if !defined(__MINIX)
SRCS+= if_indextoname.c if_nameindex.c if_nametoindex.c
.endif
LPREFIX=_nsyy
YPREFIX=_nsyy

View file

@ -500,6 +500,7 @@ ip6_sa2str(sa6, buf, bufsiz, flags)
}
#endif /* INET6 */
#ifndef __minix
/*
* getnameinfo_link():

View file

@ -48,7 +48,9 @@ __RCSID("$NetBSD: rcmd.c,v 1.65 2007/01/03 11:46:22 ws Exp $");
#include <sys/wait.h>
#include <netinet/in.h>
#ifndef __minix
#include <rpc/rpc.h>
#endif
#include <arpa/inet.h>
#include <netgroup.h>
@ -70,6 +72,10 @@ __RCSID("$NetBSD: rcmd.c,v 1.65 2007/01/03 11:46:22 ws Exp $");
#include "pathnames.h"
#ifdef __minix
#undef BSD4_4
#endif
int orcmd __P((char **, u_int, const char *, const char *, const char *,
int *));
int orcmd_af __P((char **, u_int, const char *, const char *, const char *,
@ -201,7 +207,6 @@ orcmd_af(ahost, rport, locuser, remuser, cmd, fd2p, af)
return (error);
}
/*ARGSUSED*/
static int
resrcmd(res, ahost, rport, locuser, remuser, cmd, fd2p)
@ -543,7 +548,7 @@ rresvport_af(alport, family)
sa = (struct sockaddr *)(void *)&ss;
switch (family) {
case AF_INET:
#if defined(BSD4_4) && !defined(__minix)
#ifdef BSD4_4
sa->sa_len =
#endif
salen = sizeof(struct sockaddr_in);
@ -551,7 +556,7 @@ rresvport_af(alport, family)
break;
#ifdef INET6
case AF_INET6:
#if defined(BSD4_4) && !defined(__minix)
#ifdef BSD4_4
sa->sa_len =
#endif
salen = sizeof(struct sockaddr_in6);
@ -654,7 +659,7 @@ iruserok(raddr, superuser, ruser, luser)
memset(&irsin, 0, sizeof(irsin));
irsin.sin_family = AF_INET;
#if defined(BSD4_4) && !defined(__minix)
#ifdef BSD4_4
irsin.sin_len = sizeof(struct sockaddr_in);
#endif
memcpy(&irsin.sin_addr, &raddr, sizeof(irsin.sin_addr));
@ -774,7 +779,7 @@ __ivaliduser(hostf, raddr, luser, ruser)
memset(&ivusin, 0, sizeof(ivusin));
ivusin.sin_family = AF_INET;
#if defined(BSD4_4) && !defined(__minix)
#ifdef BSD4_4
ivusin.sin_len = sizeof(struct sockaddr_in);
#endif
memcpy(&ivusin.sin_addr, &raddr, sizeof(ivusin.sin_addr));

View file

@ -469,7 +469,7 @@ __res_vinit(res_state statp, int preinit) {
*cp++ = n;
net = cp;
while (*cp && *cp != ';' &&
isascii(*cp) &&
isascii(*cp) &&
!isspace((unsigned char)*cp))
cp++;
n = *cp;
@ -603,7 +603,6 @@ out:
break;
}
}
(void)__res_vinit(statp, 0);
if (mtime)
*mtime = __res_conf_time;

View file

@ -4,6 +4,8 @@
# stdlib sources
.PATH: ${ARCHDIR}/stdlib ${.CURDIR}/stdlib
.if defined(__MINIX)
# pty.c not compiled
SRCS+= _env.c _rand48.c \
a64l.c abort.c atexit.c atof.c atoi.c atol.c atoll.c \
bsearch.c drand48.c exit.c \
@ -16,6 +18,20 @@ SRCS+= _env.c _rand48.c \
strtoimax.c strtol.c strtoll.c strtoq.c strtoul.c strtoull.c \
strtoumax.c strtouq.c system.c tdelete.c tfind.c tsearch.c twalk.c \
unsetenv.c strfmon.c
.else
SRCS+= _env.c _rand48.c \
a64l.c abort.c atexit.c atof.c atoi.c atol.c atoll.c \
bsearch.c drand48.c exit.c \
getenv.c getopt.c getopt_long.c getsubopt.c \
hcreate.c heapsort.c imaxdiv.c insque.c jrand48.c l64a.c lldiv.c \
lcong48.c lrand48.c lsearch.c merge.c mi_vector_hash.c mrand48.c \
nrand48.c putenv.c qabs.c qdiv.c qsort.c posix_openpt.c pty.c \
radixsort.c rand.c rand_r.c random.c remque.c \
seed48.c setenv.c srand48.c strsuftoll.c \
strtoimax.c strtol.c strtoll.c strtoq.c strtoul.c strtoull.c \
strtoumax.c strtouq.c system.c tdelete.c tfind.c tsearch.c twalk.c \
unsetenv.c strfmon.c
.endif
# These are often replaced by MD .S versions
SRCS+= abs.c labs.c llabs.c imaxabs.c

View file

@ -2,14 +2,20 @@
.PATH: ${.CURDIR}/termios
.if defined(__MINIX)
# Not supported by Minix: tcgetsid.c
SRCS+= cfgetispeed.c cfgetospeed.c cfmakeraw.c cfsetispeed.c cfsetospeed.c \
cfsetspeed.c tcdrain.c tcflow.c tcflush.c tcgetattr.c tcgetpgrp.c \
tcsendbreak.c tcsetattr.c tcsetpgrp.c
.else
SRCS+= cfgetispeed.c cfgetospeed.c cfmakeraw.c cfsetispeed.c cfsetospeed.c \
cfsetspeed.c tcdrain.c tcflow.c tcflush.c tcgetattr.c tcgetpgrp.c \
tcgetsid.c tcsendbreak.c tcsetattr.c tcsetpgrp.c
.endif
# Not supported by Minix
# tcgetsid.c
MAN+= tcgetpgrp.3 tcsendbreak.3 tcsetattr.3 tcsetpgrp.3
MAN+= tcgetpgrp.3 tcgetsid.3 tcsendbreak.3 tcsetattr.3 tcsetpgrp.3
MLINKS+=tcsendbreak.3 tcdrain.3 tcsendbreak.3 tcflow.3 \
tcsendbreak.3 tcflush.3