MFhead @ r292005
This commit is contained in:
commit
dcd31244e8
@ -163,7 +163,7 @@ OSRELDATE= 0
|
||||
.endif
|
||||
|
||||
# Set VERSION for CTFMERGE to use via the default CTFFLAGS=-L VERSION.
|
||||
.if !defined(VERSION)
|
||||
.if !defined(VERSION) && !make(showconfig)
|
||||
REVISION!= ${MAKE} -C ${SRCDIR}/release -V REVISION
|
||||
BRANCH!= ${MAKE} -C ${SRCDIR}/release -V BRANCH
|
||||
SRCRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \
|
||||
@ -195,11 +195,14 @@ _TARGET_CPUTYPE=${TARGET_CPUTYPE}
|
||||
.else
|
||||
_TARGET_CPUTYPE=dummy
|
||||
.endif
|
||||
# Skip for showconfig as it is just wasted time and may invoke auto.obj.mk.
|
||||
.if !make(showconfig)
|
||||
_CPUTYPE!= MAKEFLAGS= CPUTYPE=${_TARGET_CPUTYPE} ${MAKE} \
|
||||
-f /dev/null -m ${.CURDIR}/share/mk -V CPUTYPE
|
||||
.if ${_CPUTYPE} != ${_TARGET_CPUTYPE}
|
||||
.error CPUTYPE global should be set with ?=.
|
||||
.endif
|
||||
.endif
|
||||
.if make(buildworld)
|
||||
BUILD_ARCH!= uname -p
|
||||
.if ${MACHINE_ARCH} != ${BUILD_ARCH}
|
||||
@ -666,7 +669,7 @@ everything:
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> stage 4.4: building everything"
|
||||
@echo "--------------------------------------------------------------"
|
||||
${_+_}cd ${.CURDIR}; _PARALLEL_SUBUDIR_OK=1 ${WMAKE} all
|
||||
${_+_}cd ${.CURDIR}; _PARALLEL_SUBDIR_OK=1 ${WMAKE} all
|
||||
.if defined(LIB32TMP)
|
||||
build32: .PHONY
|
||||
@echo
|
||||
@ -2008,14 +2011,14 @@ _prebuild_libs: ${_prebuild_libs:S/$/__L/}
|
||||
_generic_libs: ${_generic_libs:S/$/__L/}
|
||||
|
||||
# Enable SUBDIR_PARALLEL when not calling 'make all', unless called from
|
||||
# 'everything' with _PARALLEL_SUBUDIR_OK set. This is because it is unlikely
|
||||
# 'everything' with _PARALLEL_SUBDIR_OK set. This is because it is unlikely
|
||||
# that running 'make all' from the top-level, especially with a SUBDIR_OVERRIDE
|
||||
# or LOCAL_DIRS set, will have a reliable build if SUBDIRs are built in
|
||||
# parallel. This is safe for the world stage of buildworld though since it has
|
||||
# already built libraries in a proper order and installed includes into
|
||||
# WORLDTMP. Special handling is done for SUBDIR ordering for 'install*' to
|
||||
# avoid trashing a system if it crashes mid-install.
|
||||
.if !make(all) || defined(_PARALLEL_SUBUDIR_OK)
|
||||
.if !make(all) || defined(_PARALLEL_SUBDIR_OK)
|
||||
SUBDIR_PARALLEL=
|
||||
.endif
|
||||
|
||||
|
7
UPDATING
7
UPDATING
@ -31,6 +31,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11.x IS SLOW:
|
||||
disable the most expensive debugging functionality run
|
||||
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
|
||||
|
||||
20151207:
|
||||
Debug data files are now built by default with 'make buildworld' and
|
||||
installed with 'make installworld'. This facilitates debugging but
|
||||
requires more disk space both during the build and for the installed
|
||||
world. Debug files may be disabled by setting WITHOUT_DEBUG_FILES=yes
|
||||
in src.conf(5).
|
||||
|
||||
20151130:
|
||||
r291527 changed the internal interface between the nfsd.ko and
|
||||
nfscommon.ko modules. As such, they must both be upgraded to-gether.
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
SCRIPTS = freebsd-version
|
||||
MAN = freebsd-version.1
|
||||
CLEANFILES = freebsd-version.sh
|
||||
CLEANFILES = freebsd-version freebsd-version.sh
|
||||
NEWVERS = ${.CURDIR}/../../sys/conf/newvers.sh
|
||||
|
||||
freebsd-version.sh: ${.CURDIR}/freebsd-version.sh.in ${NEWVERS}
|
||||
|
@ -47,12 +47,14 @@ __FBSDID("$FreeBSD$");
|
||||
#include <fts.h>
|
||||
#include <langinfo.h>
|
||||
#include <libutil.h>
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <wchar.h>
|
||||
#ifdef COLORLS
|
||||
#include <ctype.h>
|
||||
#include <termcap.h>
|
||||
@ -105,6 +107,9 @@ static struct {
|
||||
} colors[C_NUMCOLORS];
|
||||
#endif
|
||||
|
||||
static size_t padding_for_month[12];
|
||||
static size_t month_max_size = 0;
|
||||
|
||||
void
|
||||
printscol(const DISPLAY *dp)
|
||||
{
|
||||
@ -138,6 +143,70 @@ printname(const char *field, const char *name)
|
||||
return rc;
|
||||
}
|
||||
|
||||
static const char *
|
||||
get_abmon(int mon)
|
||||
{
|
||||
|
||||
switch (mon) {
|
||||
case 0: return (nl_langinfo(ABMON_1));
|
||||
case 1: return (nl_langinfo(ABMON_2));
|
||||
case 2: return (nl_langinfo(ABMON_3));
|
||||
case 3: return (nl_langinfo(ABMON_4));
|
||||
case 4: return (nl_langinfo(ABMON_5));
|
||||
case 5: return (nl_langinfo(ABMON_6));
|
||||
case 6: return (nl_langinfo(ABMON_7));
|
||||
case 7: return (nl_langinfo(ABMON_8));
|
||||
case 8: return (nl_langinfo(ABMON_9));
|
||||
case 9: return (nl_langinfo(ABMON_10));
|
||||
case 10: return (nl_langinfo(ABMON_11));
|
||||
case 11: return (nl_langinfo(ABMON_12));
|
||||
}
|
||||
|
||||
/* should never happen */
|
||||
abort();
|
||||
}
|
||||
|
||||
static size_t
|
||||
mbswidth(const char *month)
|
||||
{
|
||||
wchar_t wc;
|
||||
size_t width, donelen, clen, w;
|
||||
|
||||
width = donelen = 0;
|
||||
while ((clen = mbrtowc(&wc, month + donelen, MB_LEN_MAX, NULL)) != 0) {
|
||||
if (clen == (size_t)-1 || clen == (size_t)-2)
|
||||
return (-1);
|
||||
donelen += clen;
|
||||
if ((w = wcwidth(wc)) == (size_t)-1)
|
||||
return (-1);
|
||||
width += w;
|
||||
}
|
||||
|
||||
return (width);
|
||||
}
|
||||
|
||||
static void
|
||||
compute_abbreviated_month_size(void)
|
||||
{
|
||||
int i;
|
||||
size_t width;
|
||||
size_t months_width[12];
|
||||
|
||||
for (i = 0; i < 12; i++) {
|
||||
width = mbswidth(get_abmon(i));
|
||||
if (width == (size_t)-1) {
|
||||
month_max_size = -1;
|
||||
return;
|
||||
}
|
||||
months_width[i] = width;
|
||||
if (width > month_max_size)
|
||||
month_max_size = width;
|
||||
}
|
||||
|
||||
for (i = 0; i < 12; i++)
|
||||
padding_for_month[i] = month_max_size - months_width[i];
|
||||
}
|
||||
|
||||
/*
|
||||
* print name in current style
|
||||
*/
|
||||
@ -425,6 +494,31 @@ printdev(size_t width, dev_t dev)
|
||||
xo_emit("{:device/%#*jx} ", (u_int)width, (uintmax_t)dev);
|
||||
}
|
||||
|
||||
static size_t
|
||||
ls_strftime(char *str, size_t len, const char *fmt, const struct tm *tm)
|
||||
{
|
||||
char *posb, nfmt[BUFSIZ];
|
||||
const char *format = fmt;
|
||||
size_t ret;
|
||||
|
||||
if ((posb = strstr(fmt, "%b")) != NULL) {
|
||||
if (month_max_size == 0) {
|
||||
compute_abbreviated_month_size();
|
||||
}
|
||||
if (month_max_size > 0) {
|
||||
snprintf(nfmt, sizeof(nfmt), "%.*s%s%*s%s",
|
||||
(int)(posb - fmt), fmt,
|
||||
get_abmon(tm->tm_mon),
|
||||
(int)padding_for_month[tm->tm_mon],
|
||||
"",
|
||||
posb + 2);
|
||||
format = nfmt;
|
||||
}
|
||||
}
|
||||
ret = strftime(str, len, format, tm);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
static void
|
||||
printtime(const char *field, time_t ftime)
|
||||
{
|
||||
@ -451,7 +545,7 @@ printtime(const char *field, time_t ftime)
|
||||
else
|
||||
/* mmm dd yyyy || dd mmm yyyy */
|
||||
format = d_first ? "%e %b %Y" : "%b %e %Y";
|
||||
strftime(longstring, sizeof(longstring), format, localtime(&ftime));
|
||||
ls_strftime(longstring, sizeof(longstring), format, localtime(&ftime));
|
||||
|
||||
snprintf(fmt, sizeof(fmt), "{d:%s/%%hs} ", field);
|
||||
xo_attr("value", "%ld", (long) ftime);
|
||||
|
@ -170,8 +170,6 @@ B_flag_head()
|
||||
|
||||
B_flag_body()
|
||||
{
|
||||
atf_skip "kyua report-jenkins doesn't properly escape non-printable chars: https://github.com/jmmv/kyua/issues/136"
|
||||
|
||||
atf_check -e empty -o empty -s exit:0 touch "$(printf "y\013z")"
|
||||
atf_check -e empty -o match:'y\\013z' -s exit:0 ls -B
|
||||
}
|
||||
@ -467,8 +465,6 @@ b_flag_head()
|
||||
|
||||
b_flag_body()
|
||||
{
|
||||
atf_skip "kyua report-jenkins doesn't properly escape non-printable chars: https://github.com/jmmv/kyua/issues/136"
|
||||
|
||||
atf_check -e empty -o empty -s exit:0 touch "$(printf "y\013z")"
|
||||
atf_check -e empty -o match:'y\\vz' -s exit:0 ls -b
|
||||
}
|
||||
@ -747,8 +743,6 @@ q_flag_and_w_flag_head()
|
||||
|
||||
q_flag_and_w_flag_body()
|
||||
{
|
||||
atf_skip "kyua report-jenkins doesn't properly escape non-printable chars: https://github.com/jmmv/kyua/issues/136"
|
||||
|
||||
create_test_dir
|
||||
|
||||
test_file="$(printf "y\01z")"
|
||||
|
@ -21,6 +21,7 @@ FILES+= positional5.0
|
||||
FILES+= positional6.0
|
||||
FILES+= positional7.0
|
||||
FILES+= positional8.0
|
||||
FILES+= positional9.0
|
||||
FILES+= pwd1.0
|
||||
FILES+= pwd2.0
|
||||
|
||||
|
18
bin/sh/tests/parameters/positional9.0
Normal file
18
bin/sh/tests/parameters/positional9.0
Normal file
@ -0,0 +1,18 @@
|
||||
# $FreeBSD$
|
||||
# Although POSIX leaves the result of expanding ${#@} and ${#*} unspecified,
|
||||
# make sure it is at least numeric.
|
||||
|
||||
set -- bb cc ddd
|
||||
set -f
|
||||
lengths=${#*}${#@}"${#*}${#@}"$(echo ${#*}${#@}"${#*}${#@}")
|
||||
IFS=
|
||||
lengths=$lengths${#*}${#@}"${#*}${#@}"$(echo ${#*}${#@}"${#*}${#@}")
|
||||
case $lengths in
|
||||
*[!0-9]*)
|
||||
printf 'bad: %s\n' "$lengths"
|
||||
exit 3 ;;
|
||||
????????????????*) ;;
|
||||
*)
|
||||
printf 'too short: %s\n' "$lengths"
|
||||
exit 3 ;;
|
||||
esac
|
@ -1,2 +1,3 @@
|
||||
Sun, 25 Jan 2004 13:00:00 PST
|
||||
2004 Jan 25 13:00:00
|
||||
|
||||
|
@ -0,0 +1,99 @@
|
||||
#
|
||||
# This file and its contents are supplied under the terms of the
|
||||
# Common Development and Distribution License ("CDDL"), version 1.0.
|
||||
# You may only use this file in accordance with the terms of version
|
||||
# 1.0 of the CDDL.
|
||||
#
|
||||
# A full copy of the text of the CDDL should have accompanied this
|
||||
# source. A copy of the CDDL is also available via the Internet at
|
||||
# http://www.illumos.org/license/CDDL.
|
||||
#
|
||||
|
||||
#
|
||||
# Copyright (c) 2015, Joyent, Inc. All rights reserved.
|
||||
#
|
||||
|
||||
#
|
||||
# This test assures that we can have the same provider name across multiple
|
||||
# probe definitions, and that the result will be the union of those
|
||||
# definitions. In particular, libusdt depends on this when (for example)
|
||||
# node modules that create a provider are loaded multiple times due to
|
||||
# being included by different modules.
|
||||
#
|
||||
|
||||
if [ $# != 1 ]; then
|
||||
echo expected one argument: '<'dtrace-path'>'
|
||||
exit 2
|
||||
fi
|
||||
|
||||
dtrace=$1
|
||||
DIR=/var/tmp/dtest.$$
|
||||
|
||||
mkdir $DIR
|
||||
cd $DIR
|
||||
|
||||
cat > test.c <<EOF
|
||||
#include <unistd.h>
|
||||
|
||||
void
|
||||
main()
|
||||
{
|
||||
EOF
|
||||
|
||||
objs=
|
||||
|
||||
for oogle in bagnoogle stalloogle cockoogle; do
|
||||
cat > $oogle.c <<EOF
|
||||
#include <sys/sdt.h>
|
||||
|
||||
void
|
||||
$oogle()
|
||||
{
|
||||
DTRACE_PROBE(doogle, $oogle);
|
||||
}
|
||||
EOF
|
||||
|
||||
cat > $oogle.d <<EOF
|
||||
provider doogle {
|
||||
probe $oogle();
|
||||
};
|
||||
EOF
|
||||
|
||||
cc -c $oogle.c
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
print -u2 "failed to compile $oogle.c"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
$dtrace -G -s $oogle.d $oogle.o -o $oogle.d.o
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
print -u2 "failed to process $oogle.d"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
objs="$objs $oogle.o $oogle.d.o"
|
||||
echo $oogle'();' >> test.c
|
||||
done
|
||||
|
||||
echo "}" >> test.c
|
||||
|
||||
cc -o test test.c $objs
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
print -u2 "failed to compile test.c"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
$dtrace -n 'doogle$target:::{@[probename] = count()}' \
|
||||
-n 'END{printa("%-10s %@d\n", @)}' -x quiet -x aggsortkey -Zc ./test
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
print -u2 "failed to execute test"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd /
|
||||
rm -rf $DIR
|
||||
exit 0
|
@ -0,0 +1,4 @@
|
||||
bagnoogle 1
|
||||
cockoogle 1
|
||||
stalloogle 1
|
||||
|
@ -571,12 +571,6 @@ dt_pid_usdt_mapping(void *data, const prmap_t *pmp, const char *oname)
|
||||
prsyminfo_t sip;
|
||||
dof_helper_t dh;
|
||||
GElf_Half e_type;
|
||||
#ifdef __FreeBSD__
|
||||
dof_hdr_t hdr;
|
||||
size_t sz;
|
||||
uint64_t dofmax;
|
||||
void *dof;
|
||||
#endif
|
||||
const char *mname;
|
||||
const char *syms[] = { "___SUNW_dof", "__SUNW_dof" };
|
||||
int i, fd = -1;
|
||||
@ -606,61 +600,25 @@ dt_pid_usdt_mapping(void *data, const prmap_t *pmp, const char *oname)
|
||||
continue;
|
||||
}
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
dh.dofhp_addr = (e_type == ET_EXEC) ? 0 : pmp->pr_vaddr;
|
||||
if (Pread(P, &hdr, sizeof (hdr), sym.st_value) !=
|
||||
sizeof (hdr)) {
|
||||
dt_dprintf("read of DOF header failed\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
sz = sizeof(dofmax);
|
||||
if (sysctlbyname("kern.dtrace.dof_maxsize", &dofmax, &sz,
|
||||
NULL, 0) != 0) {
|
||||
dt_dprintf("failed to read dof_maxsize: %s\n",
|
||||
strerror(errno));
|
||||
continue;
|
||||
}
|
||||
if (dofmax < hdr.dofh_loadsz) {
|
||||
dt_dprintf("DOF load size exceeds maximum\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((dof = malloc(hdr.dofh_loadsz)) == NULL)
|
||||
return (-1);
|
||||
|
||||
if (Pread(P, dof, hdr.dofh_loadsz, sym.st_value) !=
|
||||
hdr.dofh_loadsz) {
|
||||
free(dof);
|
||||
dt_dprintf("read of DOF section failed\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
dh.dofhp_dof = (uintptr_t)dof;
|
||||
dh.dofhp_pid = proc_getpid(P);
|
||||
|
||||
dt_pid_objname(dh.dofhp_mod, sizeof (dh.dofhp_mod),
|
||||
sip.prs_lmid, mname);
|
||||
|
||||
if (fd == -1 &&
|
||||
(fd = open("/dev/dtrace/helper", O_RDWR, 0)) < 0) {
|
||||
dt_dprintf("open of helper device failed: %s\n",
|
||||
strerror(errno));
|
||||
free(dof);
|
||||
return (-1); /* errno is set for us */
|
||||
}
|
||||
|
||||
if (ioctl(fd, DTRACEHIOC_ADDDOF, &dh, sizeof (dh)) < 0)
|
||||
dt_dprintf("DOF was rejected for %s\n", dh.dofhp_mod);
|
||||
|
||||
free(dof);
|
||||
#else
|
||||
dh.dofhp_dof = sym.st_value;
|
||||
dh.dofhp_addr = (e_type == ET_EXEC) ? 0 : pmp->pr_vaddr;
|
||||
|
||||
dt_pid_objname(dh.dofhp_mod, sizeof (dh.dofhp_mod),
|
||||
sip.prs_lmid, mname);
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
dh.dofhp_pid = proc_getpid(P);
|
||||
|
||||
if (fd == -1 &&
|
||||
(fd = open("/dev/dtrace/helper", O_RDWR, 0)) < 0) {
|
||||
dt_dprintf("open of helper device failed: %s\n",
|
||||
strerror(errno));
|
||||
return (-1); /* errno is set for us */
|
||||
}
|
||||
|
||||
if (ioctl(fd, DTRACEHIOC_ADDDOF, &dh, sizeof (dh)) < 0)
|
||||
dt_dprintf("DOF was rejected for %s\n", dh.dofhp_mod);
|
||||
#else
|
||||
if (fd == -1 &&
|
||||
(fd = pr_open(P, "/dev/dtrace/helper", O_RDWR, 0)) < 0) {
|
||||
dt_dprintf("pr_open of helper device failed: %s\n",
|
||||
|
@ -24,6 +24,6 @@ CFILES= \
|
||||
tst.sigwait.c \
|
||||
|
||||
|
||||
LIBADD.tst.sigwait.exe=rt
|
||||
LIBADD.tst.sigwait.exe+= rt
|
||||
|
||||
.include "../../dtrace.test.mk"
|
||||
|
@ -46,6 +46,8 @@ TESTFILES= \
|
||||
tst.onlyenabled.ksh \
|
||||
tst.reap.ksh \
|
||||
tst.reeval.ksh \
|
||||
tst.sameprovmulti.ksh \
|
||||
tst.sameprovmulti.ksh.out \
|
||||
tst.static.ksh \
|
||||
tst.static.ksh.out \
|
||||
tst.static2.ksh \
|
||||
|
@ -1,3 +1,35 @@
|
||||
2015-12-01 Simon J. Gerraty <sjg@bad.crufty.net>
|
||||
|
||||
* Makefile (MAKE_VERSION): 20151201
|
||||
Merge with NetBSD make, pick up
|
||||
o cond.c: CondCvtArg: avoid access beyond end of empty buffer.
|
||||
o meta.c: meta_oodate: use lstat(2) for checking link target
|
||||
in case it is a symlink.
|
||||
o var.c: avoid calling brk_string and Var_Export1 with empty
|
||||
strings.
|
||||
|
||||
2015-11-26 Simon J. Gerraty <sjg@bad.crufty.net>
|
||||
|
||||
* Makefile (MAKE_VERSION): 20151126
|
||||
Merge with NetBSD make, pick up
|
||||
o parse.c: ParseTrackInput don't access beyond
|
||||
end of old value.
|
||||
|
||||
2015-10-22 Simon J. Gerraty <sjg@bad.crufty.net>
|
||||
|
||||
* Makefile (MAKE_VERSION): 20151022
|
||||
|
||||
* Add support for BSD/OS which lacks inttypes.h
|
||||
and really needs sys/param.h for sys/sysctl.h
|
||||
also 'type' is not a shell builtin.
|
||||
|
||||
* var.c: eliminate uint32_t and need for inttypes.h
|
||||
|
||||
* main.c: PrintOnError flush stdout before run .ERROR
|
||||
|
||||
* parse.c: cope with _SC_PAGESIZE not being defined.
|
||||
|
||||
|
||||
2015-10-20 Simon J. Gerraty <sjg@bad.crufty.net>
|
||||
|
||||
* Makefile (MAKE_VERSION): 20151020
|
||||
|
@ -1,7 +1,7 @@
|
||||
# $Id: Makefile,v 1.44 2015/10/20 21:41:40 sjg Exp $
|
||||
# $Id: Makefile,v 1.48 2015/12/02 00:36:42 sjg Exp $
|
||||
|
||||
# Base version on src date
|
||||
MAKE_VERSION= 20151020
|
||||
MAKE_VERSION= 20151201
|
||||
|
||||
PROG= bmake
|
||||
|
||||
|
@ -111,7 +111,7 @@
|
||||
# Simon J. Gerraty <sjg@crufty.net>
|
||||
|
||||
# RCSid:
|
||||
# $Id: boot-strap,v 1.45 2014/04/05 22:56:54 sjg Exp $
|
||||
# $Id: boot-strap,v 1.48 2015/10/25 05:20:48 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2001 Simon J. Gerraty
|
||||
#
|
||||
@ -395,8 +395,15 @@ Bmake() {
|
||||
)
|
||||
}
|
||||
|
||||
# there is actually a shell where type is not a builtin
|
||||
# if type is missing, which(1) had better exists!
|
||||
if (type cat) > /dev/null 2>&1; then
|
||||
which() {
|
||||
type "$@" | sed 's,[()],,g;s,^[^/][^/]*,,;q'
|
||||
}
|
||||
fi
|
||||
# make sure test below uses the same diff that configure did
|
||||
TOOL_DIFF=`type diff | sed 's,[()],,g;s,^[^/][^/]*,,;q'`
|
||||
TOOL_DIFF=`which diff`
|
||||
export TOOL_DIFF
|
||||
|
||||
op_configure() {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: cond.c,v 1.69 2015/10/11 04:51:24 sjg Exp $ */
|
||||
/* $NetBSD: cond.c,v 1.71 2015/12/02 00:28:24 sjg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
|
||||
@ -70,14 +70,14 @@
|
||||
*/
|
||||
|
||||
#ifndef MAKE_NATIVE
|
||||
static char rcsid[] = "$NetBSD: cond.c,v 1.69 2015/10/11 04:51:24 sjg Exp $";
|
||||
static char rcsid[] = "$NetBSD: cond.c,v 1.71 2015/12/02 00:28:24 sjg Exp $";
|
||||
#else
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)cond.c 8.2 (Berkeley) 1/2/94";
|
||||
#else
|
||||
__RCSID("$NetBSD: cond.c,v 1.69 2015/10/11 04:51:24 sjg Exp $");
|
||||
__RCSID("$NetBSD: cond.c,v 1.71 2015/12/02 00:28:24 sjg Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
#endif
|
||||
@ -490,6 +490,10 @@ CondCvtArg(char *str, double *value)
|
||||
double d_val;
|
||||
|
||||
errno = 0;
|
||||
if (!*str) {
|
||||
*value = (double)0;
|
||||
return TRUE;
|
||||
}
|
||||
l_val = strtoul(str, &eptr, str[1] == 'x' ? 16 : 10);
|
||||
ech = *eptr;
|
||||
if (ech == 0 && errno != ERANGE) {
|
||||
|
@ -59,6 +59,12 @@
|
||||
/* Define to 1 if you have the `killpg' function. */
|
||||
#undef HAVE_KILLPG
|
||||
|
||||
/* Define to 1 if you have the <libgen.h> header file. */
|
||||
#undef HAVE_LIBGEN_H
|
||||
|
||||
/* Define to 1 if you have the <limits.h> header file. */
|
||||
#undef HAVE_LIMITS_H
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
@ -158,6 +164,9 @@
|
||||
*/
|
||||
#undef HAVE_SYS_NDIR_H
|
||||
|
||||
/* Define to 1 if you have the <sys/param.h> header file. */
|
||||
#undef HAVE_SYS_PARAM_H
|
||||
|
||||
/* Define to 1 if you have the <sys/select.h> header file. */
|
||||
#undef HAVE_SYS_SELECT_H
|
||||
|
||||
@ -304,6 +313,11 @@
|
||||
/* Define to 1 if you need to in order for `stat' and other things to work. */
|
||||
#undef _POSIX_SOURCE
|
||||
|
||||
/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
|
||||
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
|
||||
#define below would cause a syntax error. */
|
||||
#undef _UINT32_T
|
||||
|
||||
/* C99 function name */
|
||||
#undef __func__
|
||||
|
||||
@ -319,5 +333,9 @@
|
||||
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
||||
#undef size_t
|
||||
|
||||
/* Define to the type of an unsigned integer type of width exactly 32 bits if
|
||||
such a type exists and the standard includes do not define it. */
|
||||
#undef uint32_t
|
||||
|
||||
/* Define as `fork' if `vfork' does not work. */
|
||||
#undef vfork
|
||||
|
116
contrib/bmake/configure
vendored
116
contrib/bmake/configure
vendored
@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.64 for bmake 20140214.
|
||||
# Generated by GNU Autoconf 2.64 for bmake 20151022.
|
||||
#
|
||||
# Report bugs to <sjg@NetBSD.org>.
|
||||
#
|
||||
@ -549,8 +549,8 @@ MAKEFLAGS=
|
||||
# Identity of this package.
|
||||
PACKAGE_NAME='bmake'
|
||||
PACKAGE_TARNAME='bmake'
|
||||
PACKAGE_VERSION='20140214'
|
||||
PACKAGE_STRING='bmake 20140214'
|
||||
PACKAGE_VERSION='20151022'
|
||||
PACKAGE_STRING='bmake 20151022'
|
||||
PACKAGE_BUGREPORT='sjg@NetBSD.org'
|
||||
PACKAGE_URL=''
|
||||
|
||||
@ -1221,7 +1221,7 @@ if test "$ac_init_help" = "long"; then
|
||||
# Omit some internal or obsolete options to make the list less imposing.
|
||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||
cat <<_ACEOF
|
||||
\`configure' configures bmake 20140214 to adapt to many kinds of systems.
|
||||
\`configure' configures bmake 20151022 to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
@ -1282,7 +1282,7 @@ fi
|
||||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of bmake 20140214:";;
|
||||
short | recursive ) echo "Configuration of bmake 20151022:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
@ -1387,7 +1387,7 @@ fi
|
||||
test -n "$ac_init_help" && exit $ac_status
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
bmake configure 20140214
|
||||
bmake configure 20151022
|
||||
generated by GNU Autoconf 2.64
|
||||
|
||||
Copyright (C) 2009 Free Software Foundation, Inc.
|
||||
@ -1742,6 +1742,58 @@ $as_echo "$ac_res" >&6; }
|
||||
|
||||
} # ac_fn_c_check_type
|
||||
|
||||
# ac_fn_c_find_uintX_t LINENO BITS VAR
|
||||
# ------------------------------------
|
||||
# Finds an unsigned integer type with width BITS, setting cache variable VAR
|
||||
# accordingly.
|
||||
ac_fn_c_find_uintX_t ()
|
||||
{
|
||||
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5
|
||||
$as_echo_n "checking for uint$2_t... " >&6; }
|
||||
if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
eval "$3=no"
|
||||
for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \
|
||||
'unsigned long long int' 'unsigned short int' 'unsigned char'; do
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
$ac_includes_default
|
||||
int
|
||||
main ()
|
||||
{
|
||||
static int test_array [1 - 2 * !(($ac_type) -1 >> ($2 - 1) == 1)];
|
||||
test_array [0] = 0
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
case $ac_type in #(
|
||||
uint$2_t) :
|
||||
eval "$3=yes" ;; #(
|
||||
*) :
|
||||
eval "$3=\$ac_type" ;;
|
||||
esac
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
eval as_val=\$$3
|
||||
if test "x$as_val" = x""no; then :
|
||||
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
eval ac_res=\$$3
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
|
||||
$as_echo "$ac_res" >&6; }
|
||||
eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
|
||||
|
||||
} # ac_fn_c_find_uintX_t
|
||||
|
||||
# ac_fn_c_check_decl LINENO SYMBOL VAR
|
||||
# ------------------------------------
|
||||
# Tests whether SYMBOL is declared, setting cache variable VAR accordingly.
|
||||
@ -1908,7 +1960,7 @@ cat >config.log <<_ACEOF
|
||||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
|
||||
It was created by bmake $as_me 20140214, which was
|
||||
It was created by bmake $as_me 20151022, which was
|
||||
generated by GNU Autoconf 2.64. Invocation command line was
|
||||
|
||||
$ $0 $@
|
||||
@ -4569,10 +4621,41 @@ fi
|
||||
|
||||
fi
|
||||
|
||||
for ac_header in sys/param.h
|
||||
do :
|
||||
ac_fn_c_check_header_mongrel "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default"
|
||||
if test "x$ac_cv_header_sys_param_h" = x""yes; then :
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define HAVE_SYS_PARAM_H 1
|
||||
_ACEOF
|
||||
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
for ac_header in sys/sysctl.h
|
||||
do :
|
||||
ac_fn_c_check_header_compile "$LINENO" "sys/sysctl.h" "ac_cv_header_sys_sysctl_h" "#ifdef HAVE_SYS_PARAM_H
|
||||
# include <sys/param.h>
|
||||
# endif
|
||||
|
||||
"
|
||||
if test "x$ac_cv_header_sys_sysctl_h" = x""yes; then :
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define HAVE_SYS_SYSCTL_H 1
|
||||
_ACEOF
|
||||
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
|
||||
for ac_header in \
|
||||
ar.h \
|
||||
err.h \
|
||||
fcntl.h \
|
||||
libgen.h \
|
||||
limits.h \
|
||||
paths.h \
|
||||
poll.h \
|
||||
ranlib.h \
|
||||
@ -4580,7 +4663,6 @@ for ac_header in \
|
||||
sys/mman.h \
|
||||
sys/select.h \
|
||||
sys/socket.h \
|
||||
sys/sysctl.h \
|
||||
sys/time.h \
|
||||
sys/uio.h \
|
||||
unistd.h \
|
||||
@ -5006,6 +5088,20 @@ _ACEOF
|
||||
|
||||
fi
|
||||
|
||||
ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t"
|
||||
case $ac_cv_c_uint32_t in #(
|
||||
no|yes) ;; #(
|
||||
*)
|
||||
|
||||
$as_echo "#define _UINT32_T 1" >>confdefs.h
|
||||
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define uint32_t $ac_cv_c_uint32_t
|
||||
_ACEOF
|
||||
;;
|
||||
esac
|
||||
|
||||
ac_fn_c_check_decl "$LINENO" "sys_siglist" "ac_cv_have_decl_sys_siglist" "#include <signal.h>
|
||||
/* NetBSD declares sys_siglist in unistd.h. */
|
||||
#ifdef HAVE_UNISTD_H
|
||||
@ -6406,7 +6502,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
|
||||
# report actual input values of CONFIG_FILES etc. instead of their
|
||||
# values after options handling.
|
||||
ac_log="
|
||||
This file was extended by bmake $as_me 20140214, which was
|
||||
This file was extended by bmake $as_me 20151022, which was
|
||||
generated by GNU Autoconf 2.64. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
@ -6466,7 +6562,7 @@ Report bugs to <sjg@NetBSD.org>."
|
||||
_ACEOF
|
||||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||
ac_cs_version="\\
|
||||
bmake config.status 20140214
|
||||
bmake config.status 20151022
|
||||
configured by $0, generated by GNU Autoconf 2.64,
|
||||
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
dnl
|
||||
dnl RCSid:
|
||||
dnl $Id: configure.in,v 1.54 2015/10/10 04:17:10 sjg Exp $
|
||||
dnl $Id: configure.in,v 1.56 2015/10/25 05:20:48 sjg Exp $
|
||||
dnl
|
||||
dnl Process this file with autoconf to produce a configure script
|
||||
dnl
|
||||
AC_PREREQ(2.50)
|
||||
AC_INIT([bmake], [20151009], [sjg@NetBSD.org])
|
||||
AC_INIT([bmake], [20151022], [sjg@NetBSD.org])
|
||||
AC_CONFIG_HEADERS(config.h)
|
||||
|
||||
dnl make srcdir absolute
|
||||
@ -101,10 +101,19 @@ AC_HEADER_STDC
|
||||
AC_HEADER_SYS_WAIT
|
||||
AC_HEADER_DIRENT
|
||||
dnl Keep this list sorted
|
||||
AC_CHECK_HEADERS(sys/param.h)
|
||||
dnl On BSDi at least we really need sys/param.h for sys/sysctl.h
|
||||
AC_CHECK_HEADERS([sys/sysctl.h], [], [],
|
||||
[#ifdef HAVE_SYS_PARAM_H
|
||||
# include <sys/param.h>
|
||||
# endif
|
||||
])
|
||||
|
||||
AC_CHECK_HEADERS( \
|
||||
ar.h \
|
||||
err.h \
|
||||
fcntl.h \
|
||||
libgen.h \
|
||||
limits.h \
|
||||
paths.h \
|
||||
poll.h \
|
||||
@ -113,7 +122,6 @@ AC_CHECK_HEADERS( \
|
||||
sys/mman.h \
|
||||
sys/select.h \
|
||||
sys/socket.h \
|
||||
sys/sysctl.h \
|
||||
sys/time.h \
|
||||
sys/uio.h \
|
||||
unistd.h \
|
||||
@ -143,6 +151,7 @@ AC_C_CONST
|
||||
AC_TYPE_OFF_T
|
||||
AC_TYPE_PID_T
|
||||
AC_TYPE_SIZE_T
|
||||
AC_TYPE_UINT32_T
|
||||
AC_DECL_SYS_SIGLIST
|
||||
AC_HEADER_TIME
|
||||
AC_STRUCT_TM
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: main.c,v 1.234 2015/10/11 04:51:24 sjg Exp $ */
|
||||
/* $NetBSD: main.c,v 1.235 2015/10/25 05:24:44 sjg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988, 1989, 1990, 1993
|
||||
@ -69,7 +69,7 @@
|
||||
*/
|
||||
|
||||
#ifndef MAKE_NATIVE
|
||||
static char rcsid[] = "$NetBSD: main.c,v 1.234 2015/10/11 04:51:24 sjg Exp $";
|
||||
static char rcsid[] = "$NetBSD: main.c,v 1.235 2015/10/25 05:24:44 sjg Exp $";
|
||||
#else
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993\
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94";
|
||||
#else
|
||||
__RCSID("$NetBSD: main.c,v 1.234 2015/10/11 04:51:24 sjg Exp $");
|
||||
__RCSID("$NetBSD: main.c,v 1.235 2015/10/25 05:24:44 sjg Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
#endif
|
||||
@ -1902,6 +1902,8 @@ PrintOnError(GNode *gn, const char *s)
|
||||
printf("%s", cp);
|
||||
free(cp);
|
||||
}
|
||||
fflush(stdout);
|
||||
|
||||
/*
|
||||
* Finally, see if there is a .ERROR target, and run it if so.
|
||||
*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: meta.c,v 1.40 2015/10/11 04:51:24 sjg Exp $ */
|
||||
/* $NetBSD: meta.c,v 1.41 2015/11/30 23:37:56 sjg Exp $ */
|
||||
|
||||
/*
|
||||
* Implement 'meta' mode.
|
||||
@ -38,7 +38,11 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <fcntl.h>
|
||||
#ifdef HAVE_LIBGEN_H
|
||||
#include <libgen.h>
|
||||
#elif !defined(HAVE_DIRNAME)
|
||||
char * dirname(char *);
|
||||
#endif
|
||||
#include <errno.h>
|
||||
#if !defined(HAVE_CONFIG_H) || defined(HAVE_ERR_H)
|
||||
#include <err.h>
|
||||
@ -1183,7 +1187,8 @@ meta_oodate(GNode *gn, Boolean oodate)
|
||||
if ((strstr("tmp", p)))
|
||||
break;
|
||||
|
||||
if (stat(p, &fs) < 0) {
|
||||
if ((link_src != NULL && lstat(p, &fs) < 0) ||
|
||||
(link_src == NULL && stat(p, &fs) < 0)) {
|
||||
Lst_AtEnd(missingFiles, bmake_strdup(p));
|
||||
}
|
||||
break;
|
||||
|
@ -1,3 +1,29 @@
|
||||
2015-11-14 Simon J. Gerraty <sjg@bad.crufty.net>
|
||||
|
||||
* install-mk (MK_VERSION): 20151111
|
||||
|
||||
* meta.sys.mk: include sys.dependfile.mk
|
||||
|
||||
* sys.mk (OPTIONS_DEFAULT_NO): use options.mk
|
||||
to set MK_AUTO_OBJ and MK_DIRDEPS_BUILD
|
||||
include local.sys.env.mk early
|
||||
include local.sys.mk later
|
||||
|
||||
* own.mk (OPTIONS_DEFAULT_NO): AUTO_OBJ etc moved to sys.mk
|
||||
|
||||
2015-11-13 Simon J. Gerraty <sjg@bad.crufty.net>
|
||||
|
||||
* meta.sys.mk (META_COOKIE_TOUCH):
|
||||
add ${META_COOKIE_TOUCH} to the end of scripts to touch cookie
|
||||
|
||||
* meta.stage.mk: stage_libs should ignore SYMLINKS.
|
||||
|
||||
2015-10-23 Simon J. Gerraty <sjg@bad.crufty.net>
|
||||
|
||||
* install-mk (MK_VERSION): 20151022
|
||||
|
||||
* sys.mk: BSD/OS does not have 'type' as a shell builtin.
|
||||
|
||||
2015-10-20 Simon J. Gerraty <sjg@bad.crufty.net>
|
||||
|
||||
* install-mk (MK_VERSION): 20151020
|
||||
@ -460,7 +486,7 @@
|
||||
needed.
|
||||
* gendirdeps.mk: only produce unqualified deps if no
|
||||
.MAKE.DEPENDFILE_PREFERENCE ends in .${MACHINE}
|
||||
* meta.subdir.mk: apply SUBDIREPS_FILTER
|
||||
* meta.subdir.mk: apply SUBDIRDEPS_FILTER
|
||||
|
||||
2012-04-20 Simon J. Gerraty <sjg@bad.crufty.net>
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# RCSid:
|
||||
# $Id: host-target.mk,v 1.9 2015/09/10 18:42:57 sjg Exp $
|
||||
# $Id: host-target.mk,v 1.11 2015/10/25 00:07:20 sjg Exp $
|
||||
|
||||
# Host platform information; may be overridden
|
||||
.if !defined(_HOST_OSNAME)
|
||||
@ -21,7 +21,7 @@ _HOST_ARCH := ${_HOST_MACHINE}
|
||||
.else
|
||||
_HOST_ARCH != uname -p 2> /dev/null || uname -m
|
||||
# uname -p may produce garbage on linux
|
||||
.if ${_HOST_ARCH:[\#]} > 1
|
||||
.if ${_HOST_ARCH:[\#]} > 1 || ${_HOST_ARCH:Nunknown} == ""
|
||||
_HOST_ARCH := ${_HOST_MACHINE}
|
||||
.endif
|
||||
.endif
|
||||
@ -33,10 +33,10 @@ HOST_MACHINE := ${_HOST_MACHINE}
|
||||
.endif
|
||||
|
||||
HOST_OSMAJOR := ${_HOST_OSREL:C/[^0-9].*//}
|
||||
HOST_OSTYPE := ${_HOST_OSNAME}-${_HOST_OSREL:C/\([^\)]*\)//}-${_HOST_ARCH}
|
||||
HOST_OSTYPE := ${_HOST_OSNAME:S,/,,g}-${_HOST_OSREL:C/\([^\)]*\)//}-${_HOST_ARCH}
|
||||
HOST_OS := ${_HOST_OSNAME}
|
||||
host_os := ${_HOST_OSNAME:tl}
|
||||
HOST_TARGET := ${host_os}${HOST_OSMAJOR}-${_HOST_ARCH}
|
||||
HOST_TARGET := ${host_os:S,/,,g}${HOST_OSMAJOR}-${_HOST_ARCH}
|
||||
|
||||
# tr is insanely non-portable, accommodate the lowest common denominator
|
||||
TR ?= tr
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $Id: init.mk,v 1.9 2013/07/18 05:46:24 sjg Exp $
|
||||
# $Id: init.mk,v 1.10 2015/12/07 04:28:31 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2002, Simon J. Gerraty
|
||||
#
|
||||
@ -47,4 +47,8 @@ PROFFLAGS?= -DGPROF -DPROF
|
||||
_SKIP_BUILD = not building at level 0
|
||||
.endif
|
||||
|
||||
.if !empty(_SKIP_BUILD)
|
||||
all: .PHONY
|
||||
.warning ${_SKIP_BUILD}
|
||||
.endif
|
||||
.endif
|
||||
|
@ -55,7 +55,7 @@
|
||||
# Simon J. Gerraty <sjg@crufty.net>
|
||||
|
||||
# RCSid:
|
||||
# $Id: install-mk,v 1.115 2015/10/20 22:04:53 sjg Exp $
|
||||
# $Id: install-mk,v 1.117 2015/11/14 18:09:57 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 1994 Simon J. Gerraty
|
||||
#
|
||||
@ -70,7 +70,7 @@
|
||||
# sjg@crufty.net
|
||||
#
|
||||
|
||||
MK_VERSION=20151020
|
||||
MK_VERSION=20151111
|
||||
OWNER=
|
||||
GROUP=
|
||||
MODE=444
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $Id: lib.mk,v 1.51 2014/05/23 01:30:36 sjg Exp $
|
||||
# $Id: lib.mk,v 1.52 2015/11/14 18:09:57 sjg Exp $
|
||||
|
||||
.if !target(__${.PARSEFILE}__)
|
||||
__${.PARSEFILE}__:
|
||||
@ -254,7 +254,7 @@ DLLIB ?= -ldl
|
||||
# is a waste of time, this tells meta.autodep.mk to just pick one
|
||||
# (typically .So)
|
||||
# yes, 42 is a random number.
|
||||
.if ${MK_META_MODE} == "yes" && ${SRCS:Uno:[\#]} > 42
|
||||
.if ${MK_DIRDEPS_BUILD} == "yes" && ${SRCS:Uno:[\#]} > 42
|
||||
OPTIMIZE_OBJECT_META_FILES ?= yes
|
||||
.endif
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $Id: meta.autodep.mk,v 1.37 2015/06/16 06:29:17 sjg Exp $
|
||||
# $Id: meta.autodep.mk,v 1.39 2015/12/07 04:35:32 sjg Exp $
|
||||
|
||||
#
|
||||
# @(#) Copyright (c) 2010, Simon J. Gerraty
|
||||
@ -50,6 +50,9 @@ UPDATE_DEPENDFILE = NO
|
||||
.endif
|
||||
|
||||
_CURDIR ?= ${.CURDIR}
|
||||
_OBJDIR ?= ${.OBJDIR}
|
||||
_OBJTOP ?= ${OBJTOP}
|
||||
_OBJROOT ?= ${OBJROOT:U${_OBJTOP}}
|
||||
_DEPENDFILE := ${_CURDIR}/${.MAKE.DEPENDFILE:T}
|
||||
|
||||
.if ${.MAKE.LEVEL} == 0
|
||||
@ -190,7 +193,7 @@ gendirdeps: ${_DEPENDFILE}
|
||||
# anything which matches ${_OBJROOT}* but not ${_OBJTOP}*
|
||||
# needs to be qualified in DIRDEPS
|
||||
# The pseudo machine "host" is used for HOST_TARGET
|
||||
DIRDEPS = \
|
||||
DIRDEPS += \
|
||||
${DPADD:M${_OBJTOP}*:H:C,${_OBJTOP}[^/]*/,,:N.:O:u} \
|
||||
${DPADD:M${_OBJROOT}*:N${_OBJTOP}*:H:S,${_OBJROOT},,:C,^([^/]+)/(.*),\2.\1,:S,${HOST_TARGET}$,host,:N.*:O:u}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $Id: meta.stage.mk,v 1.40 2015/10/04 17:36:54 sjg Exp $
|
||||
# $Id: meta.stage.mk,v 1.41 2015/11/13 17:34:04 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2011, Simon J. Gerraty
|
||||
#
|
||||
@ -155,7 +155,7 @@ stage_libs: .dirdep
|
||||
@${STAGE_LINKS_SCRIPT}; StageLinks -s ${STAGE_LIBDIR:${STAGE_DIR_FILTER}} \
|
||||
${SHLIB_LINKS:@t@${STAGE_LIBS:T:M$t.*} $t@}
|
||||
.elif !empty(SHLIB_LINK) && !empty(SHLIB_NAME)
|
||||
@${STAGE_LINKS_SCRIPT}; StageLinks -s ${STAGE_LIBDIR:${STAGE_DIR_FILTER}} ${SHLIB_NAME} ${SHLIB_LINK} ${SYMLINKS:T}
|
||||
@${STAGE_LINKS_SCRIPT}; StageLinks -s ${STAGE_LIBDIR:${STAGE_DIR_FILTER}} ${SHLIB_NAME} ${SHLIB_LINK}
|
||||
.endif
|
||||
.endif
|
||||
@touch $@
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $Id: meta.subdir.mk,v 1.10 2012/07/03 05:26:46 sjg Exp $
|
||||
# $Id: meta.subdir.mk,v 1.11 2015/11/24 22:26:51 sjg Exp $
|
||||
|
||||
#
|
||||
# @(#) Copyright (c) 2010, Simon J. Gerraty
|
||||
@ -62,7 +62,7 @@ _subdeps != cd ${.CURDIR} && \
|
||||
DIRDEPS =
|
||||
.else
|
||||
# clean up if needed
|
||||
DIRDEPS := ${DIRDEPS:S,^./,,:S,/./,/,g:${SUBDIREPS_FILTER:Uu}}
|
||||
DIRDEPS := ${DIRDEPS:S,^./,,:S,/./,/,g:${SUBDIRDEPS_FILTER:Uu}}
|
||||
.endif
|
||||
# we just dealt with it, if we leave it defined,
|
||||
# dirdeps.mk will compute some interesting combinations.
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $Id: meta.sys.mk,v 1.22 2015/06/16 06:31:05 sjg Exp $
|
||||
# $Id: meta.sys.mk,v 1.26 2015/11/14 21:16:13 sjg Exp $
|
||||
|
||||
#
|
||||
# @(#) Copyright (c) 2010, Simon J. Gerraty
|
||||
@ -51,17 +51,6 @@ META_MODE += silent=yes
|
||||
.endif
|
||||
.endif
|
||||
|
||||
# make defaults .MAKE.DEPENDFILE to .depend
|
||||
# that won't work for us.
|
||||
.if ${.MAKE.DEPENDFILE} == ".depend"
|
||||
.undef .MAKE.DEPENDFILE
|
||||
.endif
|
||||
|
||||
# if you don't cross build for multiple MACHINEs concurrently, then
|
||||
# .MAKE.DEPENDFILE = Makefile.depend
|
||||
# probably makes sense - you can set that in local.sys.mk
|
||||
.MAKE.DEPENDFILE ?= Makefile.depend.${MACHINE}
|
||||
|
||||
# we use the pseudo machine "host" for the build host.
|
||||
# this should be taken care of before we get here
|
||||
.if ${OBJTOP:Ua} == ${HOST_OBJTOP:Ub}
|
||||
@ -109,10 +98,27 @@ _metaError: .NOMETA .NOTMAIN
|
||||
|
||||
.endif
|
||||
|
||||
META_COOKIE_TOUCH=
|
||||
# some targets need to be .PHONY in non-meta mode
|
||||
META_NOPHONY= .PHONY
|
||||
# Are we, after all, in meta mode?
|
||||
.if ${.MAKE.MODE:Mmeta*} != ""
|
||||
MKDEP_MK = meta.autodep.mk
|
||||
|
||||
.if ${.MAKE.MAKEFILES:M*sys.dependfile.mk} == ""
|
||||
# this does all the smarts of setting .MAKE.DEPENDFILE
|
||||
.-include <sys.dependfile.mk>
|
||||
# check if we got anything sane
|
||||
.if ${.MAKE.DEPENDFILE} == ".depend"
|
||||
.undef .MAKE.DEPENDFILE
|
||||
.endif
|
||||
.MAKE.DEPENDFILE ?= Makefile.depend
|
||||
.endif
|
||||
|
||||
# we can afford to use cookies to prevent some targets
|
||||
# re-running needlessly
|
||||
META_COOKIE_TOUCH= touch ${COOKIE.${.TARGET}:U${.OBJDIR}/${.TARGET}}
|
||||
META_NOPHONY=
|
||||
.if ${UPDATE_DEPENDFILE:Uyes:tl} != "no"
|
||||
.if ${.MAKEFLAGS:Uno:M-k} != ""
|
||||
# make this more obvious
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $Id: own.mk,v 1.29 2015/09/08 06:15:31 sjg Exp $
|
||||
# $Id: own.mk,v 1.30 2015/11/14 18:09:57 sjg Exp $
|
||||
|
||||
.if !target(__${.PARSEFILE}__)
|
||||
__${.PARSEFILE}__:
|
||||
@ -89,12 +89,10 @@ OPTIONS_DEFAULT_NO+= DPADD_MK
|
||||
|
||||
# process options
|
||||
OPTIONS_DEFAULT_NO+= \
|
||||
AUTO_OBJ \
|
||||
INSTALL_AS_USER \
|
||||
GPROF \
|
||||
LIBTOOL \
|
||||
LINT \
|
||||
META_MODE \
|
||||
|
||||
OPTIONS_DEFAULT_YES+= \
|
||||
ARCHIVE \
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $Id: sys.mk,v 1.36 2014/05/11 00:30:19 sjg Exp $
|
||||
# $Id: sys.mk,v 1.41 2015/11/14 20:20:34 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 2003-2009, Simon J. Gerraty
|
||||
#
|
||||
@ -75,8 +75,12 @@ M_L_TARGETS = ${M_ListToMatch:S,V,_TARGETS,}
|
||||
M_ListToSkip= O:u:ts::S,:,:N,g:S,^,N,
|
||||
|
||||
# type should be a builtin in any sh since about 1980,
|
||||
# but sadly there are exceptions!
|
||||
.if ${.MAKE.OS:Unknown:NBSD/OS} == ""
|
||||
_type_sh = which
|
||||
.endif
|
||||
# AUTOCONF := ${autoconf:L:${M_whence}}
|
||||
M_type = @x@(type $$x 2> /dev/null); echo;@:sh:[0]:N* found*:[@]:C,[()],,g
|
||||
M_type = @x@(${_type_sh:Utype} $$x) 2> /dev/null; echo;@:sh:[0]:N* found*:[@]:C,[()],,g
|
||||
M_whence = ${M_type}:M/*:[1]
|
||||
|
||||
# convert a path to a valid shell variable
|
||||
@ -102,6 +106,9 @@ _TARGETS := ${.TARGETS}
|
||||
# we need HOST_TARGET etc below.
|
||||
.include <host-target.mk>
|
||||
|
||||
# early customizations
|
||||
.-include <local.sys.env.mk>
|
||||
|
||||
# find the OS specifics
|
||||
.if defined(SYS_OS_MK)
|
||||
.include <${SYS_OS_MK}>
|
||||
@ -126,11 +133,30 @@ SYS_OS_MK := ${_sys_mk}
|
||||
.export SYS_OS_MK
|
||||
.endif
|
||||
|
||||
# allow customization without editing.
|
||||
.-include <local.sys.mk>
|
||||
# some options we need to know early
|
||||
OPTIONS_DEFAULT_NO += \
|
||||
DIRDEPS_BUILD \
|
||||
DIRDEPS_CACHE \
|
||||
META_MODE
|
||||
|
||||
OPTIONS_DEFAULT_DEPENDENT += \
|
||||
AUTO_OBJ/DIRDEPS_BUILD \
|
||||
STAGING/DIRDEPS_BUILD \
|
||||
|
||||
.-include "options.mk"
|
||||
|
||||
.if ${MK_DIRDEPS_BUILD:Uno} == "yes"
|
||||
MK_META_MODE = yes
|
||||
.-include <meta.sys.mk>
|
||||
.elif ${MK_META_MODE:Uno} == "yes"
|
||||
.MAKE.MODE = meta verbose
|
||||
.endif
|
||||
# make sure we have a harmless value
|
||||
.MAKE.MODE ?= normal
|
||||
|
||||
# if you want objdirs make them automatic
|
||||
.if ${MKOBJDIRS:Uno} == "auto"
|
||||
# and do it early before we compute .PATH
|
||||
.if ${MK_AUTO_OBJ:Uno} == "yes" || ${MKOBJDIRS:Uno} == "auto"
|
||||
.include <auto.obj.mk>
|
||||
.endif
|
||||
|
||||
@ -178,17 +204,8 @@ Mkdirs= Mkdirs() { \
|
||||
.cc.cpp-out:
|
||||
@${COMPILE.cc:N-c} -E ${.IMPSRC} | grep -v '^[ ]*$$'
|
||||
|
||||
# we don't include own.mk but user can expect -DWITH_META_MODE to work
|
||||
.if defined(WITHOUT_META_MODE)
|
||||
USE_META= no
|
||||
.elif defined(WITH_META_MODE)
|
||||
USE_META= yes
|
||||
.endif
|
||||
.if ${USE_META:Uno} == "yes"
|
||||
.-include <meta.sys.mk>
|
||||
.endif
|
||||
# make sure we have a harmless value
|
||||
.MAKE.MODE ?= normal
|
||||
# late customizations
|
||||
.-include <local.sys.mk>
|
||||
|
||||
# if .CURDIR is matched by any entry in DEBUG_MAKE_DIRS we
|
||||
# will apply DEBUG_MAKE_FLAGS, now.
|
||||
|
@ -17,7 +17,7 @@
|
||||
# Simon J. Gerraty <sjg@crufty.net>
|
||||
|
||||
# RCSid:
|
||||
# $Id: os.sh,v 1.47 2015/09/10 05:53:10 sjg Exp $
|
||||
# $Id: os.sh,v 1.49 2015/10/25 00:05:40 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 1994 Simon J. Gerraty
|
||||
#
|
||||
@ -44,7 +44,7 @@ MACHINE_ARCH=`uname -p 2>/dev/null || echo $MACHINE`
|
||||
# there is at least one case of `uname -p` outputting
|
||||
# a bunch of usless drivel
|
||||
case "$MACHINE_ARCH" in
|
||||
*[!A-Za-z0-9_-]*) MACHINE_ARCH="$MACHINE";;
|
||||
unknown|*[!A-Za-z0-9_-]*) MACHINE_ARCH="$MACHINE";;
|
||||
esac
|
||||
|
||||
# we need this here, and it is not always available...
|
||||
@ -213,7 +213,7 @@ LN=${LN:-ln}
|
||||
TR=${TR:-tr}
|
||||
|
||||
# Some people like have /share/$HOST_TARGET/bin etc.
|
||||
HOST_TARGET=`echo ${OS}${OSMAJOR}-$HOST_ARCH | toLower`
|
||||
HOST_TARGET=`echo ${OS}${OSMAJOR}-$HOST_ARCH | tr -d / | toLower`
|
||||
export HOST_TARGET
|
||||
|
||||
case `echo -n .` in -n*) N=; C="\c";; *) N=-n; C=;; esac
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: parse.c,v 1.205 2015/10/11 04:51:24 sjg Exp $ */
|
||||
/* $NetBSD: parse.c,v 1.206 2015/11/26 00:23:04 sjg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988, 1989, 1990, 1993
|
||||
@ -69,14 +69,14 @@
|
||||
*/
|
||||
|
||||
#ifndef MAKE_NATIVE
|
||||
static char rcsid[] = "$NetBSD: parse.c,v 1.205 2015/10/11 04:51:24 sjg Exp $";
|
||||
static char rcsid[] = "$NetBSD: parse.c,v 1.206 2015/11/26 00:23:04 sjg Exp $";
|
||||
#else
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94";
|
||||
#else
|
||||
__RCSID("$NetBSD: parse.c,v 1.205 2015/10/11 04:51:24 sjg Exp $");
|
||||
__RCSID("$NetBSD: parse.c,v 1.206 2015/11/26 00:23:04 sjg Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
#endif
|
||||
@ -508,7 +508,11 @@ loadfile(const char *path, int fd)
|
||||
#ifdef HAVE_MMAP
|
||||
if (load_getsize(fd, &lf->len) == SUCCESS) {
|
||||
/* found a size, try mmap */
|
||||
#ifdef _SC_PAGESIZE
|
||||
pagesize = sysconf(_SC_PAGESIZE);
|
||||
#else
|
||||
pagesize = 0;
|
||||
#endif
|
||||
if (pagesize <= 0) {
|
||||
pagesize = 0x1000;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $Id: Makefile.in,v 1.47 2015/05/05 21:58:06 sjg Exp $
|
||||
# $Id: Makefile.in,v 1.48 2015/12/07 04:06:29 sjg Exp $
|
||||
#
|
||||
# $NetBSD: Makefile,v 1.52 2015/05/05 21:51:09 sjg Exp $
|
||||
#
|
||||
@ -128,7 +128,7 @@ SED_CMDS.varshell = -e 's,^[a-z]*sh: ,,' \
|
||||
test: ${OUTFILES} .PHONY
|
||||
@failed= ; \
|
||||
for test in ${TESTNAMES}; do \
|
||||
${TOOL_DIFF} -u ${UNIT_TESTS}/$${test}.exp $${test}.out \
|
||||
${TOOL_DIFF} ${DIFF_FLAGS} ${UNIT_TESTS}/$${test}.exp $${test}.out \
|
||||
|| failed="$${failed}$${failed:+ }$${test}" ; \
|
||||
done ; \
|
||||
if [ -n "$${failed}" ]; then \
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $Id: cond2.mk,v 1.1.1.1 2015/05/05 21:53:13 sjg Exp $
|
||||
# $Id: cond2.mk,v 1.1.1.2 2015/12/02 00:34:27 sjg Exp $
|
||||
|
||||
TEST_UNAME_S= NetBSD
|
||||
|
||||
@ -21,5 +21,9 @@ Y!= echo TEST_NOT_SET is empty or not defined >&2; echo
|
||||
Y= oops
|
||||
.endif
|
||||
|
||||
.if defined(.NDEF) && ${.NDEF} > 0
|
||||
Z= yes
|
||||
.endif
|
||||
|
||||
all:
|
||||
@echo $@
|
||||
|
@ -1,9 +1,9 @@
|
||||
At first, I am
|
||||
happy
|
||||
and now: sad
|
||||
.ERROR: Looks like 'sad' is upset.
|
||||
*** Error code 1
|
||||
|
||||
Stop.
|
||||
make: stopped in unit-tests
|
||||
.ERROR: Looks like 'sad' is upset.
|
||||
exit status 1
|
||||
|
@ -12,9 +12,9 @@ all: mod-ts
|
||||
# Use print or printf iff they are builtin.
|
||||
# XXX note that this causes problems, when make decides
|
||||
# there is no need to use a shell, so avoid where possible.
|
||||
.if ${type print 2> /dev/null || echo:L:sh:Mbuiltin} != ""
|
||||
.if ${(type print) 2> /dev/null || echo:L:sh:Mbuiltin} != ""
|
||||
PRINT= print -r --
|
||||
.elif ${type printf 2> /dev/null || echo:L:sh:Mbuiltin} != ""
|
||||
.elif ${(type printf) 2> /dev/null || echo:L:sh:Mbuiltin} != ""
|
||||
PRINT= printf '%s\n'
|
||||
.else
|
||||
PRINT= echo
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: var.c,v 1.199 2015/10/20 21:30:57 sjg Exp $ */
|
||||
/* $NetBSD: var.c,v 1.200 2015/12/01 07:26:08 sjg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988, 1989, 1990, 1993
|
||||
@ -69,14 +69,14 @@
|
||||
*/
|
||||
|
||||
#ifndef MAKE_NATIVE
|
||||
static char rcsid[] = "$NetBSD: var.c,v 1.199 2015/10/20 21:30:57 sjg Exp $";
|
||||
static char rcsid[] = "$NetBSD: var.c,v 1.200 2015/12/01 07:26:08 sjg Exp $";
|
||||
#else
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94";
|
||||
#else
|
||||
__RCSID("$NetBSD: var.c,v 1.199 2015/10/20 21:30:57 sjg Exp $");
|
||||
__RCSID("$NetBSD: var.c,v 1.200 2015/12/01 07:26:08 sjg Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
#endif
|
||||
@ -129,7 +129,6 @@ __RCSID("$NetBSD: var.c,v 1.199 2015/10/20 21:30:57 sjg Exp $");
|
||||
#include <regex.h>
|
||||
#endif
|
||||
#include <ctype.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdlib.h>
|
||||
#include <limits.h>
|
||||
#include <time.h>
|
||||
@ -702,13 +701,15 @@ Var_ExportVars(void)
|
||||
int i;
|
||||
|
||||
val = Var_Subst(NULL, tmp, VAR_GLOBAL, FALSE, TRUE);
|
||||
av = brk_string(val, &ac, FALSE, &as);
|
||||
for (i = 0; i < ac; i++) {
|
||||
Var_Export1(av[i], 0);
|
||||
if (*val) {
|
||||
av = brk_string(val, &ac, FALSE, &as);
|
||||
for (i = 0; i < ac; i++) {
|
||||
Var_Export1(av[i], 0);
|
||||
}
|
||||
free(as);
|
||||
free(av);
|
||||
}
|
||||
free(val);
|
||||
free(as);
|
||||
free(av);
|
||||
}
|
||||
}
|
||||
|
||||
@ -740,35 +741,37 @@ Var_Export(char *str, int isExport)
|
||||
track = VAR_EXPORT_PARENT;
|
||||
}
|
||||
val = Var_Subst(NULL, str, VAR_GLOBAL, FALSE, TRUE);
|
||||
av = brk_string(val, &ac, FALSE, &as);
|
||||
for (i = 0; i < ac; i++) {
|
||||
name = av[i];
|
||||
if (!name[1]) {
|
||||
/*
|
||||
* A single char.
|
||||
* If it is one of the vars that should only appear in
|
||||
* local context, skip it, else we can get Var_Subst
|
||||
* into a loop.
|
||||
*/
|
||||
switch (name[0]) {
|
||||
case '@':
|
||||
case '%':
|
||||
case '*':
|
||||
case '!':
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (Var_Export1(name, track)) {
|
||||
if (VAR_EXPORTED_ALL != var_exportedVars)
|
||||
var_exportedVars = VAR_EXPORTED_YES;
|
||||
if (isExport && track) {
|
||||
Var_Append(MAKE_EXPORTED, name, VAR_GLOBAL);
|
||||
if (*val) {
|
||||
av = brk_string(val, &ac, FALSE, &as);
|
||||
for (i = 0; i < ac; i++) {
|
||||
name = av[i];
|
||||
if (!name[1]) {
|
||||
/*
|
||||
* A single char.
|
||||
* If it is one of the vars that should only appear in
|
||||
* local context, skip it, else we can get Var_Subst
|
||||
* into a loop.
|
||||
*/
|
||||
switch (name[0]) {
|
||||
case '@':
|
||||
case '%':
|
||||
case '*':
|
||||
case '!':
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (Var_Export1(name, track)) {
|
||||
if (VAR_EXPORTED_ALL != var_exportedVars)
|
||||
var_exportedVars = VAR_EXPORTED_YES;
|
||||
if (isExport && track) {
|
||||
Var_Append(MAKE_EXPORTED, name, VAR_GLOBAL);
|
||||
}
|
||||
}
|
||||
}
|
||||
free(as);
|
||||
free(av);
|
||||
}
|
||||
free(val);
|
||||
free(as);
|
||||
free(av);
|
||||
}
|
||||
|
||||
|
||||
@ -2306,7 +2309,7 @@ VarHash(char *str)
|
||||
Buffer buf;
|
||||
size_t len, len2;
|
||||
unsigned char *ustr = (unsigned char *)str;
|
||||
uint32_t h, k, c1, c2;
|
||||
unsigned int h, k, c1, c2;
|
||||
|
||||
h = 0x971e137bU;
|
||||
c1 = 0x95543787U;
|
||||
|
@ -37,6 +37,16 @@
|
||||
|
||||
ELFTC_VCSID("$Id: binary.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||
|
||||
static int
|
||||
basename_length(const char *filename)
|
||||
{
|
||||
char *p;
|
||||
|
||||
if ((p = strchr(filename, '.')) != NULL)
|
||||
return (p - filename);
|
||||
return (strlen(filename));
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert ELF object to `binary'. Sections with SHF_ALLOC flag set
|
||||
* are copied to the result binary. The relative offsets for each section
|
||||
@ -211,7 +221,8 @@ create_elf_from_binary(struct elfcopy *ecp, int ifd, const char *ifn)
|
||||
shtab->sz += gelf_fsize(ecp->eout, ELF_T_SHDR, 2, EV_CURRENT);
|
||||
|
||||
#define _GEN_SYMNAME(S) do { \
|
||||
snprintf(name, sizeof(name), "%s%s%s", "_binary_", ifn, S); \
|
||||
snprintf(name, sizeof(name), "%s%.*s%s", "_binary_", \
|
||||
basename_length(ifn), ifn, S); \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
|
@ -57,6 +57,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/timespec.h>
|
||||
#include <stdio.h>
|
||||
#include <arpa/nameser.h>
|
||||
|
||||
|
@ -18,7 +18,6 @@ DIRDEPS = \
|
||||
lib/libcom_err \
|
||||
lib/libcompiler_rt \
|
||||
lib/libgssapi \
|
||||
lib/libthr \
|
||||
secure/lib/libcrypto \
|
||||
|
||||
|
||||
|
@ -15,7 +15,6 @@ DIRDEPS = \
|
||||
lib/libc \
|
||||
lib/libcompiler_rt \
|
||||
lib/libgssapi \
|
||||
lib/libthr \
|
||||
secure/lib/libcrypto \
|
||||
|
||||
|
||||
|
@ -18,7 +18,6 @@ DIRDEPS = \
|
||||
lib/libcom_err \
|
||||
lib/libcompiler_rt \
|
||||
lib/libsqlite3 \
|
||||
lib/libthr \
|
||||
secure/lib/libcrypto \
|
||||
|
||||
|
||||
|
@ -14,7 +14,6 @@ DIRDEPS = \
|
||||
lib/libc \
|
||||
lib/libcom_err \
|
||||
lib/libcompiler_rt \
|
||||
lib/libthr \
|
||||
secure/lib/libcrypto \
|
||||
|
||||
|
||||
|
@ -15,7 +15,6 @@ DIRDEPS = \
|
||||
lib/libc \
|
||||
lib/libcom_err \
|
||||
lib/libcompiler_rt \
|
||||
lib/libthr \
|
||||
|
||||
|
||||
.include <dirdeps.mk>
|
||||
|
@ -15,7 +15,6 @@ DIRDEPS = \
|
||||
lib/libc \
|
||||
lib/libcom_err \
|
||||
lib/libcompiler_rt \
|
||||
lib/libthr \
|
||||
|
||||
|
||||
.include <dirdeps.mk>
|
||||
|
@ -13,7 +13,6 @@ DIRDEPS = \
|
||||
lib/${CSU_DIR} \
|
||||
lib/libc \
|
||||
lib/libcompiler_rt \
|
||||
lib/libthr \
|
||||
secure/lib/libcrypto \
|
||||
|
||||
|
||||
|
@ -19,7 +19,6 @@ DIRDEPS = \
|
||||
lib/libc \
|
||||
lib/libcom_err \
|
||||
lib/libcompiler_rt \
|
||||
lib/libthr \
|
||||
lib/libutil \
|
||||
secure/lib/libcrypto \
|
||||
|
||||
|
@ -32,12 +32,6 @@
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#ifndef lint
|
||||
#ifndef __GNUC__
|
||||
#error "GCC is needed to compile this file"
|
||||
#endif
|
||||
#endif /* lint */
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "libc_private.h"
|
||||
|
@ -27,12 +27,6 @@
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#ifndef lint
|
||||
#ifndef __GNUC__
|
||||
#error "GCC is needed to compile this file"
|
||||
#endif
|
||||
#endif /* lint */
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "libc_private.h"
|
||||
|
@ -42,12 +42,6 @@
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#ifndef lint
|
||||
#ifndef __GNUC__
|
||||
#error "GCC is needed to compile this file"
|
||||
#endif
|
||||
#endif /* lint */
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "libc_private.h"
|
||||
|
@ -29,12 +29,6 @@
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#ifndef lint
|
||||
#ifndef __GNUC__
|
||||
#error "GCC is needed to compile this file"
|
||||
#endif
|
||||
#endif /* lint */
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "libc_private.h"
|
||||
|
@ -36,10 +36,6 @@
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#ifndef __GNUC__
|
||||
#error "GCC is needed to compile this file"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "libc_private.h"
|
||||
#include "crtbrand.c"
|
||||
|
@ -42,12 +42,6 @@
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#ifndef lint
|
||||
#ifndef __GNUC__
|
||||
#error "GCC is needed to compile this file"
|
||||
#endif
|
||||
#endif /* lint */
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "libc_private.h"
|
||||
|
@ -42,12 +42,6 @@
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#ifndef lint
|
||||
#ifndef __GNUC__
|
||||
#error "GCC is needed to compile this file"
|
||||
#endif
|
||||
#endif /* lint */
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "libc_private.h"
|
||||
|
@ -33,12 +33,6 @@
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#ifndef lint
|
||||
#ifndef __GNUC__
|
||||
#error "GCC is needed to compile this file"
|
||||
#endif
|
||||
#endif /* lint */
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "libc_private.h"
|
||||
|
@ -10,6 +10,7 @@ DIRDEPS = \
|
||||
lib/libc \
|
||||
lib/libcompiler_rt \
|
||||
lib/libexpat \
|
||||
lib/libsbuf \
|
||||
|
||||
|
||||
.include <dirdeps.mk>
|
||||
|
@ -1,6 +1,6 @@
|
||||
# $FreeBSD$
|
||||
|
||||
SRCS+= trivial-vdso_tc.c
|
||||
SRCS+= __vdso_gettc.c
|
||||
|
||||
#MDASM= ptrace.S
|
||||
MDASM= brk.S \
|
||||
|
74
lib/libc/aarch64/sys/__vdso_gettc.c
Normal file
74
lib/libc/aarch64/sys/__vdso_gettc.c
Normal file
@ -0,0 +1,74 @@
|
||||
/*-
|
||||
* Copyright (c) 2015 The FreeBSD Foundation
|
||||
*
|
||||
* This software was developed by Konstantin Belousov
|
||||
* under sponsorship from the FreeBSD Foundation.
|
||||
*
|
||||
* 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
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/elf.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/vdso.h>
|
||||
#include <machine/cpufunc.h>
|
||||
#include "libc_private.h"
|
||||
|
||||
static inline uint64_t
|
||||
cp15_cntvct_get(void)
|
||||
{
|
||||
uint64_t reg;
|
||||
|
||||
__asm __volatile("mrs %0, cntvct_el0" : "=r" (reg));
|
||||
return (reg);
|
||||
}
|
||||
|
||||
static inline uint64_t
|
||||
cp15_cntpct_get(void)
|
||||
{
|
||||
uint64_t reg;
|
||||
|
||||
__asm __volatile("mrs %0, cntpct_el0" : "=r" (reg));
|
||||
return (reg);
|
||||
}
|
||||
|
||||
#pragma weak __vdso_gettc
|
||||
u_int
|
||||
__vdso_gettc(const struct vdso_timehands *th)
|
||||
{
|
||||
uint64_t val;
|
||||
|
||||
__asm __volatile("isb" : : : "memory");
|
||||
val = th->th_physical == 0 ? cp15_cntvct_get() : cp15_cntpct_get();
|
||||
return (val);
|
||||
}
|
||||
|
||||
#pragma weak __vdso_gettimekeep
|
||||
int
|
||||
__vdso_gettimekeep(struct vdso_timekeep **tk)
|
||||
{
|
||||
|
||||
return (_elf_aux_info(AT_TIMEKEEP, tk, sizeof(*tk)));
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
# $FreeBSD$
|
||||
|
||||
SRCS+= trivial-vdso_tc.c
|
||||
SRCS+= __vdso_gettc.c
|
||||
|
||||
MDASM= Ovfork.S brk.S cerror.S pipe.S ptrace.S sbrk.S shmat.S sigreturn.S syscall.S
|
||||
|
||||
|
79
lib/libc/arm/sys/__vdso_gettc.c
Normal file
79
lib/libc/arm/sys/__vdso_gettc.c
Normal file
@ -0,0 +1,79 @@
|
||||
/*-
|
||||
* Copyright (c) 2015 The FreeBSD Foundation
|
||||
*
|
||||
* This software was developed by Konstantin Belousov
|
||||
* under sponsorship from the FreeBSD Foundation.
|
||||
*
|
||||
* 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
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/elf.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/vdso.h>
|
||||
#include <machine/cpufunc.h>
|
||||
#include "libc_private.h"
|
||||
|
||||
static inline uint64_t
|
||||
cp15_cntvct_get(void)
|
||||
{
|
||||
uint64_t reg;
|
||||
|
||||
__asm __volatile("mrrc\tp15, 1, %Q0, %R0, c14" : "=r" (reg));
|
||||
return (reg);
|
||||
}
|
||||
|
||||
static inline uint64_t
|
||||
cp15_cntpct_get(void)
|
||||
{
|
||||
uint64_t reg;
|
||||
|
||||
__asm __volatile("mrrc\tp15, 0, %Q0, %R0, c14" : "=r" (reg));
|
||||
return (reg);
|
||||
}
|
||||
|
||||
#pragma weak __vdso_gettc
|
||||
u_int
|
||||
__vdso_gettc(const struct vdso_timehands *th)
|
||||
{
|
||||
uint64_t val;
|
||||
|
||||
/*
|
||||
* Userspace gettimeofday() is only enabled on ARMv7 CPUs, but
|
||||
* libc is compiled for ARMv6. Due to clang issues, .arch
|
||||
* armv7-a directive does not work.
|
||||
*/
|
||||
__asm __volatile(".word\t0xf57ff06f" : : : "memory"); /* isb */
|
||||
val = th->th_physical == 0 ? cp15_cntvct_get() : cp15_cntpct_get();
|
||||
return (val);
|
||||
}
|
||||
|
||||
#pragma weak __vdso_gettimekeep
|
||||
int
|
||||
__vdso_gettimekeep(struct vdso_timekeep **tk)
|
||||
{
|
||||
|
||||
return (_elf_aux_info(AT_TIMEKEEP, tk, sizeof(*tk)));
|
||||
}
|
@ -512,6 +512,7 @@ parse_netgrp(const char *group)
|
||||
ng[NG_DOM] == NULL ? "" : ",",
|
||||
ng[NG_DOM] == NULL ? "" : ng[NG_DOM],
|
||||
lp->l_groupname);
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
spos = strsep(&pos, ", \t");
|
||||
|
@ -31,6 +31,9 @@ __FBSDID("$FreeBSD$");
|
||||
#include "namespace.h"
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#ifdef DEBUG
|
||||
#include <inttypes.h>
|
||||
#endif
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -31,6 +31,9 @@ __FBSDID("$FreeBSD$");
|
||||
#include "namespace.h"
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#ifdef DEBUG
|
||||
#include <inttypes.h>
|
||||
#endif
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -207,7 +207,6 @@ ATF_TC_BODY(empty_NULL_buffer, tc)
|
||||
|
||||
/* Make sure NULL *linep and zero *linecapp are handled. */
|
||||
fp = mkfilebuf();
|
||||
free(line);
|
||||
line = NULL;
|
||||
linecap = 42;
|
||||
ATF_REQUIRE(getline(&line, &linecap, fp) == sizeof(apothegm) - 1);
|
||||
|
@ -94,6 +94,8 @@ _testfmt(const char *result, const char *argstr, const char *fmt,...)
|
||||
"wprintf(\"%ls\", %s) ==> [%ls], expected [%ls]\n",
|
||||
wfmt, argstr, ws, wresult);
|
||||
}
|
||||
va_end(ap);
|
||||
va_end(ap2);
|
||||
}
|
||||
|
||||
ATF_TC_WITHOUT_HEAD(int_within_limits);
|
||||
|
@ -86,6 +86,8 @@ _testfmt(const char *result, const char *argstr, const char *fmt,...)
|
||||
"wprintf(\"%ls\", %s) ==> [%ls], expected [%ls]\n",
|
||||
wfmt, argstr, ws, wresult);
|
||||
}
|
||||
va_end(ap);
|
||||
va_end(ap2);
|
||||
}
|
||||
|
||||
ATF_TC_WITHOUT_HEAD(float_within_limits);
|
||||
|
@ -13,7 +13,6 @@ DIRDEPS = \
|
||||
lib/libcom_err \
|
||||
lib/libcompiler_rt \
|
||||
lib/libpam/libpam \
|
||||
lib/libthr \
|
||||
|
||||
|
||||
.include <dirdeps.mk>
|
||||
|
@ -12,7 +12,6 @@ DIRDEPS = \
|
||||
lib/libc \
|
||||
lib/libcompiler_rt \
|
||||
lib/libpam/libpam \
|
||||
lib/libthr \
|
||||
|
||||
|
||||
.include <dirdeps.mk>
|
||||
|
@ -12,11 +12,10 @@ SRCS+= roaming_dummy.c
|
||||
|
||||
WARNS?= 3
|
||||
CFLAGS+= -I${SSHDIR} -include ssh_namespace.h
|
||||
SRCS+= ssh_namespace.h
|
||||
|
||||
LIBADD= ssh
|
||||
|
||||
.include <bsd.lib.mk>
|
||||
|
||||
.PATH: ${SSHDIR}
|
||||
|
||||
${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h
|
||||
|
@ -242,38 +242,41 @@ mkfs_msdos(const char *fname, const char *dtype, const struct msdos_options *op)
|
||||
ssize_t n;
|
||||
time_t now;
|
||||
u_int fat, bss, rds, cls, dir, lsn, x, x1, x2;
|
||||
int fd, fd1;
|
||||
int fd, fd1, rv;
|
||||
struct msdos_options o = *op;
|
||||
|
||||
img = NULL;
|
||||
rv = -1;
|
||||
|
||||
if (o.block_size && o.sectors_per_cluster) {
|
||||
warnx("Cannot specify both block size and sectors per cluster");
|
||||
return -1;
|
||||
goto done;
|
||||
}
|
||||
if (o.OEM_string && strlen(o.OEM_string) > 8) {
|
||||
warnx("%s: bad OEM string", o.OEM_string);
|
||||
return -1;
|
||||
goto done;
|
||||
}
|
||||
if (o.create_size) {
|
||||
if (o.no_create) {
|
||||
warnx("create (-C) is incompatible with -N");
|
||||
return -1;
|
||||
goto done;
|
||||
}
|
||||
fd = open(fname, O_RDWR | O_CREAT | O_TRUNC, 0644);
|
||||
if (fd == -1) {
|
||||
warnx("failed to create %s", fname);
|
||||
return -1;
|
||||
goto done;
|
||||
}
|
||||
if (ftruncate(fd, o.create_size)) {
|
||||
warnx("failed to initialize %jd bytes", (intmax_t)o.create_size);
|
||||
return -1;
|
||||
goto done;
|
||||
}
|
||||
} else if ((fd = open(fname, o.no_create ? O_RDONLY : O_RDWR)) == -1) {
|
||||
warn("%s", fname);
|
||||
return -1;
|
||||
goto done;
|
||||
}
|
||||
if (fstat(fd, &sb)) {
|
||||
warn("%s", fname);
|
||||
return -1;
|
||||
goto done;
|
||||
}
|
||||
if (o.create_size) {
|
||||
if (!S_ISREG(sb.st_mode))
|
||||
@ -284,15 +287,15 @@ mkfs_msdos(const char *fname, const char *dtype, const struct msdos_options *op)
|
||||
}
|
||||
if (!o.no_create)
|
||||
if (check_mounted(fname, sb.st_mode) == -1)
|
||||
return -1;
|
||||
goto done;
|
||||
if (o.offset && o.offset != lseek(fd, o.offset, SEEK_SET)) {
|
||||
warnx("cannot seek to %jd", (intmax_t)o.offset);
|
||||
return -1;
|
||||
goto done;
|
||||
}
|
||||
memset(&bpb, 0, sizeof(bpb));
|
||||
if (o.floppy) {
|
||||
if (getstdfmt(o.floppy, &bpb) == -1)
|
||||
return -1;
|
||||
goto done;
|
||||
bpb.bpbHugeSectors = bpb.bpbSectors;
|
||||
bpb.bpbSectors = 0;
|
||||
bpb.bpbBigFATsecs = bpb.bpbFATsecs;
|
||||
@ -334,17 +337,17 @@ mkfs_msdos(const char *fname, const char *dtype, const struct msdos_options *op)
|
||||
}
|
||||
if (!powerof2(bpb.bpbBytesPerSec)) {
|
||||
warnx("bytes/sector (%u) is not a power of 2", bpb.bpbBytesPerSec);
|
||||
return -1;
|
||||
goto done;
|
||||
}
|
||||
if (bpb.bpbBytesPerSec < MINBPS) {
|
||||
warnx("bytes/sector (%u) is too small; minimum is %u",
|
||||
bpb.bpbBytesPerSec, MINBPS);
|
||||
return -1;
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (o.volume_label && !oklabel(o.volume_label)) {
|
||||
warnx("%s: bad volume label", o.volume_label);
|
||||
return -1;
|
||||
goto done;
|
||||
}
|
||||
if (!(fat = o.fat_type)) {
|
||||
if (o.floppy)
|
||||
@ -356,29 +359,29 @@ mkfs_msdos(const char *fname, const char *dtype, const struct msdos_options *op)
|
||||
warnx("-%c is not a legal FAT%s option",
|
||||
fat == 32 ? 'e' : o.info_sector ? 'i' : 'k',
|
||||
fat == 32 ? "32" : "12/16");
|
||||
return -1;
|
||||
goto done;
|
||||
}
|
||||
if (o.floppy && fat == 32)
|
||||
bpb.bpbRootDirEnts = 0;
|
||||
if (fat != 0 && fat != 12 && fat != 16 && fat != 32) {
|
||||
warnx("%d: bad FAT type", fat);
|
||||
return -1;
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (o.block_size) {
|
||||
if (!powerof2(o.block_size)) {
|
||||
warnx("block size (%u) is not a power of 2", o.block_size);
|
||||
return -1;
|
||||
goto done;
|
||||
}
|
||||
if (o.block_size < bpb.bpbBytesPerSec) {
|
||||
warnx("block size (%u) is too small; minimum is %u",
|
||||
o.block_size, bpb.bpbBytesPerSec);
|
||||
return -1;
|
||||
goto done;
|
||||
}
|
||||
if (o.block_size > bpb.bpbBytesPerSec * MAXSPC) {
|
||||
warnx("block size (%u) is too large; maximum is %u",
|
||||
o.block_size, bpb.bpbBytesPerSec * MAXSPC);
|
||||
return -1;
|
||||
goto done;
|
||||
}
|
||||
bpb.bpbSecPerClust = o.block_size / bpb.bpbBytesPerSec;
|
||||
}
|
||||
@ -386,7 +389,7 @@ mkfs_msdos(const char *fname, const char *dtype, const struct msdos_options *op)
|
||||
if (!powerof2(o.sectors_per_cluster)) {
|
||||
warnx("sectors/cluster (%u) is not a power of 2",
|
||||
o.sectors_per_cluster);
|
||||
return -1;
|
||||
goto done;
|
||||
}
|
||||
bpb.bpbSecPerClust = o.sectors_per_cluster;
|
||||
}
|
||||
@ -396,7 +399,7 @@ mkfs_msdos(const char *fname, const char *dtype, const struct msdos_options *op)
|
||||
if (o.num_FAT > MAXNFT) {
|
||||
warnx("number of FATs (%u) is too large; maximum is %u",
|
||||
o.num_FAT, MAXNFT);
|
||||
return -1;
|
||||
goto done;
|
||||
}
|
||||
bpb.bpbFATs = o.num_FAT;
|
||||
}
|
||||
@ -405,7 +408,7 @@ mkfs_msdos(const char *fname, const char *dtype, const struct msdos_options *op)
|
||||
if (o.media_descriptor_set) {
|
||||
if (o.media_descriptor < 0xf0) {
|
||||
warnx("illegal media descriptor (%#x)", o.media_descriptor);
|
||||
return -1;
|
||||
goto done;
|
||||
}
|
||||
bpb.bpbMedia = o.media_descriptor;
|
||||
}
|
||||
@ -424,18 +427,18 @@ mkfs_msdos(const char *fname, const char *dtype, const struct msdos_options *op)
|
||||
snprintf(buf, sizeof(buf), "/boot/%s", bname);
|
||||
if (!(bname = strdup(buf))) {
|
||||
warn(NULL);
|
||||
return -1;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
if ((fd1 = open(bname, O_RDONLY)) == -1 || fstat(fd1, &sb)) {
|
||||
warn("%s", bname);
|
||||
return -1;
|
||||
goto done;
|
||||
}
|
||||
if (!S_ISREG(sb.st_mode) || sb.st_size % bpb.bpbBytesPerSec ||
|
||||
sb.st_size < bpb.bpbBytesPerSec ||
|
||||
sb.st_size > bpb.bpbBytesPerSec * MAXU16) {
|
||||
warnx("%s: inappropriate file type or format", bname);
|
||||
return -1;
|
||||
goto done;
|
||||
}
|
||||
bss = sb.st_size / bpb.bpbBytesPerSec;
|
||||
}
|
||||
@ -470,7 +473,7 @@ mkfs_msdos(const char *fname, const char *dtype, const struct msdos_options *op)
|
||||
if (!bpb.bpbFSInfo) {
|
||||
if (x == MAXU16 || x == bpb.bpbBackup) {
|
||||
warnx("no room for info sector");
|
||||
return -1;
|
||||
goto done;
|
||||
}
|
||||
bpb.bpbFSInfo = x;
|
||||
}
|
||||
@ -479,12 +482,12 @@ mkfs_msdos(const char *fname, const char *dtype, const struct msdos_options *op)
|
||||
if (!bpb.bpbBackup) {
|
||||
if (x == MAXU16) {
|
||||
warnx("no room for backup sector");
|
||||
return -1;
|
||||
goto done;
|
||||
}
|
||||
bpb.bpbBackup = x;
|
||||
} else if (bpb.bpbBackup != MAXU16 && bpb.bpbBackup == bpb.bpbFSInfo) {
|
||||
warnx("backup sector would overwrite info sector");
|
||||
return -1;
|
||||
goto done;
|
||||
}
|
||||
if (bpb.bpbBackup != MAXU16 && x <= bpb.bpbBackup)
|
||||
x = bpb.bpbBackup + 1;
|
||||
@ -495,7 +498,7 @@ mkfs_msdos(const char *fname, const char *dtype, const struct msdos_options *op)
|
||||
else if (bpb.bpbResSectors < x) {
|
||||
warnx("too few reserved sectors (need %d have %d)", x,
|
||||
bpb.bpbResSectors);
|
||||
return -1;
|
||||
goto done;
|
||||
}
|
||||
if (fat != 32 && !bpb.bpbRootDirEnts)
|
||||
bpb.bpbRootDirEnts = DEFRDE;
|
||||
@ -515,13 +518,13 @@ mkfs_msdos(const char *fname, const char *dtype, const struct msdos_options *op)
|
||||
continue;
|
||||
if (fat != 32 && bpb.bpbBigFATsecs > MAXU16) {
|
||||
warnx("too many sectors/FAT for FAT12/16");
|
||||
return -1;
|
||||
goto done;
|
||||
}
|
||||
x1 = bpb.bpbResSectors + rds;
|
||||
x = bpb.bpbBigFATsecs ? bpb.bpbBigFATsecs : 1;
|
||||
if (x1 + (u_int64_t)x * bpb.bpbFATs > bpb.bpbHugeSectors) {
|
||||
warnx("meta data exceeds file system size");
|
||||
return -1;
|
||||
goto done;
|
||||
}
|
||||
x1 += x * bpb.bpbFATs;
|
||||
x = (u_int64_t)(bpb.bpbHugeSectors - x1) * bpb.bpbBytesPerSec * NPB /
|
||||
@ -544,7 +547,7 @@ mkfs_msdos(const char *fname, const char *dtype, const struct msdos_options *op)
|
||||
if (cls < mincls(fat)) {
|
||||
warnx("%u clusters too few clusters for FAT%u, need %u", cls, fat,
|
||||
mincls(fat));
|
||||
return -1;
|
||||
goto done;
|
||||
}
|
||||
if (cls > maxcls(fat)) {
|
||||
cls = maxcls(fat);
|
||||
@ -575,7 +578,7 @@ mkfs_msdos(const char *fname, const char *dtype, const struct msdos_options *op)
|
||||
tm = localtime(&now);
|
||||
if (!(img = malloc(bpb.bpbBytesPerSec))) {
|
||||
warn(NULL);
|
||||
return -1;
|
||||
goto done;
|
||||
}
|
||||
dir = bpb.bpbResSectors + (bpb.bpbFATsecs ? bpb.bpbFATsecs :
|
||||
bpb.bpbBigFATsecs) * bpb.bpbFATs;
|
||||
@ -583,7 +586,7 @@ mkfs_msdos(const char *fname, const char *dtype, const struct msdos_options *op)
|
||||
si_sa.sa_handler = infohandler;
|
||||
if (sigaction(SIGINFO, &si_sa, NULL) == -1) {
|
||||
warn("sigaction SIGINFO");
|
||||
return -1;
|
||||
goto done;
|
||||
}
|
||||
for (lsn = 0; lsn < dir + (fat == 32 ? bpb.bpbSecPerClust : rds); lsn++) {
|
||||
if (got_siginfo) {
|
||||
@ -601,17 +604,17 @@ mkfs_msdos(const char *fname, const char *dtype, const struct msdos_options *op)
|
||||
x -= bpb.bpbBackup;
|
||||
if (!x && lseek(fd1, o.offset, SEEK_SET)) {
|
||||
warn("%s", bname);
|
||||
return -1;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
if (o.bootstrap && x < bss) {
|
||||
if ((n = read(fd1, img, bpb.bpbBytesPerSec)) == -1) {
|
||||
warn("%s", bname);
|
||||
return -1;
|
||||
goto done;
|
||||
}
|
||||
if ((unsigned)n != bpb.bpbBytesPerSec) {
|
||||
warnx("%s: can't read sector %u", bname, x);
|
||||
return -1;
|
||||
goto done;
|
||||
}
|
||||
} else
|
||||
memset(img, 0, bpb.bpbBytesPerSec);
|
||||
@ -701,15 +704,19 @@ mkfs_msdos(const char *fname, const char *dtype, const struct msdos_options *op)
|
||||
}
|
||||
if ((n = write(fd, img, bpb.bpbBytesPerSec)) == -1) {
|
||||
warn("%s", fname);
|
||||
return -1;
|
||||
goto done;
|
||||
}
|
||||
if ((unsigned)n != bpb.bpbBytesPerSec) {
|
||||
warnx("%s: can't write sector %u", fname, lsn);
|
||||
return -1;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
rv = 0;
|
||||
done:
|
||||
free(img);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -642,6 +642,7 @@ run_cmd(int *ofd, const char *cmdline, ...)
|
||||
rv = vasprintf(&cmd, cmdline, ap);
|
||||
if (rv == -1) {
|
||||
warn("%s", __func__);
|
||||
va_end(ap);
|
||||
return (rv);
|
||||
}
|
||||
va_end(ap);
|
||||
|
@ -38,9 +38,11 @@ LIBADD+= ldns
|
||||
.endif
|
||||
|
||||
CFLAGS+= -I${SSHDIR} -include ssh_namespace.h
|
||||
SRCS+= ssh_namespace.h
|
||||
|
||||
.if ${MK_KERBEROS_SUPPORT} != "no"
|
||||
CFLAGS+= -include krb5_config.h
|
||||
SRCS+= krb5_config.h
|
||||
.endif
|
||||
|
||||
NO_LINT=
|
||||
@ -50,8 +52,3 @@ LIBADD+= crypto crypt z
|
||||
.include <bsd.lib.mk>
|
||||
|
||||
.PATH: ${SSHDIR} ${SSHDIR}/openbsd-compat
|
||||
|
||||
${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h
|
||||
.if ${MK_KERBEROS_SUPPORT} != "no"
|
||||
${OBJS} ${POBJS} ${SOBJS}: krb5_config.h
|
||||
.endif
|
||||
|
@ -6,6 +6,7 @@ PROG= sftp-server
|
||||
SRCS= sftp-server.c sftp-common.c sftp-server-main.c
|
||||
MAN= sftp-server.8
|
||||
CFLAGS+=-I${SSHDIR} -include ssh_namespace.h
|
||||
SRCS+= ssh_namespace.h
|
||||
|
||||
.if !defined(NO_SHARED)
|
||||
# required when linking with a dynamic libssh
|
||||
@ -23,5 +24,3 @@ CFLAGS+= -DHAVE_LDNS=1
|
||||
.include <bsd.prog.mk>
|
||||
|
||||
.PATH: ${SSHDIR}
|
||||
|
||||
${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h
|
||||
|
@ -6,6 +6,7 @@ PROG= ssh-keysign
|
||||
SRCS= ssh-keysign.c roaming_dummy.c readconf.c
|
||||
MAN= ssh-keysign.8
|
||||
CFLAGS+=-I${SSHDIR} -include ssh_namespace.h
|
||||
SRCS+= ssh_namespace.h
|
||||
BINMODE=4555
|
||||
|
||||
LIBADD= ssh
|
||||
@ -21,5 +22,3 @@ LIBADD+= crypto
|
||||
.include <bsd.prog.mk>
|
||||
|
||||
.PATH: ${SSHDIR}
|
||||
|
||||
${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h
|
||||
|
@ -6,6 +6,7 @@ PROG= ssh-pkcs11-helper
|
||||
SRCS= ssh-pkcs11.c ssh-pkcs11-helper.c
|
||||
MAN= ssh-pkcs11-helper.8
|
||||
CFLAGS+=-I${SSHDIR} -include ssh_namespace.h
|
||||
SRCS+= ssh_namespace.h
|
||||
|
||||
.if !defined(NO_SHARED)
|
||||
# required when linking with a dynamic libssh
|
||||
@ -25,5 +26,3 @@ LIBADD+= crypto
|
||||
.include <bsd.prog.mk>
|
||||
|
||||
.PATH: ${SSHDIR}
|
||||
|
||||
${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h
|
||||
|
@ -5,6 +5,7 @@
|
||||
PROG= scp
|
||||
SRCS= scp.c
|
||||
CFLAGS+=-I${SSHDIR} -include ssh_namespace.h
|
||||
SRCS+= ssh_namespace.h
|
||||
|
||||
.if !defined(NO_SHARED)
|
||||
# required when linking with a dynamic libssh
|
||||
@ -22,5 +23,3 @@ CFLAGS+= -DHAVE_LDNS=1
|
||||
.include <bsd.prog.mk>
|
||||
|
||||
.PATH: ${SSHDIR}
|
||||
|
||||
${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h
|
||||
|
@ -5,6 +5,7 @@
|
||||
PROG= sftp
|
||||
SRCS= sftp.c sftp-client.c sftp-common.c sftp-glob.c progressmeter.c
|
||||
CFLAGS+=-I${SSHDIR} -include ssh_namespace.h
|
||||
SRCS+= ssh_namespace.h
|
||||
|
||||
.if !defined(NO_SHARED)
|
||||
# required when linking with a dynamic libssh
|
||||
@ -22,5 +23,3 @@ CFLAGS+= -DHAVE_LDNS=1
|
||||
.include <bsd.prog.mk>
|
||||
|
||||
.PATH: ${SSHDIR}
|
||||
|
||||
${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h
|
||||
|
@ -5,6 +5,7 @@
|
||||
PROG= ssh-add
|
||||
SRCS+= ssh-add.c
|
||||
CFLAGS+=-I${SSHDIR} -include ssh_namespace.h
|
||||
SRCS+= ssh_namespace.h
|
||||
|
||||
.if !defined(NO_SHARED)
|
||||
# required when linking with a dynamic libssh
|
||||
@ -22,5 +23,3 @@ CFLAGS+= -DHAVE_LDNS=1
|
||||
.include <bsd.prog.mk>
|
||||
|
||||
.PATH: ${SSHDIR}
|
||||
|
||||
${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h
|
||||
|
@ -5,6 +5,7 @@
|
||||
PROG= ssh-agent
|
||||
SRCS= ssh-agent.c
|
||||
CFLAGS+=-I${SSHDIR} -include ssh_namespace.h
|
||||
SRCS+= ssh_namespace.h
|
||||
|
||||
.if !defined(NO_SHARED)
|
||||
# required when linking with a dynamic libssh
|
||||
@ -24,5 +25,3 @@ LIBADD+= crypto
|
||||
.include <bsd.prog.mk>
|
||||
|
||||
.PATH: ${SSHDIR}
|
||||
|
||||
${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h
|
||||
|
@ -5,6 +5,7 @@
|
||||
PROG= ssh-keygen
|
||||
SRCS= ssh-keygen.c
|
||||
CFLAGS+=-I${SSHDIR} -include ssh_namespace.h
|
||||
SRCS+= ssh_namespace.h
|
||||
|
||||
.if !defined(NO_SHARED)
|
||||
# required when linking with a dynamic libssh
|
||||
@ -22,5 +23,3 @@ LIBADD+= crypto
|
||||
.include <bsd.prog.mk>
|
||||
|
||||
.PATH: ${SSHDIR}
|
||||
|
||||
${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h
|
||||
|
@ -5,6 +5,7 @@
|
||||
PROG= ssh-keyscan
|
||||
SRCS= ssh-keyscan.c roaming_dummy.c
|
||||
CFLAGS+=-I${SSHDIR} -include ssh_namespace.h
|
||||
SRCS+= ssh_namespace.h
|
||||
|
||||
LIBADD= ssh
|
||||
|
||||
@ -17,5 +18,3 @@ CFLAGS+= -DHAVE_LDNS=1
|
||||
.include <bsd.prog.mk>
|
||||
|
||||
.PATH: ${SSHDIR}
|
||||
|
||||
${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h
|
||||
|
@ -3,7 +3,6 @@
|
||||
.include <src.opts.mk>
|
||||
|
||||
PROG= ssh
|
||||
CFLAGS+=-I${SSHDIR} -include ssh_namespace.h
|
||||
LINKS= ${BINDIR}/ssh ${BINDIR}/slogin
|
||||
MAN= ssh.1 ssh_config.5
|
||||
MLINKS= ssh.1 slogin.1
|
||||
@ -15,6 +14,9 @@ SRCS= ssh.c readconf.c clientloop.c sshtty.c \
|
||||
# gss-genr.c really belongs in libssh; see src/secure/lib/libssh/Makefile
|
||||
SRCS+= gss-genr.c
|
||||
|
||||
CFLAGS+=-I${SSHDIR} -include ssh_namespace.h
|
||||
SRCS+= ssh_namespace.h
|
||||
|
||||
LIBADD= ssh
|
||||
|
||||
.if ${MK_LDNS} != "no"
|
||||
@ -23,6 +25,7 @@ CFLAGS+= -DHAVE_LDNS=1
|
||||
|
||||
.if ${MK_KERBEROS_SUPPORT} != "no"
|
||||
CFLAGS+= -include krb5_config.h
|
||||
SRCS+= krb5_config.h
|
||||
LIBADD+= gssapi
|
||||
.endif
|
||||
|
||||
@ -35,8 +38,3 @@ CFLAGS+= -DXAUTH_PATH=\"${LOCALBASE}/bin/xauth\"
|
||||
.include <bsd.prog.mk>
|
||||
|
||||
.PATH: ${SSHDIR}
|
||||
|
||||
${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h
|
||||
.if ${MK_KERBEROS_SUPPORT} != "no"
|
||||
${OBJS} ${POBJS} ${SOBJS}: krb5_config.h
|
||||
.endif
|
||||
|
@ -24,6 +24,7 @@ SRCS+= gss-genr.c
|
||||
|
||||
MAN= sshd.8 sshd_config.5
|
||||
CFLAGS+=-I${SSHDIR} -include ssh_namespace.h
|
||||
SRCS+= ssh_namespace.h
|
||||
|
||||
# pam should always happen before ssh here for static linking
|
||||
LIBADD= pam ssh util wrap
|
||||
@ -41,6 +42,7 @@ LIBADD+= bsm
|
||||
|
||||
.if ${MK_KERBEROS_SUPPORT} != "no"
|
||||
CFLAGS+= -include krb5_config.h
|
||||
SRCS+= krb5_config.h
|
||||
LIBADD+= gssapi_krb5 gssapi krb5
|
||||
.endif
|
||||
|
||||
@ -53,8 +55,3 @@ CFLAGS+= -DXAUTH_PATH=\"${LOCALBASE}/bin/xauth\"
|
||||
.include <bsd.prog.mk>
|
||||
|
||||
.PATH: ${SSHDIR}
|
||||
|
||||
${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h
|
||||
.if ${MK_KERBEROS_SUPPORT} != "no"
|
||||
${OBJS} ${POBJS} ${SOBJS}: krb5_config.h
|
||||
.endif
|
||||
|
@ -32,7 +32,7 @@
|
||||
# Intel x86 architecture:
|
||||
# (AMD CPUs) amdfam10, opteron-sse3, athlon64-sse3, k8-sse3,
|
||||
# opteron, athlon64, athlon-fx, k8, athlon-mp,
|
||||
# athlen-xp, athlon-4, athlon-tbird, athlon, k7,
|
||||
# athlon-xp, athlon-4, athlon-tbird, athlon, k7,
|
||||
# geode, k6-3, k6-2, k6
|
||||
# (Intel CPUs) core2, core, nocona, pentium4m, pentium4, prescott,
|
||||
# pentium3m, pentium3, pentium-m, pentium2,
|
||||
|
@ -1,7 +1,7 @@
|
||||
.\" DO NOT EDIT-- this file is automatically generated.
|
||||
.\" from FreeBSD: head/tools/build/options/makeman 291414 2015-11-28 00:41:37Z ume
|
||||
.\" $FreeBSD$
|
||||
.Dd November 28, 2015
|
||||
.Dd December 8, 2015
|
||||
.Dt SRC.CONF 5
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -452,14 +452,10 @@ When set, it also enforces the following options:
|
||||
.It
|
||||
.Va WITHOUT_GROFF
|
||||
.El
|
||||
.It Va WITH_DEBUG_FILES
|
||||
.\" from FreeBSD: head/tools/build/options/WITH_DEBUG_FILES 251512 2013-06-07 21:40:02Z emaste
|
||||
Set to strip debug info into a separate file for each executable binary
|
||||
and shared library.
|
||||
The debug files will be placed in a subdirectory of
|
||||
.Pa /usr/lib/debug
|
||||
and are located automatically by
|
||||
.Xr gdb 1 .
|
||||
.It Va WITHOUT_DEBUG_FILES
|
||||
.\" from FreeBSD: head/tools/build/options/WITHOUT_DEBUG_FILES 290059 2015-10-27 20:49:56Z emaste
|
||||
Set to avoid building or installing standalone debug files for each
|
||||
executable binary and shared library.
|
||||
.It Va WITHOUT_DICT
|
||||
.\" from FreeBSD: head/tools/build/options/WITHOUT_DICT 156932 2006-03-21 07:50:50Z ru
|
||||
Set to not build the Webster dictionary files.
|
||||
|
@ -369,7 +369,7 @@ variables are relevant only to virtual machine disk image builds:
|
||||
Set to a non-null value to build virtual machine disk images as part
|
||||
of the release build.
|
||||
.Va WITH_VMIMAGES
|
||||
may also be specified as an envirionment variable passed to
|
||||
may also be specified as an environment variable passed to
|
||||
.Xr make 1 .
|
||||
.Pp
|
||||
The option requires
|
||||
@ -528,7 +528,7 @@ The
|
||||
target requires the
|
||||
.Va WITH_VMIMAGES
|
||||
.Xr make 1
|
||||
envirionment variable to be set to a non-null value.
|
||||
environment variable to be set to a non-null value.
|
||||
.It Cm vm-cloudware
|
||||
Builds
|
||||
.Fx
|
||||
|
@ -26,20 +26,22 @@
|
||||
.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
.\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.Dd April 13, 2014
|
||||
.Dd December 5, 2015
|
||||
.Dt TESTS 7
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm tests
|
||||
.Nd introduction to the FreeBSD Test Suite
|
||||
.Nd introduction to the
|
||||
.Fx
|
||||
Test Suite
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Fx
|
||||
Test Suite provides a collection of automated tests for two major purposes.
|
||||
On one hand, the test suite aids
|
||||
.Em developers
|
||||
to detect bugs and regressions when they modify the source tree. On the other
|
||||
hand, it allows
|
||||
to detect bugs and regressions when they modify the source tree.
|
||||
On the other hand, it allows
|
||||
.Em end users
|
||||
(and, in particular, system administrators) to verify that fresh installations
|
||||
of the
|
||||
@ -164,23 +166,26 @@ Test Suite:
|
||||
.Bl -tag -width "allow_sysctl_side_effects"
|
||||
.It allow_devfs_side_effects
|
||||
If defined, enables tests that may destroy and recreate semipermanent device
|
||||
nodes, like disk devices. Without this variable, tests may still create and
|
||||
destroy devices nodes that are normally transient, like /dev/tap* and
|
||||
/dev/pts*, as long as they clean them up afterwards. However, tests that
|
||||
require this variable have a relaxed cleanup requirement; they must recreate
|
||||
any devices that they destroyed, but not necessarily with the same devnames.
|
||||
nodes, like disk devices.
|
||||
Without this variable, tests may still create and destroy devices nodes that
|
||||
are normally transient, like /dev/tap* and /dev/pts*, as long as they clean
|
||||
them up afterwards.
|
||||
However, tests that require this variable have a relaxed cleanup requirement;
|
||||
they must recreate any devices that they destroyed, but not necessarily with
|
||||
the same devnames.
|
||||
.It allow_sysctl_side_effects
|
||||
Enables tests that change globally significant
|
||||
.Xr sysctl 8
|
||||
variables. The tests will undo any changes in their cleanup phases.
|
||||
variables.
|
||||
The tests will undo any changes in their cleanup phases.
|
||||
.It disks
|
||||
Must be set to a space delimited list of disk device nodes. Tests that need
|
||||
destructive access to disks must use these devices. Tests are not required to
|
||||
preserve any data present on these disks.
|
||||
Must be set to a space delimited list of disk device nodes.
|
||||
Tests that need destructive access to disks must use these devices.
|
||||
Tests are not required to preserve any data present on these disks.
|
||||
.It fibs
|
||||
Must be set to a space delimited list of FIBs (routing tables). Tests that
|
||||
need to modify a routing table may use any of these. Tests will cleanup any
|
||||
new routes that they create.
|
||||
Must be set to a space delimited list of FIBs (routing tables).
|
||||
Tests that need to modify a routing table may use any of these.
|
||||
Tests will cleanup any new routes that they create.
|
||||
.El
|
||||
.Ss What to do if something fails?
|
||||
If there is
|
||||
|
@ -239,6 +239,7 @@ MAN= accept_filter.9 \
|
||||
printf.9 \
|
||||
prison_check.9 \
|
||||
priv.9 \
|
||||
proc_rwmem.9 \
|
||||
pseudofs.9 \
|
||||
psignal.9 \
|
||||
random.9 \
|
||||
@ -1053,6 +1054,7 @@ MLINKS+=\
|
||||
mbuf.9 m_cat.9 \
|
||||
mbuf.9 MCHTYPE.9 \
|
||||
mbuf.9 MCLGET.9 \
|
||||
mbuf.9 m_collapse.9 \
|
||||
mbuf.9 m_copyback.9 \
|
||||
mbuf.9 m_copydata.9 \
|
||||
mbuf.9 m_copym.9 \
|
||||
@ -1339,6 +1341,8 @@ MLINKS+=printf.9 log.9 \
|
||||
printf.9 uprintf.9
|
||||
MLINKS+=priv.9 priv_check.9 \
|
||||
priv.9 priv_check_cred.9
|
||||
MLINKS+=proc_rwmem.9 proc_readmem.9 \
|
||||
proc_rwmem.9 proc_writemem.9
|
||||
MLINKS+=psignal.9 gsignal.9 \
|
||||
psignal.9 pgsignal.9 \
|
||||
psignal.9 tdsignal.9
|
||||
|
@ -24,7 +24,7 @@
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd November 1, 2006
|
||||
.Dd December 7, 2015
|
||||
.Dt G_BIO 9
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -253,7 +253,7 @@ example_start(struct bio *bp)
|
||||
/* Ok, schedule it down. */
|
||||
/*
|
||||
* The consumer can be obtained from
|
||||
* LIST_FIRST(&bp->bio_to->geom->consumers) as well,
|
||||
* LIST_FIRST(&bp->bio_to->geom->consumer) as well,
|
||||
* if there is only one in our geom.
|
||||
*/
|
||||
g_io_request(cbp, sc->ex_consumer);
|
||||
|
104
share/man/man9/proc_rwmem.9
Normal file
104
share/man/man9/proc_rwmem.9
Normal file
@ -0,0 +1,104 @@
|
||||
.\"
|
||||
.\" Copyright (c) 2015 Mark Johnston <markj@FreeBSD.org>
|
||||
.\"
|
||||
.\" 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
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd December 7, 2015
|
||||
.Dt PROC_RWMEM 9
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm proc_rwmem ,
|
||||
.Nm proc_readmem ,
|
||||
.Nm proc_writemem
|
||||
.Nd read from or write to a process address space
|
||||
.Sh SYNOPSIS
|
||||
.In sys/types.h
|
||||
.In sys/ptrace.h
|
||||
.Ft int
|
||||
.Fn proc_rwmem "struct proc *p" "struct uio *uio"
|
||||
.Ft ssize_t
|
||||
.Fn proc_readmem "struct thread *td" "struct proc *p" "vm_offset_t va" "void *buf" "size_t len"
|
||||
.Ft ssize_t
|
||||
.Fn proc_writemem "struct thread *td" "struct proc *p" "vm_offset_t va" "void *buf" "size_t len"
|
||||
.Sh DESCRIPTION
|
||||
These functions are used to read to or write from the address space of the
|
||||
process
|
||||
.Fa p .
|
||||
The
|
||||
.Fn proc_rwmem
|
||||
function requires the caller to specify the I/O parameters using a
|
||||
.Vt "struct uio" ,
|
||||
described in
|
||||
.Xr uio 9 .
|
||||
The
|
||||
.Fn proc_readmem
|
||||
and
|
||||
.Fn proc_writemem
|
||||
functions provide a simpler, less general interface which allows the caller to
|
||||
read into or write the kernel buffer
|
||||
.Fa buf
|
||||
of size
|
||||
.Fa len
|
||||
from or to the memory at offset
|
||||
.Fa va
|
||||
in the address space of
|
||||
.Fa p .
|
||||
The operation is performed on behalf of thread
|
||||
.Fa td ,
|
||||
which will most often be the current thread.
|
||||
.Pp
|
||||
These functions may sleep and thus may not be called with any non-sleepable
|
||||
locks held.
|
||||
The process
|
||||
.Fa p
|
||||
must be held by the caller using
|
||||
.Xr PHOLD 9 .
|
||||
.Sh RETURN VALUES
|
||||
The
|
||||
.Fn proc_rwmem
|
||||
function returns
|
||||
.Dv 0
|
||||
on success.
|
||||
.Dv EFAULT
|
||||
is returned if the specified user address is invalid, and
|
||||
.Dv ENOMEM
|
||||
is returned if the target pages could not be faulted in due to a resource
|
||||
shortage.
|
||||
.Pp
|
||||
The
|
||||
.Fn proc_readmem
|
||||
and
|
||||
.Fn proc_writemem
|
||||
functions return the number of bytes read or written, respectively.
|
||||
This may be smaller than the number of bytes requested, for example if the
|
||||
request spans multiple pages in the process address space and one of them after
|
||||
the first is not mapped.
|
||||
Otherwise, -1 is returned.
|
||||
.Sh SEE ALSO
|
||||
.Xr copyin 9 ,
|
||||
.Xr locking 9 ,
|
||||
.Xr PHOLD 9 ,
|
||||
.Xr uio 9
|
||||
.Sh AUTHORS
|
||||
This manual page was written by
|
||||
.An Mark Johnston Aq Mt markj@FreeBSD.org .
|
@ -335,6 +335,7 @@ FreeBSD 5.2 | | | |
|
||||
| 10.2 | | | |
|
||||
| OS X NetBSD 7.0 | |
|
||||
| 10.11 | OpenBSD 5.8 |
|
||||
| | | | DragonFly 4.4.1
|
||||
| | | | |
|
||||
FreeBSD 11 -current | NetBSD -current OpenBSD -current DragonFly -current
|
||||
| | | | |
|
||||
@ -681,6 +682,7 @@ FreeBSD 10.2 2015-08-13 [FBD]
|
||||
NetBSD 7.0 2015-09-25 [NBD]
|
||||
OS X 10.11 2015-09-30 [APL]
|
||||
OpenBSD 5.8 2015-10-18 [OBD]
|
||||
DragonFly 4.4.1 2015-12-07 [DFB]
|
||||
|
||||
Bibliography
|
||||
------------------------
|
||||
|
@ -22,29 +22,6 @@ ATF_TESTS_C?=
|
||||
ATF_TESTS_CXX?=
|
||||
ATF_TESTS_SH?=
|
||||
|
||||
# Path to the prefix of the installed ATF tools, if any.
|
||||
#
|
||||
# If atf-run and atf-report are installed from ports, we automatically define a
|
||||
# realcheck target below to run the tests using these tools. The tools are
|
||||
# searched for in the hierarchy specified by this variable.
|
||||
ATF_PREFIX?= /usr/local
|
||||
|
||||
# C compiler passed to ATF tests that need to build code.
|
||||
ATF_BUILD_CC?= ${DESTDIR}/usr/bin/cc
|
||||
TESTS_ENV+= ATF_BUILD_CC=${ATF_BUILD_CC}
|
||||
|
||||
# C preprocessor passed to ATF tests that need to build code.
|
||||
ATF_BUILD_CPP?= ${DESTDIR}/usr/bin/cpp
|
||||
TESTS_ENV+= ATF_BUILD_CPP=${ATF_BUILD_CPP}
|
||||
|
||||
# C++ compiler passed to ATF tests that need to build code.
|
||||
ATF_BUILD_CXX?= ${DESTDIR}/usr/bin/c++
|
||||
TESTS_ENV+= ATF_BUILD_CXX=${ATF_BUILD_CXX}
|
||||
|
||||
# Shell interpreter used to run atf-sh(1) based tests.
|
||||
ATF_SHELL?= ${DESTDIR}/bin/sh
|
||||
TESTS_ENV+= ATF_SHELL=${ATF_SHELL}
|
||||
|
||||
.if !empty(ATF_TESTS_C)
|
||||
PROGS+= ${ATF_TESTS_C}
|
||||
_TESTS+= ${ATF_TESTS_C}
|
||||
|
@ -30,6 +30,7 @@ __<bsd.compiler.mk>__:
|
||||
# Handle ccache after CC is determined, but not if CC/CXX are already
|
||||
# overridden with a manual setup.
|
||||
.if ${MK_CCACHE_BUILD:Uno} == "yes" && \
|
||||
!make(showconfig) && \
|
||||
(${CC:M*ccache/world/*} == "" || ${CXX:M*ccache/world/*} == "")
|
||||
# CC is always prepended with the ccache wrapper rather than modifying
|
||||
# PATH since it is more clear that ccache is used and avoids wasting time
|
||||
@ -63,8 +64,10 @@ CCACHE_COMPILERCHECK?= mtime
|
||||
# Remove ccache from the PATH to prevent double calls and wasted CPP/LD time.
|
||||
PATH:= ${PATH:C,:?${CCACHE_WRAPPER_PATH}(/world)?(:$)?,,g}
|
||||
# Ensure no bogus CCACHE_PATH leaks in which might avoid the in-tree compiler.
|
||||
.if !empty(CCACHE_PATH)
|
||||
CCACHE_PATH=
|
||||
.export CCACHE_PATH
|
||||
.endif
|
||||
# Override various toolchain vars.
|
||||
.for var in CC CXX HOST_CC HOST_CXX
|
||||
.if defined(${var}) && ${${var}:M${CCACHE_BIN}} == ""
|
||||
|
@ -57,23 +57,6 @@ _MKDEPCC+= ${DEPFLAGS}
|
||||
MKDEPCMD?= CC='${_MKDEPCC}' mkdep
|
||||
DEPENDFILE?= .depend
|
||||
DEPENDFILES= ${DEPENDFILE}
|
||||
.if ${MK_FAST_DEPEND} == "yes" && ${.MAKE.MODE:Unormal:Mmeta*} == ""
|
||||
DEPENDFILES+= ${DEPENDFILE}.*
|
||||
DEPEND_MP?= -MP
|
||||
# Handle OBJS=../somefile.o hacks. Just replace '/' rather than use :T to
|
||||
# avoid collisions.
|
||||
DEPEND_FILTER= C,/,_,g
|
||||
DEPEND_CFLAGS+= -MD ${DEPEND_MP} -MF${DEPENDFILE}.${.TARGET:${DEPEND_FILTER}}
|
||||
DEPEND_CFLAGS+= -MT${.TARGET}
|
||||
CFLAGS+= ${DEPEND_CFLAGS}
|
||||
DEPENDOBJS+= ${OBJS} ${POBJS} ${SOBJS}
|
||||
.for __obj in ${DEPENDOBJS:O:u}
|
||||
.if ${.MAKEFLAGS:M-V} == ""
|
||||
.sinclude "${DEPENDFILE}.${__obj:${DEPEND_FILTER}}"
|
||||
.endif
|
||||
DEPENDFILES_OBJS+= ${DEPENDFILE}.${__obj:${DEPEND_FILTER}}
|
||||
.endfor
|
||||
.endif # ${MK_FAST_DEPEND} == "yes"
|
||||
|
||||
# Keep `tags' here, before SRCS are mangled below for `depend'.
|
||||
.if !target(tags) && defined(SRCS) && !defined(NO_TAGS)
|
||||
@ -165,7 +148,36 @@ ${_D}.po: ${_DSRC} ${POBJS:S/^${_D}.po$//}
|
||||
.endfor
|
||||
beforedepend: ${DHDRS}
|
||||
beforebuild: ${DHDRS}
|
||||
|
||||
|
||||
.if ${MK_FAST_DEPEND} == "yes" && ${.MAKE.MODE:Unormal:Mmeta*} == ""
|
||||
DEPENDFILES+= ${DEPENDFILE}.*
|
||||
DEPEND_MP?= -MP
|
||||
# Handle OBJS=../somefile.o hacks. Just replace '/' rather than use :T to
|
||||
# avoid collisions.
|
||||
DEPEND_FILTER= C,/,_,g
|
||||
DEPEND_CFLAGS+= -MD ${DEPEND_MP} -MF${DEPENDFILE}.${.TARGET:${DEPEND_FILTER}}
|
||||
DEPEND_CFLAGS+= -MT${.TARGET}
|
||||
.if defined(.PARSEDIR)
|
||||
# Only add in DEPEND_CFLAGS for CFLAGS on files we expect from DEPENDOBJS
|
||||
# as those are the only ones we will include.
|
||||
DEPEND_CFLAGS_CONDITION= !empty(DEPENDOBJS:M${.TARGET:${DEPEND_FILTER}})
|
||||
CFLAGS+= ${${DEPEND_CFLAGS_CONDITION}:?${DEPEND_CFLAGS}:}
|
||||
.else
|
||||
CFLAGS+= ${DEPEND_CFLAGS}
|
||||
.endif
|
||||
DEPENDSRCS= ${SRCS:M*.[cSC]} ${SRCS:M*.cxx} ${SRCS:M*.cpp} ${SRCS:M*.cc}
|
||||
.if !empty(DEPENDSRCS)
|
||||
DEPENDOBJS+= ${DEPENDSRCS:R:S,$,.o,}
|
||||
.endif
|
||||
.for __obj in ${DEPENDOBJS:O:u}
|
||||
.if ${.MAKEFLAGS:M-V} == ""
|
||||
.sinclude "${DEPENDFILE}.${__obj:${DEPEND_FILTER}}"
|
||||
.endif
|
||||
DEPENDFILES_OBJS+= ${DEPENDFILE}.${__obj:${DEPEND_FILTER}}
|
||||
.endfor
|
||||
.endif # ${MK_FAST_DEPEND} == "yes"
|
||||
.endif # defined(SRCS)
|
||||
|
||||
.if ${MK_DIRDEPS_BUILD} == "yes"
|
||||
.include <meta.autodep.mk>
|
||||
|
@ -182,6 +182,7 @@ lib${LIB_PRIVATE}${LIB}.a: ${OBJS} ${STATICOBJS}
|
||||
.if ${MK_PROFILE} != "no" && defined(LIB) && !empty(LIB)
|
||||
_LIBS+= lib${LIB_PRIVATE}${LIB}_p.a
|
||||
POBJS+= ${OBJS:.o=.po} ${STATICOBJS:.o=.po}
|
||||
DEPENDOBJS+= ${POBJS}
|
||||
CLEANFILES+= ${POBJS}
|
||||
|
||||
lib${LIB_PRIVATE}${LIB}_p.a: ${POBJS}
|
||||
@ -194,6 +195,7 @@ lib${LIB_PRIVATE}${LIB}_p.a: ${POBJS}
|
||||
.if defined(SHLIB_NAME) || \
|
||||
defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB)
|
||||
SOBJS+= ${OBJS:.o=.So}
|
||||
DEPENDOBJS+= ${SOBJS}
|
||||
CLEANFILES+= ${SOBJS}
|
||||
.endif
|
||||
|
||||
|
@ -50,6 +50,7 @@ __<bsd.opts.mk>__:
|
||||
|
||||
__DEFAULT_YES_OPTIONS = \
|
||||
ASSERT_DEBUG \
|
||||
DEBUG_FILES \
|
||||
DOCCOMPRESS \
|
||||
INCLUDES \
|
||||
INSTALLLIB \
|
||||
@ -69,7 +70,6 @@ __DEFAULT_NO_OPTIONS = \
|
||||
CCACHE_BUILD \
|
||||
FAST_DEPEND \
|
||||
CTF \
|
||||
DEBUG_FILES \
|
||||
INSTALL_AS_USER \
|
||||
STALE_STAGED
|
||||
|
||||
|
@ -148,7 +148,11 @@ STAGE_MACHINE:= ${TARGET_OBJ_SPEC}
|
||||
.endif
|
||||
STAGE_OBJTOP:= ${STAGE_ROOT}/${STAGE_MACHINE}
|
||||
STAGE_COMMON_OBJTOP:= ${STAGE_ROOT}/common
|
||||
STAGE_TARGET_OBJTOP:= ${STAGE_ROOT}/${TARGET_OBJ_SPEC}
|
||||
STAGE_HOST_OBJTOP:= ${STAGE_ROOT}/${HOST_TARGET}
|
||||
# These are exported for hooking in out-of-tree builds. They will always
|
||||
# be overridden in sub-makes above when building in-tree.
|
||||
.export STAGE_OBJTOP STAGE_TARGET_OBJTOP STAGE_HOST_OBJTOP
|
||||
|
||||
# Use tools/install.sh which can avoid the need for xinstall for simple cases.
|
||||
INSTALL?= sh ${SRCTOP}/tools/install.sh
|
||||
@ -215,6 +219,7 @@ TOOLSDIR?= ${STAGE_HOST_OBJTOP}
|
||||
.endif
|
||||
# Don't use the bootstrap tools logic on itself.
|
||||
.if ${.TARGETS:Mbootstrap-tools} == "" && \
|
||||
!make(showconfig) && \
|
||||
!defined(BOOTSTRAPPING_TOOLS) && !empty(TOOLSDIR) && ${.MAKE.LEVEL} == 0
|
||||
.for dir in /sbin /bin /usr/sbin /usr/bin
|
||||
PATH:= ${TOOLSDIR}${dir}:${PATH}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user