IFC @ r253862
- change the SI_SUB_RUN_SCHEDULER sysinits in hv_utilc and hv_netvsc_drv_freebsd.c to SI_SUB_KTHREAD_IDLE, since the former is no longer in FreeBSD. The use of these SYSINITs can probably be removed.
This commit is contained in:
commit
fd121a9c7b
@ -128,3 +128,6 @@ sysdoc trhodes Pre-commit review preferred.
|
||||
sh(1) jilles Pre-commit review requested. This also applies
|
||||
to kill(1), printf(1) and test(1) which are
|
||||
compiled in as builtins.
|
||||
nvme(4) jimharris Pre-commit review requested.
|
||||
nvd(4) jimharris Pre-commit review requested.
|
||||
nvmecontrol(8) jimharris Pre-commit review requested.
|
||||
|
61
Makefile
61
Makefile
@ -130,11 +130,34 @@ _MAKEOBJDIRPREFIX!= /usr/bin/env -i PATH=${PATH} ${MAKE} \
|
||||
.error MAKEOBJDIRPREFIX can only be set in environment, not as a global\
|
||||
(in make.conf(5)) or command-line variable.
|
||||
.endif
|
||||
MAKEPATH= ${MAKEOBJDIRPREFIX}${.CURDIR}/make.${MACHINE}
|
||||
BINMAKE= \
|
||||
`if [ -x ${MAKEPATH}/make ]; then echo ${MAKEPATH}/make; else echo ${MAKE}; fi` \
|
||||
|
||||
# We often need to use the tree's version of make to build it.
|
||||
# Choices add to complexity though.
|
||||
# We cannot blindly use a make which may not be the one we want
|
||||
# so be exlicit - until all choice is removed.
|
||||
.if !defined(WITHOUT_BMAKE)
|
||||
WANT_MAKE= bmake
|
||||
.else
|
||||
WANT_MAKE= fmake
|
||||
.endif
|
||||
MYMAKE= ${MAKEOBJDIRPREFIX}${.CURDIR}/make.${MACHINE}/${WANT_MAKE}
|
||||
.if defined(.PARSEDIR)
|
||||
HAVE_MAKE= bmake
|
||||
.else
|
||||
HAVE_MAKE= fmake
|
||||
.endif
|
||||
.if exists(${MYMAKE})
|
||||
SUB_MAKE:= ${MYMAKE} -m ${.CURDIR}/share/mk
|
||||
.elif ${WANT_MAKE} != ${HAVE_MAKE} || ${WANT_MAKE} != "bmake"
|
||||
# It may not exist yet but we may cause it to.
|
||||
# In the case of fmake, upgrade_checks may cause a newer version to be built.
|
||||
SUB_MAKE= `test -x ${MYMAKE} && echo ${MYMAKE} || echo ${MAKE}` \
|
||||
-m ${.CURDIR}/share/mk
|
||||
_MAKE= PATH=${PATH} ${BINMAKE} -f Makefile.inc1 TARGET=${_TARGET} TARGET_ARCH=${_TARGET_ARCH}
|
||||
.else
|
||||
SUB_MAKE= ${MAKE} -m ${.CURDIR}/share/mk
|
||||
.endif
|
||||
|
||||
_MAKE= PATH=${PATH} ${SUB_MAKE} -f Makefile.inc1 TARGET=${_TARGET} TARGET_ARCH=${_TARGET_ARCH}
|
||||
|
||||
# Guess machine architecture from machine type, and vice versa.
|
||||
.if !defined(TARGET_ARCH) && defined(TARGET)
|
||||
@ -291,11 +314,13 @@ kernel: buildkernel installkernel
|
||||
# Perform a few tests to determine if the installed tools are adequate
|
||||
# for building the world.
|
||||
#
|
||||
# Note: if we ever need to care about the version of bmake, simply testing
|
||||
# MAKE_VERSION against a required version should suffice.
|
||||
#
|
||||
upgrade_checks:
|
||||
.if !defined(.PARSEDIR)
|
||||
.if !defined(WITHOUT_BMAKE)
|
||||
(cd ${.CURDIR} && ${MAKE} bmake)
|
||||
.else
|
||||
.if ${HAVE_MAKE} != ${WANT_MAKE}
|
||||
@(cd ${.CURDIR} && ${MAKE} ${WANT_MAKE:S,^f,,})
|
||||
.elif ${WANT_MAKE} == "fmake"
|
||||
@if ! (cd ${.CURDIR}/tools/build/make_check && \
|
||||
PATH=${PATH} ${BINMAKE} obj >/dev/null 2>&1 && \
|
||||
PATH=${PATH} ${BINMAKE} >/dev/null 2>&1); \
|
||||
@ -303,14 +328,13 @@ upgrade_checks:
|
||||
(cd ${.CURDIR} && ${MAKE} make); \
|
||||
fi
|
||||
.endif
|
||||
.endif
|
||||
|
||||
#
|
||||
# Upgrade make(1) to the current version using the installed
|
||||
# headers, libraries and tools. Also, allow the location of
|
||||
# the system bsdmake-like utility to be overridden.
|
||||
#
|
||||
MMAKEENV= MAKEOBJDIRPREFIX=${MAKEPATH} \
|
||||
MMAKEENV= MAKEOBJDIRPREFIX=${MYMAKE:H} \
|
||||
DESTDIR= \
|
||||
INSTALL="sh ${.CURDIR}/tools/install.sh"
|
||||
MMAKE= ${MMAKEENV} ${MAKE} \
|
||||
@ -327,7 +351,7 @@ make bmake: .PHONY
|
||||
${MMAKE} obj && \
|
||||
${MMAKE} depend && \
|
||||
${MMAKE} all && \
|
||||
${MMAKE} install DESTDIR=${MAKEPATH} BINDIR=
|
||||
${MMAKE} install DESTDIR=${MYMAKE:H} BINDIR= PROGNAME=${MYMAKE:T}
|
||||
|
||||
tinderbox:
|
||||
@cd ${.CURDIR} && ${MAKE} DOING_TINDERBOX=YES universe
|
||||
@ -377,7 +401,8 @@ MAKEFAIL=tee -a ${FAILFILE}
|
||||
MAKEFAIL=cat
|
||||
.endif
|
||||
|
||||
universe: universe_prologue upgrade_checks
|
||||
universe_prologue: upgrade_checks
|
||||
universe: universe_prologue
|
||||
universe_prologue:
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo ">>> make universe started on ${STARTTIME}"
|
||||
@ -387,9 +412,9 @@ universe_prologue:
|
||||
.endif
|
||||
.for target in ${TARGETS}
|
||||
universe: universe_${target}
|
||||
.ORDER: universe_prologue upgrade_checks universe_${target} universe_epilogue
|
||||
universe_epilogue: universe_${target}
|
||||
universe_${target}: universe_${target}_prologue
|
||||
universe_${target}_prologue:
|
||||
universe_${target}_prologue: universe_prologue
|
||||
@echo ">> ${target} started on `LC_ALL=C date`"
|
||||
.if !defined(MAKE_JUST_KERNELS)
|
||||
.for target_arch in ${TARGET_ARCHES_${target}}
|
||||
@ -397,7 +422,7 @@ universe_${target}: universe_${target}_${target_arch}
|
||||
universe_${target}_${target_arch}: universe_${target}_prologue
|
||||
@echo ">> ${target}.${target_arch} ${UNIVERSE_TARGET} started on `LC_ALL=C date`"
|
||||
@(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \
|
||||
${MAKE} ${JFLAG} ${UNIVERSE_TARGET} \
|
||||
${SUB_MAKE} ${JFLAG} ${UNIVERSE_TARGET} \
|
||||
TARGET=${target} \
|
||||
TARGET_ARCH=${target_arch} \
|
||||
> _.${target}.${target_arch}.${UNIVERSE_TARGET} 2>&1 || \
|
||||
@ -418,11 +443,11 @@ universe_${target}: universe_${target}_kernels
|
||||
universe_${target}_kernels: universe_${target}_prologue
|
||||
.if exists(${KERNSRCDIR}/${target}/conf/NOTES)
|
||||
@(cd ${KERNSRCDIR}/${target}/conf && env __MAKE_CONF=/dev/null \
|
||||
${MAKE} LINT > ${.CURDIR}/_.${target}.makeLINT 2>&1 || \
|
||||
${SUB_MAKE} LINT > ${.CURDIR}/_.${target}.makeLINT 2>&1 || \
|
||||
(echo "${target} 'make LINT' failed," \
|
||||
"check _.${target}.makeLINT for details"| ${MAKEFAIL}))
|
||||
.endif
|
||||
@cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} TARGET=${target} \
|
||||
@cd ${.CURDIR} && ${SUB_MAKE} ${.MAKEFLAGS} TARGET=${target} \
|
||||
universe_kernels
|
||||
.endif
|
||||
@echo ">> ${target} completed on `LC_ALL=C date`"
|
||||
@ -445,7 +470,7 @@ TARGET_ARCH_${kernel}!= cd ${KERNSRCDIR}/${TARGET}/conf && \
|
||||
universe_kernconfs: universe_kernconf_${TARGET}_${kernel}
|
||||
universe_kernconf_${TARGET}_${kernel}:
|
||||
@(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \
|
||||
${MAKE} ${JFLAG} buildkernel \
|
||||
${SUB_MAKE} ${JFLAG} buildkernel \
|
||||
TARGET=${TARGET} \
|
||||
TARGET_ARCH=${TARGET_ARCH_${kernel}} \
|
||||
KERNCONF=${kernel} \
|
||||
|
@ -833,6 +833,18 @@ distributeworld installworld: installcheck installcheck_UGID
|
||||
awk 'BEGIN { print "#${MTREE_MAGIC}" } !/ type=/ { file = $$1 } / type=/ { if ($$1 == file) { sub(/^\.\/${dist}\//, "./"); print } }' > \
|
||||
${DESTDIR}/${DISTDIR}/${dist}.meta
|
||||
.endfor
|
||||
.if ${MK_DEBUG_FILES} != "no"
|
||||
. for dist in base ${EXTRA_DISTRIBUTIONS}
|
||||
@# For each file that exists in this dist, print the corresponding
|
||||
@# line from the METALOG. This relies on the fact that
|
||||
@# a line containing only the filename will sort immediatly before
|
||||
@# the relevant mtree line.
|
||||
cd ${DESTDIR}/${DISTDIR}; \
|
||||
find ./${dist}/usr/lib/debug | sort -u ${METALOG} - | \
|
||||
awk 'BEGIN { print "#${MTREE_MAGIC}" } !/ type=/ { file = $$1 } / type=/ { if ($$1 == file) { sub(/^\.\/${dist}\//, "./"); print } }' > \
|
||||
${DESTDIR}/${DISTDIR}/${dist}.debug.meta
|
||||
. endfor
|
||||
.endif
|
||||
.endif
|
||||
.endif
|
||||
|
||||
@ -841,13 +853,29 @@ packageworld:
|
||||
.if defined(NO_ROOT)
|
||||
${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \
|
||||
tar cvJf ${DESTDIR}/${DISTDIR}/${dist}.txz \
|
||||
--exclude usr/lib/debug \
|
||||
@${DESTDIR}/${DISTDIR}/${dist}.meta
|
||||
.else
|
||||
${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \
|
||||
tar cvJf ${DESTDIR}/${DISTDIR}/${dist}.txz .
|
||||
tar cvJf ${DESTDIR}/${DISTDIR}/${dist}.txz \
|
||||
--exclude usr/lib/debug .
|
||||
.endif
|
||||
.endfor
|
||||
|
||||
.if ${MK_DEBUG_FILES} != "no"
|
||||
. for dist in base ${EXTRA_DISTRIBUTIONS}
|
||||
. if defined(NO_ROOT)
|
||||
${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \
|
||||
tar cvJf ${DESTDIR}/${DISTDIR}/${dist}.debug.txz \
|
||||
@${DESTDIR}/${DISTDIR}/${dist}.debug.meta
|
||||
. else
|
||||
${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \
|
||||
tar cvJfL ${DESTDIR}/${DISTDIR}/${dist}.debug.txz \
|
||||
usr/lib/debug
|
||||
. endif
|
||||
. endfor
|
||||
.endif
|
||||
|
||||
#
|
||||
# reinstall
|
||||
#
|
||||
|
7
UPDATING
7
UPDATING
@ -31,6 +31,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10.x IS SLOW:
|
||||
disable the most expensive debugging functionality run
|
||||
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
|
||||
|
||||
20130726:
|
||||
Behavior of devfs rules path matching has been changed.
|
||||
Pattern is now always matched against fully qualified devfs
|
||||
path and slash characters must be explicitly matched by
|
||||
slashes in pattern (FNM_PATHNAME). Rulesets involving devfs
|
||||
subdirectories must be reviewed.
|
||||
|
||||
20130716:
|
||||
The default ARM ABI has changed to the ARM EABI. The old ABI is
|
||||
incompatible with the ARM EABI and all programs and modules will
|
||||
|
@ -8,7 +8,7 @@ SHSRCS= alias.c arith_yacc.c arith_yylex.c cd.c echo.c error.c eval.c \
|
||||
histedit.c input.c jobs.c kill.c mail.c main.c memalloc.c miscbltin.c \
|
||||
mystring.c options.c output.c parser.c printf.c redir.c show.c \
|
||||
test.c trap.c var.c
|
||||
GENSRCS= builtins.c init.c nodes.c syntax.c
|
||||
GENSRCS= builtins.c nodes.c syntax.c
|
||||
GENHDRS= builtins.h nodes.h syntax.h token.h
|
||||
SRCS= ${SHSRCS} ${GENSRCS} ${GENHDRS}
|
||||
|
||||
@ -30,26 +30,21 @@ WFORMAT=0
|
||||
${.CURDIR}/../test \
|
||||
${.CURDIR}/../../usr.bin/printf
|
||||
|
||||
CLEANFILES+= mkinit mkinit.o mknodes mknodes.o \
|
||||
CLEANFILES+= mknodes mknodes.o \
|
||||
mksyntax mksyntax.o
|
||||
CLEANFILES+= ${GENSRCS} ${GENHDRS}
|
||||
|
||||
build-tools: mkinit mknodes mksyntax
|
||||
build-tools: mknodes mksyntax
|
||||
|
||||
.ORDER: builtins.c builtins.h
|
||||
builtins.c builtins.h: mkbuiltins builtins.def
|
||||
sh ${.CURDIR}/mkbuiltins ${.CURDIR}
|
||||
|
||||
init.c: mkinit alias.c eval.c exec.c input.c jobs.c options.c parser.c \
|
||||
redir.c trap.c var.c
|
||||
./mkinit ${.ALLSRC:S/^mkinit$//}
|
||||
|
||||
# XXX this is just to stop the default .c rule being used, so that the
|
||||
# intermediate object has a fixed name.
|
||||
# XXX we have a default .c rule, but no default .o rule.
|
||||
.o:
|
||||
${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
|
||||
mkinit: mkinit.o
|
||||
mknodes: mknodes.o
|
||||
mksyntax: mksyntax.o
|
||||
|
||||
|
29
bin/sh/TOUR
29
bin/sh/TOUR
@ -25,38 +25,11 @@ programs is:
|
||||
program input files generates
|
||||
------- ----------- ---------
|
||||
mkbuiltins builtins builtins.h builtins.c
|
||||
mkinit *.c init.c
|
||||
mknodes nodetypes nodes.h nodes.c
|
||||
mksyntax - syntax.h syntax.c
|
||||
mktokens - token.h
|
||||
|
||||
There are undoubtedly too many of these. Mkinit searches all the
|
||||
C source files for entries looking like:
|
||||
|
||||
RESET {
|
||||
x = 2; /* executed when the shell does a longjmp
|
||||
back to the main command loop */
|
||||
}
|
||||
|
||||
It pulls this code out into routines which are when particular
|
||||
events occur. The intent is to improve modularity by isolating
|
||||
the information about which modules need to be explicitly
|
||||
initialized/reset within the modules themselves.
|
||||
|
||||
Mkinit recognizes several constructs for placing declarations in
|
||||
the init.c file.
|
||||
INCLUDE "file.h"
|
||||
includes a file. The storage class MKINIT makes a declaration
|
||||
available in the init.c file, for example:
|
||||
MKINIT int funcnest; /* depth of function calls */
|
||||
MKINIT alone on a line introduces a structure or union declara-
|
||||
tion:
|
||||
MKINIT
|
||||
struct redirtab {
|
||||
short renamed[10];
|
||||
};
|
||||
Preprocessor #define statements are copied to init.c without any
|
||||
special action to request this.
|
||||
There are undoubtedly too many of these.
|
||||
|
||||
EXCEPTIONS: Code for dealing with exceptions appears in
|
||||
exceptions.c. The C language doesn't include exception handling,
|
||||
|
@ -76,7 +76,7 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
int evalskip; /* set if we are skipping commands */
|
||||
int skipcount; /* number of levels to skip */
|
||||
MKINIT int loopnest; /* current loop nesting level */
|
||||
static int loopnest; /* current loop nesting level */
|
||||
int funcnest; /* depth of function calls */
|
||||
static int builtin_flags; /* evalcommand flags for builtins */
|
||||
|
||||
@ -104,16 +104,13 @@ static void prehash(union node *);
|
||||
* Called to reset things after an exception.
|
||||
*/
|
||||
|
||||
#ifdef mkinit
|
||||
INCLUDE "eval.h"
|
||||
|
||||
RESET {
|
||||
void
|
||||
reseteval(void)
|
||||
{
|
||||
evalskip = 0;
|
||||
loopnest = 0;
|
||||
funcnest = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
@ -46,6 +46,8 @@ struct backcmd { /* result of evalbackcmd */
|
||||
struct job *jp; /* job structure for command */
|
||||
};
|
||||
|
||||
void reseteval(void);
|
||||
|
||||
/* flags in argument to evaltree/evalstring */
|
||||
#define EV_EXIT 01 /* exit after evaluating tree */
|
||||
#define EV_TESTED 02 /* exit status is checked; ignore -e flag */
|
||||
|
@ -70,7 +70,6 @@ __FBSDID("$FreeBSD$");
|
||||
#include "syntax.h"
|
||||
#include "memalloc.h"
|
||||
#include "error.h"
|
||||
#include "init.h"
|
||||
#include "mystring.h"
|
||||
#include "show.h"
|
||||
#include "jobs.h"
|
||||
|
@ -92,7 +92,7 @@ struct parsefile {
|
||||
|
||||
int plinno = 1; /* input line number */
|
||||
int parsenleft; /* copy of parsefile->nleft */
|
||||
MKINIT int parselleft; /* copy of parsefile->lleft */
|
||||
static int parselleft; /* copy of parsefile->lleft */
|
||||
const char *parsenextc; /* copy of parsefile->nextc */
|
||||
static char basebuf[BUFSIZ + 1];/* buffer for top level input file */
|
||||
static struct parsefile basepf = { /* top level input file */
|
||||
@ -108,15 +108,12 @@ static void pushfile(void);
|
||||
static int preadfd(void);
|
||||
static void popstring(void);
|
||||
|
||||
#ifdef mkinit
|
||||
INCLUDE "input.h"
|
||||
INCLUDE "error.h"
|
||||
|
||||
RESET {
|
||||
void
|
||||
resetinput(void)
|
||||
{
|
||||
popallfiles();
|
||||
parselleft = parsenleft = 0; /* clear input buffer */
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
|
@ -47,6 +47,7 @@ extern const char *parsenextc; /* next character in input buffer */
|
||||
struct alias;
|
||||
struct parsefile;
|
||||
|
||||
void resetinput(void);
|
||||
char *pfgets(char *, int);
|
||||
int pgetc(void);
|
||||
int preadbuffer(void);
|
||||
|
@ -77,8 +77,8 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
static struct job *jobtab; /* array of jobs */
|
||||
static int njobs; /* size of array */
|
||||
MKINIT pid_t backgndpid = -1; /* pid of last background process */
|
||||
MKINIT struct job *bgjob = NULL; /* last background process */
|
||||
static pid_t backgndpid = -1; /* pid of last background process */
|
||||
static struct job *bgjob = NULL; /* last background process */
|
||||
#if JOBS
|
||||
static struct job *jobmru; /* most recently used job list */
|
||||
static pid_t initialpgrp; /* pgrp of shell on invocation */
|
||||
@ -116,7 +116,7 @@ static void showjob(struct job *, int);
|
||||
* Turn job control on and off.
|
||||
*/
|
||||
|
||||
MKINIT int jobctl;
|
||||
static int jobctl;
|
||||
|
||||
#if JOBS
|
||||
void
|
||||
|
@ -68,10 +68,10 @@ __FBSDID("$FreeBSD$");
|
||||
#include "show.h"
|
||||
#include "memalloc.h"
|
||||
#include "error.h"
|
||||
#include "init.h"
|
||||
#include "mystring.h"
|
||||
#include "exec.h"
|
||||
#include "cd.h"
|
||||
#include "redir.h"
|
||||
#include "builtins.h"
|
||||
|
||||
int rootpid;
|
||||
@ -79,6 +79,7 @@ int rootshell;
|
||||
struct jmploc main_handler;
|
||||
int localeisutf8, initial_localeisutf8;
|
||||
|
||||
static void reset(void);
|
||||
static void cmdloop(int);
|
||||
static void read_profile(const char *);
|
||||
static char *find_dot_file(char *);
|
||||
@ -179,6 +180,14 @@ state4:
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
reset(void)
|
||||
{
|
||||
reseteval();
|
||||
resetinput();
|
||||
resetparser();
|
||||
resetredir();
|
||||
}
|
||||
|
||||
/*
|
||||
* Read and execute commands. "Top" is nonzero for the top level command
|
||||
|
480
bin/sh/mkinit.c
480
bin/sh/mkinit.c
@ -1,480 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 1991, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* Kenneth Almquist.
|
||||
*
|
||||
* 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.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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.
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char const copyright[] =
|
||||
"@(#) Copyright (c) 1991, 1993\n\
|
||||
The Regents of the University of California. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)mkinit.c 8.2 (Berkeley) 5/4/95";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
/*
|
||||
* This program scans all the source files for code to handle various
|
||||
* special events and combines this code into one file. This (allegedly)
|
||||
* improves the structure of the program since there is no need for
|
||||
* anyone outside of a module to know that that module performs special
|
||||
* operations on particular events.
|
||||
*
|
||||
* Usage: mkinit sourcefile...
|
||||
*/
|
||||
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
||||
|
||||
/*
|
||||
* OUTFILE is the name of the output file. Output is initially written
|
||||
* to the file OUTTEMP, which is then moved to OUTFILE.
|
||||
*/
|
||||
|
||||
#define OUTFILE "init.c"
|
||||
#define OUTTEMP "init.c.new"
|
||||
|
||||
|
||||
/*
|
||||
* A text structure is basically just a string that grows as more characters
|
||||
* are added onto the end of it. It is implemented as a linked list of
|
||||
* blocks of characters. The routines addstr and addchar append a string
|
||||
* or a single character, respectively, to a text structure. Writetext
|
||||
* writes the contents of a text structure to a file.
|
||||
*/
|
||||
|
||||
#define BLOCKSIZE 512
|
||||
|
||||
struct text {
|
||||
char *nextc;
|
||||
int nleft;
|
||||
struct block *start;
|
||||
struct block *last;
|
||||
};
|
||||
|
||||
struct block {
|
||||
struct block *next;
|
||||
char text[BLOCKSIZE];
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* There is one event structure for each event that mkinit handles.
|
||||
*/
|
||||
|
||||
struct event {
|
||||
const char *name; /* name of event (e.g. RESET) */
|
||||
const char *routine; /* name of routine called on event */
|
||||
const char *comment; /* comment describing routine */
|
||||
struct text code; /* code for handling event */
|
||||
};
|
||||
|
||||
|
||||
char writer[] = "\
|
||||
/*\n\
|
||||
* This file was generated by the mkinit program.\n\
|
||||
*/\n\
|
||||
\n";
|
||||
|
||||
char reset[] = "\
|
||||
/*\n\
|
||||
* This routine is called when an error or an interrupt occurs in an\n\
|
||||
* interactive shell and control is returned to the main command loop.\n\
|
||||
*/\n";
|
||||
|
||||
|
||||
struct event event[] = {
|
||||
{ "RESET", "reset", reset, { NULL, 0, NULL, NULL } },
|
||||
{ NULL, NULL, NULL, { NULL, 0, NULL, NULL } }
|
||||
};
|
||||
|
||||
|
||||
const char *curfile; /* current file */
|
||||
int linno; /* current line */
|
||||
char *header_files[200]; /* list of header files */
|
||||
struct text defines; /* #define statements */
|
||||
struct text decls; /* declarations */
|
||||
int amiddecls; /* for formatting */
|
||||
|
||||
|
||||
void readfile(const char *);
|
||||
int match(const char *, const char *);
|
||||
int gooddefine(const char *);
|
||||
void doevent(struct event *, FILE *, const char *);
|
||||
void doinclude(char *);
|
||||
void dodecl(char *, FILE *);
|
||||
void output(void);
|
||||
void addstr(const char *, struct text *);
|
||||
void addchar(int, struct text *);
|
||||
void writetext(struct text *, FILE *);
|
||||
FILE *ckfopen(const char *, const char *);
|
||||
void *ckmalloc(size_t);
|
||||
char *savestr(const char *);
|
||||
void error(const char *);
|
||||
|
||||
#define equal(s1, s2) (strcmp(s1, s2) == 0)
|
||||
|
||||
int
|
||||
main(int argc __unused, char *argv[])
|
||||
{
|
||||
char **ap;
|
||||
|
||||
header_files[0] = savestr("\"shell.h\"");
|
||||
header_files[1] = savestr("\"mystring.h\"");
|
||||
header_files[2] = savestr("\"init.h\"");
|
||||
for (ap = argv + 1 ; *ap ; ap++)
|
||||
readfile(*ap);
|
||||
output();
|
||||
rename(OUTTEMP, OUTFILE);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Parse an input file.
|
||||
*/
|
||||
|
||||
void
|
||||
readfile(const char *fname)
|
||||
{
|
||||
FILE *fp;
|
||||
char line[1024];
|
||||
struct event *ep;
|
||||
|
||||
fp = ckfopen(fname, "r");
|
||||
curfile = fname;
|
||||
linno = 0;
|
||||
amiddecls = 0;
|
||||
while (fgets(line, sizeof line, fp) != NULL) {
|
||||
linno++;
|
||||
for (ep = event ; ep->name ; ep++) {
|
||||
if (line[0] == ep->name[0] && match(ep->name, line)) {
|
||||
doevent(ep, fp, fname);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (line[0] == 'I' && match("INCLUDE", line))
|
||||
doinclude(line);
|
||||
if (line[0] == 'M' && match("MKINIT", line))
|
||||
dodecl(line, fp);
|
||||
if (line[0] == '#' && gooddefine(line)) {
|
||||
char *cp;
|
||||
char line2[1024];
|
||||
static const char undef[] = "#undef ";
|
||||
|
||||
strcpy(line2, line);
|
||||
memcpy(line2, undef, sizeof(undef) - 1);
|
||||
cp = line2 + sizeof(undef) - 1;
|
||||
while(*cp && (*cp == ' ' || *cp == '\t'))
|
||||
cp++;
|
||||
while(*cp && *cp != ' ' && *cp != '\t' && *cp != '\n')
|
||||
cp++;
|
||||
*cp++ = '\n'; *cp = '\0';
|
||||
addstr(line2, &defines);
|
||||
addstr(line, &defines);
|
||||
}
|
||||
}
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
match(const char *name, const char *line)
|
||||
{
|
||||
const char *p, *q;
|
||||
|
||||
p = name, q = line;
|
||||
while (*p) {
|
||||
if (*p++ != *q++)
|
||||
return 0;
|
||||
}
|
||||
if (*q != '{' && *q != ' ' && *q != '\t' && *q != '\n')
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
gooddefine(const char *line)
|
||||
{
|
||||
const char *p;
|
||||
|
||||
if (! match("#define", line))
|
||||
return 0; /* not a define */
|
||||
p = line + 7;
|
||||
while (*p == ' ' || *p == '\t')
|
||||
p++;
|
||||
while (*p != ' ' && *p != '\t') {
|
||||
if (*p == '(')
|
||||
return 0; /* macro definition */
|
||||
p++;
|
||||
}
|
||||
while (*p != '\n' && *p != '\0')
|
||||
p++;
|
||||
if (p[-1] == '\\')
|
||||
return 0; /* multi-line definition */
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
doevent(struct event *ep, FILE *fp, const char *fname)
|
||||
{
|
||||
char line[1024];
|
||||
int indent;
|
||||
const char *p;
|
||||
|
||||
sprintf(line, "\n /* from %s: */\n", fname);
|
||||
addstr(line, &ep->code);
|
||||
addstr(" {\n", &ep->code);
|
||||
for (;;) {
|
||||
linno++;
|
||||
if (fgets(line, sizeof line, fp) == NULL)
|
||||
error("Unexpected EOF");
|
||||
if (equal(line, "}\n"))
|
||||
break;
|
||||
indent = 6;
|
||||
for (p = line ; *p == '\t' ; p++)
|
||||
indent += 8;
|
||||
for ( ; *p == ' ' ; p++)
|
||||
indent++;
|
||||
if (*p == '\n' || *p == '#')
|
||||
indent = 0;
|
||||
while (indent >= 8) {
|
||||
addchar('\t', &ep->code);
|
||||
indent -= 8;
|
||||
}
|
||||
while (indent > 0) {
|
||||
addchar(' ', &ep->code);
|
||||
indent--;
|
||||
}
|
||||
addstr(p, &ep->code);
|
||||
}
|
||||
addstr(" }\n", &ep->code);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
doinclude(char *line)
|
||||
{
|
||||
char *p;
|
||||
char *name;
|
||||
char **pp;
|
||||
|
||||
for (p = line ; *p != '"' && *p != '<' && *p != '\0' ; p++);
|
||||
if (*p == '\0')
|
||||
error("Expecting '\"' or '<'");
|
||||
name = p;
|
||||
while (*p != ' ' && *p != '\t' && *p != '\n')
|
||||
p++;
|
||||
if (p[-1] != '"' && p[-1] != '>')
|
||||
error("Missing terminator");
|
||||
*p = '\0';
|
||||
|
||||
/* name now contains the name of the include file */
|
||||
for (pp = header_files ; *pp && ! equal(*pp, name) ; pp++);
|
||||
if (*pp == NULL)
|
||||
*pp = savestr(name);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
dodecl(char *line1, FILE *fp)
|
||||
{
|
||||
char line[1024];
|
||||
char *p, *q;
|
||||
|
||||
if (strcmp(line1, "MKINIT\n") == 0) { /* start of struct/union decl */
|
||||
addchar('\n', &decls);
|
||||
do {
|
||||
linno++;
|
||||
if (fgets(line, sizeof line, fp) == NULL)
|
||||
error("Unterminated structure declaration");
|
||||
addstr(line, &decls);
|
||||
} while (line[0] != '}');
|
||||
amiddecls = 0;
|
||||
} else {
|
||||
if (! amiddecls)
|
||||
addchar('\n', &decls);
|
||||
q = NULL;
|
||||
for (p = line1 + 6 ; *p && strchr("=/\n", *p) == NULL; p++)
|
||||
continue;
|
||||
if (*p == '=') { /* eliminate initialization */
|
||||
for (q = p ; *q && *q != ';' ; q++);
|
||||
if (*q == '\0')
|
||||
q = NULL;
|
||||
else {
|
||||
while (p[-1] == ' ')
|
||||
p--;
|
||||
*p = '\0';
|
||||
}
|
||||
}
|
||||
addstr("extern", &decls);
|
||||
addstr(line1 + 6, &decls);
|
||||
if (q != NULL)
|
||||
addstr(q, &decls);
|
||||
amiddecls = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Write the output to the file OUTTEMP.
|
||||
*/
|
||||
|
||||
void
|
||||
output(void)
|
||||
{
|
||||
FILE *fp;
|
||||
char **pp;
|
||||
struct event *ep;
|
||||
|
||||
fp = ckfopen(OUTTEMP, "w");
|
||||
fputs(writer, fp);
|
||||
for (pp = header_files ; *pp ; pp++)
|
||||
fprintf(fp, "#include %s\n", *pp);
|
||||
fputs("\n\n\n", fp);
|
||||
writetext(&defines, fp);
|
||||
fputs("\n\n", fp);
|
||||
writetext(&decls, fp);
|
||||
for (ep = event ; ep->name ; ep++) {
|
||||
fputs("\n\n\n", fp);
|
||||
fputs(ep->comment, fp);
|
||||
fprintf(fp, "\nvoid\n%s(void)\n{\n", ep->routine);
|
||||
writetext(&ep->code, fp);
|
||||
fprintf(fp, "}\n");
|
||||
}
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* A text structure is simply a block of text that is kept in memory.
|
||||
* Addstr appends a string to the text struct, and addchar appends a single
|
||||
* character.
|
||||
*/
|
||||
|
||||
void
|
||||
addstr(const char *s, struct text *text)
|
||||
{
|
||||
while (*s) {
|
||||
if (--text->nleft < 0)
|
||||
addchar(*s++, text);
|
||||
else
|
||||
*text->nextc++ = *s++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
addchar(int c, struct text *text)
|
||||
{
|
||||
struct block *bp;
|
||||
|
||||
if (--text->nleft < 0) {
|
||||
bp = ckmalloc(sizeof *bp);
|
||||
if (text->start == NULL)
|
||||
text->start = bp;
|
||||
else
|
||||
text->last->next = bp;
|
||||
text->last = bp;
|
||||
text->nextc = bp->text;
|
||||
text->nleft = BLOCKSIZE - 1;
|
||||
}
|
||||
*text->nextc++ = c;
|
||||
}
|
||||
|
||||
/*
|
||||
* Write the contents of a text structure to a file.
|
||||
*/
|
||||
void
|
||||
writetext(struct text *text, FILE *fp)
|
||||
{
|
||||
struct block *bp;
|
||||
|
||||
if (text->start != NULL) {
|
||||
for (bp = text->start ; bp != text->last ; bp = bp->next)
|
||||
fwrite(bp->text, sizeof (char), BLOCKSIZE, fp);
|
||||
fwrite(bp->text, sizeof (char), BLOCKSIZE - text->nleft, fp);
|
||||
}
|
||||
}
|
||||
|
||||
FILE *
|
||||
ckfopen(const char *file, const char *mode)
|
||||
{
|
||||
FILE *fp;
|
||||
|
||||
if ((fp = fopen(file, mode)) == NULL) {
|
||||
fprintf(stderr, "Can't open %s: %s\n", file, strerror(errno));
|
||||
exit(2);
|
||||
}
|
||||
return fp;
|
||||
}
|
||||
|
||||
void *
|
||||
ckmalloc(size_t nbytes)
|
||||
{
|
||||
char *p;
|
||||
|
||||
if ((p = malloc(nbytes)) == NULL)
|
||||
error("Out of space");
|
||||
return p;
|
||||
}
|
||||
|
||||
char *
|
||||
savestr(const char *s)
|
||||
{
|
||||
char *p;
|
||||
|
||||
p = ckmalloc(strlen(s) + 1);
|
||||
strcpy(p, s);
|
||||
return p;
|
||||
}
|
||||
|
||||
void
|
||||
error(const char *msg)
|
||||
{
|
||||
if (curfile != NULL)
|
||||
fprintf(stderr, "%s:%d: ", curfile, linno);
|
||||
fprintf(stderr, "%s\n", msg);
|
||||
exit(2);
|
||||
}
|
@ -75,25 +75,6 @@ struct output memout = {NULL, 0, NULL, 0, MEM_OUT, 0};
|
||||
struct output *out1 = &output;
|
||||
struct output *out2 = &errout;
|
||||
|
||||
|
||||
|
||||
#ifdef mkinit
|
||||
|
||||
INCLUDE "output.h"
|
||||
INCLUDE "memalloc.h"
|
||||
|
||||
RESET {
|
||||
out1 = &output;
|
||||
out2 = &errout;
|
||||
if (memout.buf != NULL) {
|
||||
ckfree(memout.buf);
|
||||
memout.buf = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
void
|
||||
outcslow(int c, struct output *file)
|
||||
{
|
||||
|
@ -96,9 +96,9 @@ static struct heredoc *heredoclist; /* list of here documents to read */
|
||||
static int doprompt; /* if set, prompt the user */
|
||||
static int needprompt; /* true if interactive and at start of line */
|
||||
static int lasttoken; /* last token read */
|
||||
MKINIT int tokpushback; /* last token pushed back */
|
||||
int tokpushback; /* last token pushed back */
|
||||
static char *wordtext; /* text of last word returned by readtoken */
|
||||
MKINIT int checkkwd; /* 1 == check for kwds, 2 == also eat newlines */
|
||||
static int checkkwd;
|
||||
static struct nodelist *backquotelist;
|
||||
static union node *redirnode;
|
||||
static struct heredoc *heredoc;
|
||||
@ -1819,13 +1819,13 @@ parsearith: {
|
||||
} /* end of readtoken */
|
||||
|
||||
|
||||
|
||||
#ifdef mkinit
|
||||
RESET {
|
||||
void
|
||||
resetparser(void)
|
||||
{
|
||||
tokpushback = 0;
|
||||
checkkwd = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Returns true if the text contains nothing to expand (no dollar signs
|
||||
|
@ -79,6 +79,7 @@ extern const char *const parsekwd[];
|
||||
|
||||
union node *parsecmd(int);
|
||||
void fixredir(union node *, const char *, int);
|
||||
void resetparser(void);
|
||||
int goodname(const char *);
|
||||
int isassignment(const char *);
|
||||
char *getprompt(void *);
|
||||
|
@ -66,14 +66,13 @@ __FBSDID("$FreeBSD$");
|
||||
#define CLOSED -1 /* fd was not open before redir */
|
||||
|
||||
|
||||
MKINIT
|
||||
struct redirtab {
|
||||
struct redirtab *next;
|
||||
int renamed[10];
|
||||
};
|
||||
|
||||
|
||||
MKINIT struct redirtab *redirlist;
|
||||
static struct redirtab *redirlist;
|
||||
|
||||
/*
|
||||
* We keep track of whether or not fd0 has been redirected. This is for
|
||||
@ -324,16 +323,13 @@ popredir(void)
|
||||
* Undo all redirections. Called on error or interrupt.
|
||||
*/
|
||||
|
||||
#ifdef mkinit
|
||||
|
||||
INCLUDE "redir.h"
|
||||
|
||||
RESET {
|
||||
void
|
||||
resetredir(void)
|
||||
{
|
||||
while (redirlist)
|
||||
popredir();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* Return true if fd 0 has already been redirected at least once. */
|
||||
int
|
||||
|
@ -40,6 +40,7 @@
|
||||
union node;
|
||||
void redirect(union node *, int);
|
||||
void popredir(void);
|
||||
void resetredir(void);
|
||||
int fd0_redirected_p(void);
|
||||
void clearredir(void);
|
||||
|
||||
|
@ -63,7 +63,6 @@ typedef intmax_t arith_t;
|
||||
#define ARITH_MAX INTMAX_MAX
|
||||
|
||||
typedef void *pointer;
|
||||
#define MKINIT /* empty */
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
|
@ -72,7 +72,7 @@ __FBSDID("$FreeBSD$");
|
||||
#define S_RESET 5 /* temporary - to reset a hard ignored sig */
|
||||
|
||||
|
||||
MKINIT char sigmode[NSIG]; /* current value of signal */
|
||||
static char sigmode[NSIG]; /* current value of signal */
|
||||
volatile sig_atomic_t pendingsig; /* indicates some signal received */
|
||||
int in_dotrap; /* do we execute in a trap handler? */
|
||||
static char *volatile trap[NSIG]; /* trap handler commands */
|
||||
|
@ -583,6 +583,8 @@ if ($opt_x) {
|
||||
die "$PNAME: failed to open $PNAME.$$.log: $!\n"
|
||||
unless (!$opt_l || open(LOG, ">$PNAME.$$.log"));
|
||||
|
||||
$ENV{'DTRACE_DEBUG_REGSET'} = 'true';
|
||||
|
||||
if ($opt_g) {
|
||||
$ENV{'UMEM_DEBUG'} = 'default,verbose';
|
||||
$ENV{'UMEM_LOGGING'} = 'fail,contents';
|
||||
|
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
#pragma D option quiet
|
||||
|
||||
/*
|
||||
* Make sure the sizes of compatible keys doesn't affect the sort order.
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
@[(int)1, 0] = sum(10);
|
||||
@[(uint64_t)2, 0] = sum(20);
|
||||
@[(int)3, 0] = sum(30);
|
||||
@[(uint64_t)4, 0] = sum(40);
|
||||
printa(@);
|
||||
|
||||
exit(0);
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
|
||||
1 0 10
|
||||
2 0 20
|
||||
3 0 30
|
||||
4 0 40
|
||||
|
@ -0,0 +1,8 @@
|
||||
The value of i is 6
|
||||
The value of i is 18
|
||||
The value of i is 72
|
||||
The value of i is 25920
|
||||
The value of i is 935761216
|
||||
The value of i is -91738734
|
||||
The value of i is -91738729
|
||||
|
@ -0,0 +1,50 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Test compile-time casting between integer types of different size.
|
||||
*/
|
||||
|
||||
#pragma D option quiet
|
||||
|
||||
int64_t x;
|
||||
|
||||
BEGIN
|
||||
{
|
||||
x = (int32_t)(int16_t)0xfff0;
|
||||
printf("%16x %20d %20u\n", x, x, x);
|
||||
x = (int32_t)(uint16_t)0xfff0;
|
||||
printf("%16x %20d %20u\n", x, x, x);
|
||||
x = (uint32_t)(int16_t)0xfff0;
|
||||
printf("%16x %20d %20u\n", x, x, x);
|
||||
x = (uint32_t)(uint16_t)0xfff0;
|
||||
printf("%16x %20d %20u\n", x, x, x);
|
||||
printf("\n");
|
||||
|
||||
x = (int16_t)(int32_t)0xfff0;
|
||||
printf("%16x %20d %20u\n", x, x, x);
|
||||
x = (int16_t)(uint32_t)0xfff0;
|
||||
printf("%16x %20d %20u\n", x, x, x);
|
||||
x = (uint16_t)(int32_t)0xfff0;
|
||||
printf("%16x %20d %20u\n", x, x, x);
|
||||
x = (uint16_t)(uint32_t)0xfff0;
|
||||
printf("%16x %20d %20u\n", x, x, x);
|
||||
|
||||
exit(0);
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
fffffffffffffff0 -16 18446744073709551600
|
||||
fff0 65520 65520
|
||||
fffffff0 4294967280 4294967280
|
||||
fff0 65520 65520
|
||||
|
||||
fffffffffffffff0 -16 18446744073709551600
|
||||
fffffffffffffff0 -16 18446744073709551600
|
||||
fff0 65520 65520
|
||||
fff0 65520 65520
|
||||
|
@ -1,57 +0,0 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#pragma ident "%Z%%M% %I% %E% SMI"
|
||||
|
||||
/*
|
||||
* ASSERTION:
|
||||
* Complex expressions.
|
||||
* Call complex expressions and make sure test succeeds.
|
||||
* Match expected output in tst.complex.d.out
|
||||
*
|
||||
* SECTION: Types, Operators, and Expressions/Arithmetic Operators
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma D option quiet
|
||||
|
||||
BEGIN
|
||||
{
|
||||
i = 0;
|
||||
i = i++ + ++i;
|
||||
printf("The value of i is %d\n", i);
|
||||
i = i-- - --i;
|
||||
printf("The value of i is %d\n", i);
|
||||
i = i-- + ++i;
|
||||
printf("The value of i is %d\n", i);
|
||||
i += i++ + -- i + ++i - ++i * i ;
|
||||
printf("The value of i is %d\n", i);
|
||||
i -= i++ * 3;
|
||||
printf("The value of i is %d\n", i);
|
||||
i = i++/i--+i++-++i-++i;
|
||||
printf("The value of i is %d\n", i);
|
||||
exit (0);
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Test narrowing at assignment.
|
||||
*/
|
||||
|
||||
#pragma D option quiet
|
||||
|
||||
uint16_t x;
|
||||
uint32_t y;
|
||||
|
||||
BEGIN
|
||||
{
|
||||
x = 0xbeefcafe;
|
||||
y = x;
|
||||
printf("%x", y); /* where's the beef? */
|
||||
|
||||
exit(0);
|
||||
}
|
@ -0,0 +1 @@
|
||||
cafe
|
@ -0,0 +1,52 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Test execution-time casting between integer types of different size.
|
||||
*/
|
||||
|
||||
#pragma D option quiet
|
||||
|
||||
int64_t x;
|
||||
|
||||
BEGIN
|
||||
{
|
||||
z = 0xfff0;
|
||||
|
||||
x = (int32_t)(int16_t)z;
|
||||
printf("%16x %20d %20u\n", x, x, x);
|
||||
x = (int32_t)(uint16_t)z;
|
||||
printf("%16x %20d %20u\n", x, x, x);
|
||||
x = (uint32_t)(int16_t)z;
|
||||
printf("%16x %20d %20u\n", x, x, x);
|
||||
x = (uint32_t)(uint16_t)z;
|
||||
printf("%16x %20d %20u\n", x, x, x);
|
||||
printf("\n");
|
||||
|
||||
x = (int16_t)(int32_t)z;
|
||||
printf("%16x %20d %20u\n", x, x, x);
|
||||
x = (int16_t)(uint32_t)z;
|
||||
printf("%16x %20d %20u\n", x, x, x);
|
||||
x = (uint16_t)(int32_t)z;
|
||||
printf("%16x %20d %20u\n", x, x, x);
|
||||
x = (uint16_t)(uint32_t)z;
|
||||
printf("%16x %20d %20u\n", x, x, x);
|
||||
|
||||
exit(0);
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
fffffffffffffff0 -16 18446744073709551600
|
||||
fff0 65520 65520
|
||||
fffffff0 4294967280 4294967280
|
||||
fff0 65520 65520
|
||||
|
||||
fffffffffffffff0 -16 18446744073709551600
|
||||
fffffffffffffff0 -16 18446744073709551600
|
||||
fff0 65520 65520
|
||||
fff0 65520 65520
|
||||
|
@ -36,12 +36,12 @@
|
||||
#pragma D option quiet
|
||||
#pragma D option statusrate=10ms
|
||||
|
||||
fbt::ioctl:entry
|
||||
fbt::kern_ioctl:entry
|
||||
{
|
||||
printf("Entering the ioctl function\n");
|
||||
}
|
||||
|
||||
fbt::ioctl:return
|
||||
fbt::kern_ioctl:return
|
||||
{
|
||||
printf("Returning from ioctl function\n");
|
||||
exit(0);
|
||||
|
@ -36,7 +36,7 @@
|
||||
#pragma D option quiet
|
||||
#pragma D option statusrate=10ms
|
||||
|
||||
fbt::ioctl:return
|
||||
fbt::kern_ioctl:return
|
||||
{
|
||||
printf("The function return value is stored in %u\n", arg1);
|
||||
exit(0);
|
||||
|
@ -36,13 +36,13 @@
|
||||
#pragma D option quiet
|
||||
#pragma D option statusrate=10ms
|
||||
|
||||
fbt::ioctl:entry
|
||||
fbt::kern_ioctl:entry
|
||||
{
|
||||
printf("Entering the ioctl function\n");
|
||||
printf("The few arguments are %u %u %u %u\n", arg0, arg1, arg2, arg3);
|
||||
}
|
||||
|
||||
fbt::ioctl:return
|
||||
fbt::kern_ioctl:return
|
||||
{
|
||||
printf("Returning from ioctl function\n");
|
||||
printf("The few arguments are %u %u %u %u\n", arg0, arg1, arg2, arg3);
|
||||
|
@ -41,12 +41,12 @@ BEGIN
|
||||
self->traceme = 1;
|
||||
}
|
||||
|
||||
fbt::ioctl:entry
|
||||
fbt::kern_ioctl:entry
|
||||
{
|
||||
printf("Entering the function\n");
|
||||
}
|
||||
|
||||
fbt::ioctl:return
|
||||
fbt::kern_ioctl:return
|
||||
{
|
||||
printf("The offset = %u\n", arg0);
|
||||
exit(0);
|
||||
|
@ -36,14 +36,14 @@
|
||||
#pragma D option quiet
|
||||
#pragma D option statusrate=10ms
|
||||
|
||||
fbt::ioctl:entry
|
||||
fbt::kern_ioctl:entry
|
||||
{
|
||||
printf("Entering the ioctl function\n");
|
||||
printf("The few arguments are %u %u %u %u\n", arg0, arg1, arg2, arg3);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
fbt::ioctl:return
|
||||
fbt::kern_ioctl:return
|
||||
{
|
||||
printf("Returning from ioctl function\n");
|
||||
printf("The few arguments are %u %u %u %u\n", arg0, arg1, arg2, arg3);
|
||||
|
@ -36,7 +36,7 @@
|
||||
#pragma D option quiet
|
||||
#pragma D option statusrate=10ms
|
||||
|
||||
fbt::ioctl:return
|
||||
fbt::kern_ioctl:return
|
||||
/arg1 == 0/
|
||||
{
|
||||
printf("%s %x returned 0", probefunc, arg0);
|
||||
|
@ -36,7 +36,7 @@
|
||||
#pragma D option quiet
|
||||
#pragma D option statusrate=10ms
|
||||
|
||||
fbt::ioctl:entry
|
||||
fbt::kern_ioctl:entry
|
||||
{
|
||||
self->traceme = 1;
|
||||
}
|
||||
@ -47,7 +47,7 @@ fbt:::entry
|
||||
printf("called %s\n", probefunc);
|
||||
}
|
||||
|
||||
fbt::ioctl:return
|
||||
fbt::kern_ioctl:return
|
||||
/self->traceme/
|
||||
{
|
||||
self->traceme = 0;
|
||||
|
@ -24,7 +24,9 @@
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#pragma ident "%Z%%M% %I% %E% SMI"
|
||||
/*
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
#pragma D option quiet
|
||||
|
||||
@ -36,3 +38,8 @@ BEGIN
|
||||
printf("%s\n", strjoin("", ""));
|
||||
exit(0);
|
||||
}
|
||||
|
||||
BEGIN
|
||||
{
|
||||
exit(1);
|
||||
}
|
||||
|
@ -24,7 +24,9 @@
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#pragma ident "%Z%%M% %I% %E% SMI"
|
||||
/*
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* ASSERTION: This test reproduces the alignment error.
|
||||
@ -39,9 +41,10 @@
|
||||
|
||||
BEGIN
|
||||
{
|
||||
x = (int *) 64;
|
||||
x = (int *)64;
|
||||
y = *x;
|
||||
trace(y);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
ERROR
|
||||
|
@ -24,7 +24,9 @@
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#pragma ident "%Z%%M% %I% %E% SMI"
|
||||
/*
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* ASSERTION: D pointers do not allow invalid pointer accesses.
|
||||
@ -44,6 +46,7 @@ BEGIN
|
||||
y = (int *) (x - 3300778156056);
|
||||
*y = 3;
|
||||
trace(*y);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
ERROR
|
||||
|
@ -24,7 +24,9 @@
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#pragma ident "%Z%%M% %I% %E% SMI"
|
||||
/*
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* ASSERTION: D pointers do not allow invalid pointer accesses.
|
||||
@ -39,9 +41,10 @@
|
||||
|
||||
BEGIN
|
||||
{
|
||||
y = (int *) (-33007);
|
||||
y = (int *)-33007;
|
||||
*y = 3;
|
||||
trace(*y);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
ERROR
|
||||
|
@ -24,7 +24,9 @@
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#pragma ident "%Z%%M% %I% %E% SMI"
|
||||
/*
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* ASSERTION: Demonstrating valid memory access.
|
||||
@ -40,10 +42,11 @@
|
||||
BEGIN
|
||||
{
|
||||
x = (int *)alloca(sizeof (int));
|
||||
printf("Address x: %x\n", (int) x);
|
||||
y = (int *) (x - 2);
|
||||
printf("Address x: %x\n", (int)x);
|
||||
y = (int *)(x - 2);
|
||||
*y = 3;
|
||||
printf("Address y: %x\tValue: %d\n", (int) y, *y);
|
||||
printf("Address y: %x\tValue: %d\n", (int)y, *y);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
ERROR
|
||||
|
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
@ = count();
|
||||
print(@);
|
||||
}
|
||||
|
||||
BEGIN
|
||||
{
|
||||
exit(0);
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
print(*curpsinfo);
|
||||
}
|
@ -20,10 +20,15 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011 by Delphix. All rights reserved.
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
print((void)`p0);
|
||||
}
|
||||
|
||||
BEGIN
|
||||
{
|
||||
exit(0);
|
||||
}
|
||||
|
@ -20,10 +20,15 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011 by Delphix. All rights reserved.
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
print();
|
||||
}
|
||||
|
||||
BEGIN
|
||||
{
|
||||
exit(0);
|
||||
}
|
||||
|
@ -0,0 +1,28 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
print(*curpsinfo);
|
||||
}
|
||||
|
||||
BEGIN
|
||||
{
|
||||
exit(0);
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
#pragma D option quiet
|
||||
|
||||
typedef struct pancakes {
|
||||
int i;
|
||||
string s;
|
||||
timespec_t t;
|
||||
} pancakes_t;
|
||||
|
||||
translator pancakes_t < void *V > {
|
||||
i = 2 * 10;
|
||||
s = strjoin("I like ", "pancakes");
|
||||
t = *(timespec_t *)`dtrace_zero;
|
||||
};
|
||||
|
||||
BEGIN
|
||||
{
|
||||
print(*(xlate < pancakes_t * > ((void *)NULL)));
|
||||
}
|
||||
|
||||
BEGIN
|
||||
{
|
||||
exit(0);
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
pancakes_t {
|
||||
int i = 0x14
|
||||
string s = [ "I like pancakes" ]
|
||||
timespec_t t = {
|
||||
time_t tv_sec = 0
|
||||
long tv_nsec = 0
|
||||
}
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
|
||||
239
|
||||
52719
|
||||
-17
|
||||
-12817
|
||||
-1867788817
|
||||
1311768467294899695
|
||||
|
||||
|
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Check %d v. %i v. %u.
|
||||
*/
|
||||
|
||||
#pragma D option quiet
|
||||
|
||||
uint16_t x;
|
||||
int16_t y;
|
||||
|
||||
BEGIN
|
||||
{
|
||||
x = 0xffffffff;
|
||||
y = 0xffffffff;
|
||||
|
||||
printf("%d %i %u\n", x, x, x);
|
||||
printf("%d %i %u\n", y, y, y);
|
||||
|
||||
exit(0);
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
65535 -1 65535
|
||||
-1 -1 65535
|
||||
|
@ -24,7 +24,9 @@
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#pragma ident "%Z%%M% %I% %E% SMI"
|
||||
/*
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* ASSERTION:
|
||||
@ -39,7 +41,7 @@
|
||||
*/
|
||||
|
||||
|
||||
#pragma D option bufsize=16
|
||||
#pragma D option bufsize=32
|
||||
#pragma D option bufpolicy=ring
|
||||
#pragma D option statusrate=1nsec
|
||||
|
||||
|
@ -24,7 +24,9 @@
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#pragma ident "%Z%%M% %I% %E% SMI"
|
||||
/*
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* ASSERTION:
|
||||
|
@ -24,8 +24,9 @@
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#pragma ident "%Z%%M% %I% %E% SMI"
|
||||
|
||||
/*
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* ASSERTION:
|
||||
@ -39,3 +40,8 @@ BEGIN
|
||||
|
||||
trace();
|
||||
}
|
||||
|
||||
BEGIN
|
||||
{
|
||||
exit(0);
|
||||
}
|
||||
|
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
@ = count();
|
||||
trace(@);
|
||||
}
|
||||
|
||||
BEGIN
|
||||
{
|
||||
exit(0);
|
||||
}
|
@ -24,7 +24,9 @@
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#pragma ident "%Z%%M% %I% %E% SMI"
|
||||
/*
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* ASSERTION:
|
||||
@ -37,3 +39,8 @@ BEGIN
|
||||
{
|
||||
trace((void)`kmem_flags);
|
||||
}
|
||||
|
||||
BEGIN
|
||||
{
|
||||
exit(0);
|
||||
}
|
||||
|
@ -0,0 +1,28 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
trace(*curpsinfo);
|
||||
}
|
||||
|
||||
BEGIN
|
||||
{
|
||||
exit(0);
|
||||
}
|
@ -1,61 +0,0 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#pragma ident "%Z%%M% %I% %E% SMI"
|
||||
|
||||
/*
|
||||
* ASSERTION:
|
||||
* The D inline translation mechanism can be used to facilitate stable
|
||||
* translations.
|
||||
*
|
||||
* SECTION: Translators/ Translator Declarations
|
||||
* SECTION: Translators/ Translate Operator
|
||||
* SECTION: Translators/Stable Translations
|
||||
*
|
||||
* NOTES: Uncomment the pragma that explicitly resets the attributes of
|
||||
* myinfo identifier to Stable/Stable/Common from Private/Private/Unknown.
|
||||
* Run the program with and without the comments as:
|
||||
* /usr/sbin/dtrace -vs man.TestTransStability.d
|
||||
*/
|
||||
|
||||
#pragma D option quiet
|
||||
|
||||
inline lwpsinfo_t *myinfo = xlate < lwpsinfo_t *> (curthread);
|
||||
|
||||
/*
|
||||
#pragma D attributes Stable/Stable/Common myinfo
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
trace(myinfo->pr_flag);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
ERROR
|
||||
{
|
||||
exit(1);
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
#
|
||||
# CDDL HEADER START
|
||||
#
|
||||
# The contents of this file are subject to the terms of the
|
||||
# Common Development and Distribution License (the "License").
|
||||
# You may not use this file except in compliance with the License.
|
||||
#
|
||||
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
# or http://www.opensolaris.org/os/licensing.
|
||||
# See the License for the specific language governing permissions
|
||||
# and limitations under the License.
|
||||
#
|
||||
# When distributing Covered Code, include this CDDL HEADER in each
|
||||
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
# If applicable, add the following below this CDDL HEADER, with the
|
||||
# fields enclosed by brackets "[]" replaced with your own identifying
|
||||
# information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
#
|
||||
# CDDL HEADER END
|
||||
#
|
||||
|
||||
#
|
||||
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
|
||||
# Use is subject to license terms.
|
||||
#
|
||||
|
||||
#
|
||||
# Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
#
|
||||
|
||||
#
|
||||
# Test the output for stable translations.
|
||||
#
|
||||
|
||||
if [ $# != 1 ]; then
|
||||
echo expected one argument: '<'dtrace-path'>'
|
||||
exit 2
|
||||
fi
|
||||
|
||||
dtrace=$1
|
||||
|
||||
$dtrace -v -s /dev/stdin <<EOF
|
||||
|
||||
#pragma D option quiet
|
||||
|
||||
inline lwpsinfo_t *myinfo = xlate < lwpsinfo_t *> (curthread);
|
||||
|
||||
#pragma D attributes Stable/Stable/Common myinfo
|
||||
|
||||
BEGIN
|
||||
{
|
||||
this->a = myinfo->pr_flag;
|
||||
exit(0);
|
||||
}
|
||||
|
||||
BEGIN
|
||||
{
|
||||
exit(1);
|
||||
}
|
||||
EOF
|
||||
|
||||
exit $?
|
@ -0,0 +1,14 @@
|
||||
|
||||
Stability attributes for script /dev/stdin:
|
||||
|
||||
Minimum Probe Description Attributes
|
||||
Identifier Names: Unstable
|
||||
Data Semantics: Unstable
|
||||
Dependency Class: Common
|
||||
|
||||
Minimum Statement Attributes
|
||||
Identifier Names: Stable
|
||||
Data Semantics: Stable
|
||||
Dependency Class: Common
|
||||
|
||||
|
@ -0,0 +1,60 @@
|
||||
#
|
||||
# CDDL HEADER START
|
||||
#
|
||||
# The contents of this file are subject to the terms of the
|
||||
# Common Development and Distribution License (the "License").
|
||||
# You may not use this file except in compliance with the License.
|
||||
#
|
||||
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
# or http://www.opensolaris.org/os/licensing.
|
||||
# See the License for the specific language governing permissions
|
||||
# and limitations under the License.
|
||||
#
|
||||
# When distributing Covered Code, include this CDDL HEADER in each
|
||||
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
# If applicable, add the following below this CDDL HEADER, with the
|
||||
# fields enclosed by brackets "[]" replaced with your own identifying
|
||||
# information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
#
|
||||
# CDDL HEADER END
|
||||
#
|
||||
|
||||
#
|
||||
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
|
||||
# Use is subject to license terms.
|
||||
#
|
||||
|
||||
#
|
||||
# Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
#
|
||||
|
||||
#
|
||||
# Test the output of unstable translations.
|
||||
#
|
||||
|
||||
if [ $# != 1 ]; then
|
||||
echo expected one argument: '<'dtrace-path'>'
|
||||
exit 2
|
||||
fi
|
||||
|
||||
dtrace=$1
|
||||
|
||||
$dtrace -v -s /dev/stdin <<EOF
|
||||
|
||||
#pragma D option quiet
|
||||
|
||||
inline lwpsinfo_t *myinfo = xlate < lwpsinfo_t *> (curthread);
|
||||
|
||||
BEGIN
|
||||
{
|
||||
this->a = myinfo->pr_flag;
|
||||
exit(0);
|
||||
}
|
||||
|
||||
BEGIN
|
||||
{
|
||||
exit(1);
|
||||
}
|
||||
EOF
|
||||
|
||||
exit $?
|
@ -0,0 +1,14 @@
|
||||
|
||||
Stability attributes for script /dev/stdin:
|
||||
|
||||
Minimum Probe Description Attributes
|
||||
Identifier Names: Unstable
|
||||
Data Semantics: Unstable
|
||||
Dependency Class: Common
|
||||
|
||||
Minimum Statement Attributes
|
||||
Identifier Names: Private
|
||||
Data Semantics: Private
|
||||
Dependency Class: Unknown
|
||||
|
||||
|
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Make sure we can scope types with modifiers.
|
||||
*/
|
||||
|
||||
BEGIN
|
||||
{
|
||||
trace((D`int *)0);
|
||||
trace((const D`int *)0);
|
||||
exit(0);
|
||||
}
|
@ -3530,6 +3530,12 @@ zfs_snapshot_cb(zfs_handle_t *zhp, void *arg)
|
||||
int rv = 0;
|
||||
int error;
|
||||
|
||||
if (sd->sd_recursive &&
|
||||
zfs_prop_get_int(zhp, ZFS_PROP_INCONSISTENT) != 0) {
|
||||
zfs_close(zhp);
|
||||
return (0);
|
||||
}
|
||||
|
||||
error = asprintf(&name, "%s@%s", zfs_get_name(zhp), sd->sd_snapname);
|
||||
if (error == -1)
|
||||
nomem();
|
||||
|
@ -26,6 +26,7 @@
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011, Joyent, Inc. All rights reserved.
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
@ -894,33 +895,14 @@ dt_aggregate_valcmp(const void *lhs, const void *rhs)
|
||||
caddr_t rdata = rh->dtahe_data.dtada_data;
|
||||
dtrace_recdesc_t *lrec, *rrec;
|
||||
int64_t *laddr, *raddr;
|
||||
int rval, i;
|
||||
int rval;
|
||||
|
||||
if ((rval = dt_aggregate_hashcmp(lhs, rhs)) != 0)
|
||||
return (rval);
|
||||
assert(lagg->dtagd_nrecs == ragg->dtagd_nrecs);
|
||||
|
||||
if (lagg->dtagd_nrecs > ragg->dtagd_nrecs)
|
||||
return (DT_GREATERTHAN);
|
||||
lrec = &lagg->dtagd_rec[lagg->dtagd_nrecs - 1];
|
||||
rrec = &ragg->dtagd_rec[ragg->dtagd_nrecs - 1];
|
||||
|
||||
if (lagg->dtagd_nrecs < ragg->dtagd_nrecs)
|
||||
return (DT_LESSTHAN);
|
||||
|
||||
for (i = 0; i < lagg->dtagd_nrecs; i++) {
|
||||
lrec = &lagg->dtagd_rec[i];
|
||||
rrec = &ragg->dtagd_rec[i];
|
||||
|
||||
if (lrec->dtrd_offset < rrec->dtrd_offset)
|
||||
return (DT_LESSTHAN);
|
||||
|
||||
if (lrec->dtrd_offset > rrec->dtrd_offset)
|
||||
return (DT_GREATERTHAN);
|
||||
|
||||
if (lrec->dtrd_action < rrec->dtrd_action)
|
||||
return (DT_LESSTHAN);
|
||||
|
||||
if (lrec->dtrd_action > rrec->dtrd_action)
|
||||
return (DT_GREATERTHAN);
|
||||
}
|
||||
assert(lrec->dtrd_action == rrec->dtrd_action);
|
||||
|
||||
laddr = (int64_t *)(uintptr_t)(ldata + lrec->dtrd_offset);
|
||||
raddr = (int64_t *)(uintptr_t)(rdata + rrec->dtrd_offset);
|
||||
|
@ -22,7 +22,7 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, Joyent Inc. All rights reserved.
|
||||
* Copyright (c) 2011 by Delphix. All rights reserved.
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -664,62 +664,53 @@ static void
|
||||
dt_action_trace(dtrace_hdl_t *dtp, dt_node_t *dnp, dtrace_stmtdesc_t *sdp)
|
||||
{
|
||||
dtrace_actdesc_t *ap = dt_stmt_action(dtp, sdp);
|
||||
boolean_t istrace = (dnp->dn_ident->di_id == DT_ACT_TRACE);
|
||||
const char *act = istrace ? "trace" : "print";
|
||||
|
||||
if (dt_node_is_void(dnp->dn_args)) {
|
||||
dnerror(dnp->dn_args, D_TRACE_VOID,
|
||||
"trace( ) may not be applied to a void expression\n");
|
||||
dnerror(dnp->dn_args, istrace ? D_TRACE_VOID : D_PRINT_VOID,
|
||||
"%s( ) may not be applied to a void expression\n", act);
|
||||
}
|
||||
|
||||
if (dt_node_is_dynamic(dnp->dn_args)) {
|
||||
dnerror(dnp->dn_args, D_TRACE_DYN,
|
||||
"trace( ) may not be applied to a dynamic expression\n");
|
||||
if (dt_node_resolve(dnp->dn_args, DT_IDENT_XLPTR) != NULL) {
|
||||
dnerror(dnp->dn_args, istrace ? D_TRACE_DYN : D_PRINT_DYN,
|
||||
"%s( ) may not be applied to a translated pointer\n", act);
|
||||
}
|
||||
|
||||
dt_cg(yypcb, dnp->dn_args);
|
||||
ap->dtad_difo = dt_as(yypcb);
|
||||
ap->dtad_kind = DTRACEACT_DIFEXPR;
|
||||
}
|
||||
|
||||
/*
|
||||
* The print() action behaves identically to trace(), except that it stores the
|
||||
* CTF type of the argument (if present) within the DOF for the DIFEXPR action.
|
||||
* To do this, we set the 'dtsd_strdata' to point to the fully-qualified CTF
|
||||
* type ID for the result of the DIF action. We use the ID instead of the name
|
||||
* to handles complex types like arrays and function pointers that can't be
|
||||
* resolved by ctf_type_lookup(). This is later processed by
|
||||
* dtrace_dof_create() and turned into a reference into the string table so
|
||||
* that we can get the type information when we process the data after the
|
||||
* fact.
|
||||
*/
|
||||
static void
|
||||
dt_action_print(dtrace_hdl_t *dtp, dt_node_t *dnp, dtrace_stmtdesc_t *sdp)
|
||||
{
|
||||
dtrace_actdesc_t *ap = dt_stmt_action(dtp, sdp);
|
||||
dt_node_t *dret;
|
||||
size_t len;
|
||||
dt_module_t *dmp;
|
||||
|
||||
if (dt_node_is_void(dnp->dn_args)) {
|
||||
dnerror(dnp->dn_args, D_PRINT_VOID,
|
||||
"print( ) may not be applied to a void expression\n");
|
||||
}
|
||||
|
||||
if (dt_node_is_dynamic(dnp->dn_args)) {
|
||||
dnerror(dnp->dn_args, D_PRINT_DYN,
|
||||
"print( ) may not be applied to a dynamic expression\n");
|
||||
if (dnp->dn_args->dn_kind == DT_NODE_AGG) {
|
||||
dnerror(dnp->dn_args, istrace ? D_TRACE_AGG : D_PRINT_AGG,
|
||||
"%s( ) may not be applied to an aggregation%s\n", act,
|
||||
istrace ? "" : " -- did you mean printa()?");
|
||||
}
|
||||
|
||||
dt_cg(yypcb, dnp->dn_args);
|
||||
|
||||
dret = yypcb->pcb_dret;
|
||||
dmp = dt_module_lookup_by_ctf(dtp, dret->dn_ctfp);
|
||||
/*
|
||||
* The print() action behaves identically to trace(), except that it
|
||||
* stores the CTF type of the argument (if present) within the DOF for
|
||||
* the DIFEXPR action. To do this, we set the 'dtsd_strdata' to point
|
||||
* to the fully-qualified CTF type ID for the result of the DIF
|
||||
* action. We use the ID instead of the name to handles complex types
|
||||
* like arrays and function pointers that can't be resolved by
|
||||
* ctf_type_lookup(). This is later processed by dtrace_dof_create()
|
||||
* and turned into a reference into the string table so that we can
|
||||
* get the type information when we process the data after the fact.
|
||||
*/
|
||||
if (dnp->dn_ident->di_id == DT_ACT_PRINT) {
|
||||
dt_node_t *dret;
|
||||
size_t n;
|
||||
dt_module_t *dmp;
|
||||
|
||||
len = snprintf(NULL, 0, "%s`%ld", dmp->dm_name, dret->dn_type) + 1;
|
||||
sdp->dtsd_strdata = dt_alloc(dtp, len);
|
||||
if (sdp->dtsd_strdata == NULL)
|
||||
longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM);
|
||||
(void) snprintf(sdp->dtsd_strdata, len, "%s`%ld", dmp->dm_name,
|
||||
dret->dn_type);
|
||||
dret = yypcb->pcb_dret;
|
||||
dmp = dt_module_lookup_by_ctf(dtp, dret->dn_ctfp);
|
||||
|
||||
n = snprintf(NULL, 0, "%s`%ld", dmp->dm_name, dret->dn_type) + 1;
|
||||
sdp->dtsd_strdata = dt_alloc(dtp, n);
|
||||
if (sdp->dtsd_strdata == NULL)
|
||||
longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM);
|
||||
(void) snprintf(sdp->dtsd_strdata, n, "%s`%ld", dmp->dm_name,
|
||||
dret->dn_type);
|
||||
}
|
||||
|
||||
ap->dtad_difo = dt_as(yypcb);
|
||||
ap->dtad_kind = DTRACEACT_DIFEXPR;
|
||||
@ -1145,6 +1136,9 @@ dt_compile_fun(dtrace_hdl_t *dtp, dt_node_t *dnp, dtrace_stmtdesc_t *sdp)
|
||||
case DT_ACT_PANIC:
|
||||
dt_action_panic(dtp, dnp->dn_expr, sdp);
|
||||
break;
|
||||
case DT_ACT_PRINT:
|
||||
dt_action_trace(dtp, dnp->dn_expr, sdp);
|
||||
break;
|
||||
case DT_ACT_PRINTA:
|
||||
dt_action_printa(dtp, dnp->dn_expr, sdp);
|
||||
break;
|
||||
@ -1181,9 +1175,6 @@ dt_compile_fun(dtrace_hdl_t *dtp, dt_node_t *dnp, dtrace_stmtdesc_t *sdp)
|
||||
case DT_ACT_TRACE:
|
||||
dt_action_trace(dtp, dnp->dn_expr, sdp);
|
||||
break;
|
||||
case DT_ACT_PRINT:
|
||||
dt_action_print(dtp, dnp->dn_expr, sdp);
|
||||
break;
|
||||
case DT_ACT_TRACEMEM:
|
||||
dt_action_tracemem(dtp, dnp->dn_expr, sdp);
|
||||
break;
|
||||
@ -2559,7 +2550,8 @@ dt_compile(dtrace_hdl_t *dtp, int context, dtrace_probespec_t pspec, void *arg,
|
||||
}
|
||||
|
||||
out:
|
||||
if (context != DT_CTX_DTYPE && DT_TREEDUMP_PASS(dtp, 3))
|
||||
if (context != DT_CTX_DTYPE && yypcb->pcb_root != NULL &&
|
||||
DT_TREEDUMP_PASS(dtp, 3))
|
||||
dt_node_printr(yypcb->pcb_root, stderr, 0);
|
||||
|
||||
if (dtp->dt_cdefs_fd != -1 && (ftruncate64(dtp->dt_cdefs_fd, 0) == -1 ||
|
||||
|
@ -1387,6 +1387,162 @@ dt_cg_func_typeref(dtrace_hdl_t *dtp, dt_node_t *dnp)
|
||||
typs->dn_value = ctf_type_size(dtt.dtt_ctfp, dtt.dtt_type);
|
||||
}
|
||||
|
||||
typedef struct dt_xlmemb {
|
||||
dt_ident_t *dtxl_idp; /* translated ident */
|
||||
dt_irlist_t *dtxl_dlp; /* instruction list */
|
||||
dt_regset_t *dtxl_drp; /* register set */
|
||||
int dtxl_sreg; /* location of the translation input */
|
||||
int dtxl_dreg; /* location of our allocated buffer */
|
||||
} dt_xlmemb_t;
|
||||
|
||||
/*ARGSUSED*/
|
||||
static int
|
||||
dt_cg_xlate_member(const char *name, ctf_id_t type, ulong_t off, void *arg)
|
||||
{
|
||||
dt_xlmemb_t *dx = arg;
|
||||
dt_ident_t *idp = dx->dtxl_idp;
|
||||
dt_irlist_t *dlp = dx->dtxl_dlp;
|
||||
dt_regset_t *drp = dx->dtxl_drp;
|
||||
|
||||
dt_node_t *mnp;
|
||||
dt_xlator_t *dxp;
|
||||
|
||||
int reg, treg;
|
||||
uint32_t instr;
|
||||
size_t size;
|
||||
|
||||
/* Generate code for the translation. */
|
||||
dxp = idp->di_data;
|
||||
mnp = dt_xlator_member(dxp, name);
|
||||
|
||||
/* If there's no translator for the given member, skip it. */
|
||||
if (mnp == NULL)
|
||||
return (0);
|
||||
|
||||
dxp->dx_ident->di_flags |= DT_IDFLG_CGREG;
|
||||
dxp->dx_ident->di_id = dx->dtxl_sreg;
|
||||
|
||||
dt_cg_node(mnp->dn_membexpr, dlp, drp);
|
||||
|
||||
dxp->dx_ident->di_flags &= ~DT_IDFLG_CGREG;
|
||||
dxp->dx_ident->di_id = 0;
|
||||
|
||||
treg = mnp->dn_membexpr->dn_reg;
|
||||
|
||||
/* Compute the offset into our buffer and store the result there. */
|
||||
reg = dt_regset_alloc(drp);
|
||||
|
||||
dt_cg_setx(dlp, reg, off / NBBY);
|
||||
instr = DIF_INSTR_FMT(DIF_OP_ADD, dx->dtxl_dreg, reg, reg);
|
||||
dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr));
|
||||
|
||||
size = ctf_type_size(mnp->dn_membexpr->dn_ctfp,
|
||||
mnp->dn_membexpr->dn_type);
|
||||
if (dt_node_is_scalar(mnp->dn_membexpr)) {
|
||||
/*
|
||||
* Copying scalars is simple.
|
||||
*/
|
||||
switch (size) {
|
||||
case 1:
|
||||
instr = DIF_INSTR_STORE(DIF_OP_STB, treg, reg);
|
||||
break;
|
||||
case 2:
|
||||
instr = DIF_INSTR_STORE(DIF_OP_STH, treg, reg);
|
||||
break;
|
||||
case 4:
|
||||
instr = DIF_INSTR_STORE(DIF_OP_STW, treg, reg);
|
||||
break;
|
||||
case 8:
|
||||
instr = DIF_INSTR_STORE(DIF_OP_STX, treg, reg);
|
||||
break;
|
||||
default:
|
||||
xyerror(D_UNKNOWN, "internal error -- unexpected "
|
||||
"size: %lu\n", (ulong_t)size);
|
||||
}
|
||||
|
||||
dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr));
|
||||
|
||||
} else if (dt_node_is_string(mnp->dn_membexpr)) {
|
||||
int szreg;
|
||||
|
||||
/*
|
||||
* Use the copys instruction for strings.
|
||||
*/
|
||||
szreg = dt_regset_alloc(drp);
|
||||
dt_cg_setx(dlp, szreg, size);
|
||||
instr = DIF_INSTR_COPYS(treg, szreg, reg);
|
||||
dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr));
|
||||
dt_regset_free(drp, szreg);
|
||||
} else {
|
||||
int szreg;
|
||||
|
||||
/*
|
||||
* If it's anything else then we'll just bcopy it.
|
||||
*/
|
||||
szreg = dt_regset_alloc(drp);
|
||||
dt_cg_setx(dlp, szreg, size);
|
||||
dt_irlist_append(dlp,
|
||||
dt_cg_node_alloc(DT_LBL_NONE, DIF_INSTR_FLUSHTS));
|
||||
instr = DIF_INSTR_PUSHTS(DIF_OP_PUSHTV, DIF_TYPE_CTF,
|
||||
DIF_REG_R0, treg);
|
||||
dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr));
|
||||
instr = DIF_INSTR_PUSHTS(DIF_OP_PUSHTV, DIF_TYPE_CTF,
|
||||
DIF_REG_R0, reg);
|
||||
dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr));
|
||||
instr = DIF_INSTR_PUSHTS(DIF_OP_PUSHTV, DIF_TYPE_CTF,
|
||||
DIF_REG_R0, szreg);
|
||||
dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr));
|
||||
instr = DIF_INSTR_CALL(DIF_SUBR_BCOPY, szreg);
|
||||
dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr));
|
||||
dt_regset_free(drp, szreg);
|
||||
}
|
||||
|
||||
dt_regset_free(drp, reg);
|
||||
dt_regset_free(drp, treg);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* If we're expanding a translated type, we create an appropriately sized
|
||||
* buffer with alloca() and then translate each member into it.
|
||||
*/
|
||||
static int
|
||||
dt_cg_xlate_expand(dt_node_t *dnp, dt_ident_t *idp, dt_irlist_t *dlp,
|
||||
dt_regset_t *drp)
|
||||
{
|
||||
dt_xlmemb_t dlm;
|
||||
uint32_t instr;
|
||||
int dreg;
|
||||
size_t size;
|
||||
|
||||
dreg = dt_regset_alloc(drp);
|
||||
size = ctf_type_size(dnp->dn_ident->di_ctfp, dnp->dn_ident->di_type);
|
||||
|
||||
/* Call alloca() to create the buffer. */
|
||||
dt_cg_setx(dlp, dreg, size);
|
||||
|
||||
dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, DIF_INSTR_FLUSHTS));
|
||||
|
||||
instr = DIF_INSTR_PUSHTS(DIF_OP_PUSHTV, DIF_TYPE_CTF, DIF_REG_R0, dreg);
|
||||
dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr));
|
||||
|
||||
instr = DIF_INSTR_CALL(DIF_SUBR_ALLOCA, dreg);
|
||||
dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr));
|
||||
|
||||
/* Generate the translation for each member. */
|
||||
dlm.dtxl_idp = idp;
|
||||
dlm.dtxl_dlp = dlp;
|
||||
dlm.dtxl_drp = drp;
|
||||
dlm.dtxl_sreg = dnp->dn_reg;
|
||||
dlm.dtxl_dreg = dreg;
|
||||
(void) ctf_member_iter(dnp->dn_ident->di_ctfp,
|
||||
dnp->dn_ident->di_type, dt_cg_xlate_member,
|
||||
&dlm);
|
||||
|
||||
return (dreg);
|
||||
}
|
||||
|
||||
static void
|
||||
dt_cg_node(dt_node_t *dnp, dt_irlist_t *dlp, dt_regset_t *drp)
|
||||
{
|
||||
@ -1600,7 +1756,16 @@ dt_cg_node(dt_node_t *dnp, dt_irlist_t *dlp, dt_regset_t *drp)
|
||||
dt_cg_node(dnp->dn_child, dlp, drp);
|
||||
dnp->dn_reg = dnp->dn_child->dn_reg;
|
||||
|
||||
if (!(dnp->dn_flags & DT_NF_REF)) {
|
||||
if (dt_node_is_dynamic(dnp->dn_child)) {
|
||||
int reg;
|
||||
idp = dt_node_resolve(dnp->dn_child, DT_IDENT_XLPTR);
|
||||
assert(idp != NULL);
|
||||
reg = dt_cg_xlate_expand(dnp, idp, dlp, drp);
|
||||
|
||||
dt_regset_free(drp, dnp->dn_child->dn_reg);
|
||||
dnp->dn_reg = reg;
|
||||
|
||||
} else if (!(dnp->dn_flags & DT_NF_REF)) {
|
||||
uint_t ubit = dnp->dn_flags & DT_NF_USERLAND;
|
||||
|
||||
/*
|
||||
@ -1998,6 +2163,13 @@ dt_cg(dt_pcb_t *pcb, dt_node_t *dnp)
|
||||
|
||||
dt_cg_node(dnp, &pcb->pcb_ir, pcb->pcb_regs);
|
||||
|
||||
if ((idp = dt_node_resolve(dnp, DT_IDENT_XLSOU)) != NULL) {
|
||||
int reg = dt_cg_xlate_expand(dnp, idp,
|
||||
&pcb->pcb_ir, pcb->pcb_regs);
|
||||
dt_regset_free(pcb->pcb_regs, dnp->dn_reg);
|
||||
dnp->dn_reg = reg;
|
||||
}
|
||||
|
||||
instr = DIF_INSTR_RET(dnp->dn_reg);
|
||||
dt_regset_free(pcb->pcb_regs, dnp->dn_reg);
|
||||
dt_irlist_append(&pcb->pcb_ir, dt_cg_node_alloc(DT_LBL_NONE, instr));
|
||||
|
@ -2018,13 +2018,13 @@ dt_consume_cpu(dtrace_hdl_t *dtp, FILE *fp, int cpu,
|
||||
uint64_t tracememsize = 0;
|
||||
dtrace_probedata_t data;
|
||||
uint64_t drops;
|
||||
data.dtpda_flow = dtp->dt_flow;
|
||||
data.dtpda_indent = dtp->dt_indent;
|
||||
data.dtpda_prefix = dtp->dt_prefix;
|
||||
|
||||
bzero(&data, sizeof (data));
|
||||
data.dtpda_handle = dtp;
|
||||
data.dtpda_cpu = cpu;
|
||||
data.dtpda_flow = dtp->dt_flow;
|
||||
data.dtpda_indent = dtp->dt_indent;
|
||||
data.dtpda_prefix = dtp->dt_prefix;
|
||||
|
||||
for (offs = buf->dtbd_oldest; offs < buf->dtbd_size; ) {
|
||||
dtrace_eprobedesc_t *epd;
|
||||
@ -2611,7 +2611,7 @@ typedef struct dt_begin {
|
||||
static int
|
||||
dt_consume_begin_probe(const dtrace_probedata_t *data, void *arg)
|
||||
{
|
||||
dt_begin_t *begin = (dt_begin_t *)arg;
|
||||
dt_begin_t *begin = arg;
|
||||
dtrace_probedesc_t *pd = data->dtpda_pdesc;
|
||||
|
||||
int r1 = (strcmp(pd->dtpd_provider, "dtrace") == 0);
|
||||
@ -2636,7 +2636,7 @@ static int
|
||||
dt_consume_begin_record(const dtrace_probedata_t *data,
|
||||
const dtrace_recdesc_t *rec, void *arg)
|
||||
{
|
||||
dt_begin_t *begin = (dt_begin_t *)arg;
|
||||
dt_begin_t *begin = arg;
|
||||
|
||||
return (begin->dtbgn_recfunc(data, rec, begin->dtbgn_arg));
|
||||
}
|
||||
|
@ -21,6 +21,7 @@
|
||||
*/
|
||||
/*
|
||||
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
@ -254,11 +255,6 @@ dt_decl_spec(ushort_t kind, char *name)
|
||||
ddp->dd_kind = kind;
|
||||
ddp->dd_name = name;
|
||||
|
||||
if (name != NULL && strchr(name, '`') != NULL) {
|
||||
xyerror(D_DECL_SCOPE, "D scoping operator may not be used "
|
||||
"in a type name\n");
|
||||
}
|
||||
|
||||
return (dt_decl_check(ddp));
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
|
@ -190,8 +190,10 @@ typedef enum {
|
||||
D_PRINTA_AGGPROTO, /* printa() aggregation mismatch */
|
||||
D_TRACE_VOID, /* trace() argument has void type */
|
||||
D_TRACE_DYN, /* trace() argument has dynamic type */
|
||||
D_TRACE_AGG, /* trace() argument is an aggregation */
|
||||
D_PRINT_VOID, /* print() argument has void type */
|
||||
D_PRINT_DYN, /* print() argument has dynamic type */
|
||||
D_PRINT_AGG, /* print() argument is an aggregation */
|
||||
D_TRACEMEM_ADDR, /* tracemem() address bad type */
|
||||
D_TRACEMEM_SIZE, /* tracemem() size bad type */
|
||||
D_TRACEMEM_ARGS, /* tracemem() illegal number of args */
|
||||
|
@ -468,7 +468,6 @@ enum {
|
||||
EDT_VERSREDUCED, /* requested API version has been reduced */
|
||||
EDT_CTF, /* libctf called failed (dt_ctferr has more) */
|
||||
EDT_COMPILER, /* error in D program compilation */
|
||||
EDT_NOREG, /* register allocation failure */
|
||||
EDT_NOTUPREG, /* tuple register allocation failure */
|
||||
EDT_NOMEM, /* memory allocation failure */
|
||||
EDT_INT2BIG, /* integer limit exceeded */
|
||||
|
@ -23,6 +23,7 @@
|
||||
/*
|
||||
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
|
||||
* Copyright (c) 2011, Joyent Inc. All rights reserved.
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
#pragma ident "%Z%%M% %I% %E% SMI"
|
||||
@ -96,6 +97,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/sysmacros.h>
|
||||
#include <limits.h>
|
||||
#include <setjmp.h>
|
||||
#include <strings.h>
|
||||
@ -1862,6 +1864,38 @@ dt_node_op1(int op, dt_node_t *cp)
|
||||
return (dnp);
|
||||
}
|
||||
|
||||
/*
|
||||
* If an integer constant is being cast to another integer type, we can
|
||||
* perform the cast as part of integer constant folding in this pass. We must
|
||||
* take action when the integer is being cast to a smaller type or if it is
|
||||
* changing signed-ness. If so, we first shift rp's bits bits high (losing
|
||||
* excess bits if narrowing) and then shift them down with either a logical
|
||||
* shift (unsigned) or arithmetic shift (signed).
|
||||
*/
|
||||
static void
|
||||
dt_cast(dt_node_t *lp, dt_node_t *rp)
|
||||
{
|
||||
size_t srcsize = dt_node_type_size(rp);
|
||||
size_t dstsize = dt_node_type_size(lp);
|
||||
|
||||
if (dstsize < srcsize) {
|
||||
int n = (sizeof (uint64_t) - dstsize) * NBBY;
|
||||
rp->dn_value <<= n;
|
||||
rp->dn_value >>= n;
|
||||
} else if (dstsize > srcsize) {
|
||||
int n = (sizeof (uint64_t) - srcsize) * NBBY;
|
||||
int s = (dstsize - srcsize) * NBBY;
|
||||
|
||||
rp->dn_value <<= n;
|
||||
if (rp->dn_flags & DT_NF_SIGNED) {
|
||||
rp->dn_value = (intmax_t)rp->dn_value >> s;
|
||||
rp->dn_value >>= n - s;
|
||||
} else {
|
||||
rp->dn_value >>= n;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dt_node_t *
|
||||
dt_node_op2(int op, dt_node_t *lp, dt_node_t *rp)
|
||||
{
|
||||
@ -2011,32 +2045,9 @@ dt_node_op2(int op, dt_node_t *lp, dt_node_t *rp)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* If an integer constant is being cast to another integer type, we can
|
||||
* perform the cast as part of integer constant folding in this pass.
|
||||
* We must take action when the integer is being cast to a smaller type
|
||||
* or if it is changing signed-ness. If so, we first shift rp's bits
|
||||
* bits high (losing excess bits if narrowing) and then shift them down
|
||||
* with either a logical shift (unsigned) or arithmetic shift (signed).
|
||||
*/
|
||||
if (op == DT_TOK_LPAR && rp->dn_kind == DT_NODE_INT &&
|
||||
dt_node_is_integer(lp)) {
|
||||
size_t srcsize = dt_node_type_size(rp);
|
||||
size_t dstsize = dt_node_type_size(lp);
|
||||
|
||||
if ((dstsize < srcsize) || ((lp->dn_flags & DT_NF_SIGNED) ^
|
||||
(rp->dn_flags & DT_NF_SIGNED))) {
|
||||
int n = dstsize < srcsize ?
|
||||
(sizeof (uint64_t) * NBBY - dstsize * NBBY) :
|
||||
(sizeof (uint64_t) * NBBY - srcsize * NBBY);
|
||||
|
||||
rp->dn_value <<= n;
|
||||
if (lp->dn_flags & DT_NF_SIGNED)
|
||||
rp->dn_value = (intmax_t)rp->dn_value >> n;
|
||||
else
|
||||
rp->dn_value = rp->dn_value >> n;
|
||||
}
|
||||
|
||||
dt_cast(lp, rp);
|
||||
dt_node_type_propagate(lp, rp);
|
||||
dt_node_attr_assign(rp, dt_attr_min(lp->dn_attr, rp->dn_attr));
|
||||
dt_node_free(lp);
|
||||
@ -2895,14 +2906,14 @@ dt_cook_op1(dt_node_t *dnp, uint_t idflags)
|
||||
case DT_TOK_DEREF:
|
||||
/*
|
||||
* If the deref operator is applied to a translated pointer,
|
||||
* we can just set our output type to the base translation.
|
||||
* we set our output type to the output of the translation.
|
||||
*/
|
||||
if ((idp = dt_node_resolve(cp, DT_IDENT_XLPTR)) != NULL) {
|
||||
dt_xlator_t *dxp = idp->di_data;
|
||||
|
||||
dnp->dn_ident = &dxp->dx_souid;
|
||||
dt_node_type_assign(dnp,
|
||||
DT_DYN_CTFP(dtp), DT_DYN_TYPE(dtp));
|
||||
dnp->dn_ident->di_ctfp, dnp->dn_ident->di_type);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -3078,6 +3089,31 @@ dt_cook_op1(dt_node_t *dnp, uint_t idflags)
|
||||
return (dnp);
|
||||
}
|
||||
|
||||
static void
|
||||
dt_assign_common(dt_node_t *dnp)
|
||||
{
|
||||
dt_node_t *lp = dnp->dn_left;
|
||||
dt_node_t *rp = dnp->dn_right;
|
||||
int op = dnp->dn_op;
|
||||
|
||||
if (rp->dn_kind == DT_NODE_INT)
|
||||
dt_cast(lp, rp);
|
||||
|
||||
if (!(lp->dn_flags & DT_NF_LVALUE)) {
|
||||
xyerror(D_OP_LVAL, "operator %s requires modifiable "
|
||||
"lvalue as an operand\n", opstr(op));
|
||||
/* see K&R[A7.17] */
|
||||
}
|
||||
|
||||
if (!(lp->dn_flags & DT_NF_WRITABLE)) {
|
||||
xyerror(D_OP_WRITE, "operator %s can only be applied "
|
||||
"to a writable variable\n", opstr(op));
|
||||
}
|
||||
|
||||
dt_node_type_propagate(lp, dnp); /* see K&R[A7.17] */
|
||||
dt_node_attr_assign(dnp, dt_attr_min(lp->dn_attr, rp->dn_attr));
|
||||
}
|
||||
|
||||
static dt_node_t *
|
||||
dt_cook_op2(dt_node_t *dnp, uint_t idflags)
|
||||
{
|
||||
@ -3556,19 +3592,7 @@ dt_cook_op2(dt_node_t *dnp, uint_t idflags)
|
||||
}
|
||||
}
|
||||
asgn_common:
|
||||
if (!(lp->dn_flags & DT_NF_LVALUE)) {
|
||||
xyerror(D_OP_LVAL, "operator %s requires modifiable "
|
||||
"lvalue as an operand\n", opstr(op));
|
||||
/* see K&R[A7.17] */
|
||||
}
|
||||
|
||||
if (!(lp->dn_flags & DT_NF_WRITABLE)) {
|
||||
xyerror(D_OP_WRITE, "operator %s can only be applied "
|
||||
"to a writable variable\n", opstr(op));
|
||||
}
|
||||
|
||||
dt_node_type_propagate(lp, dnp); /* see K&R[A7.17] */
|
||||
dt_node_attr_assign(dnp, dt_attr_min(lp->dn_attr, rp->dn_attr));
|
||||
dt_assign_common(dnp);
|
||||
break;
|
||||
|
||||
case DT_TOK_PTR:
|
||||
@ -3873,6 +3897,14 @@ asgn_common:
|
||||
|
||||
dt_node_type_propagate(lp, dnp); /* see K&R[A7.5] */
|
||||
dt_node_attr_assign(dnp, dt_attr_min(lp->dn_attr, rp->dn_attr));
|
||||
|
||||
/*
|
||||
* If it's a pointer then should be able to (attempt to)
|
||||
* assign to it.
|
||||
*/
|
||||
if (lkind == CTF_K_POINTER)
|
||||
dnp->dn_flags |= DT_NF_WRITABLE;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,7 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, Joyent, Inc. All rights reserved.
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
#if defined(sun)
|
||||
@ -161,7 +162,7 @@ static int
|
||||
pfcheck_dint(dt_pfargv_t *pfv, dt_pfargd_t *pfd, dt_node_t *dnp)
|
||||
{
|
||||
if (dnp->dn_flags & DT_NF_SIGNED)
|
||||
pfd->pfd_flags |= DT_PFCONV_SIGNED;
|
||||
pfd->pfd_fmt[strlen(pfd->pfd_fmt) - 1] = 'i';
|
||||
else
|
||||
pfd->pfd_fmt[strlen(pfd->pfd_fmt) - 1] = 'u';
|
||||
|
||||
@ -664,7 +665,7 @@ static const dt_pfconv_t _dtrace_conversions[] = {
|
||||
{ "hu", "u", "unsigned short", pfcheck_type, pfprint_uint },
|
||||
{ "hx", "x", "short", pfcheck_xshort, pfprint_uint },
|
||||
{ "hX", "X", "short", pfcheck_xshort, pfprint_uint },
|
||||
{ "i", "i", pfproto_xint, pfcheck_dint, pfprint_dint },
|
||||
{ "i", "i", pfproto_xint, pfcheck_xint, pfprint_sint },
|
||||
{ "I", "s", pfproto_cstr, pfcheck_str, pfprint_inetaddr },
|
||||
{ "k", "s", "stack", pfcheck_stack, pfprint_stack },
|
||||
{ "lc", "lc", "int", pfcheck_type, pfprint_sint }, /* a.k.a. wint_t */
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
/*
|
||||
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
@ -617,8 +618,8 @@ dt_printf(dtrace_hdl_t *dtp, FILE *fp, const char *format, ...)
|
||||
size_t avail;
|
||||
|
||||
/*
|
||||
* It's not legal to use buffered ouput if there is not a
|
||||
* handler for buffered output.
|
||||
* Using buffered output is not allowed if a handler has
|
||||
* not been installed.
|
||||
*/
|
||||
if (dtp->dt_bufhdlr == NULL) {
|
||||
va_end(ap);
|
||||
|
@ -24,6 +24,10 @@
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
@ -525,7 +529,8 @@ dt_instr_size(uchar_t *instr, dtrace_hdl_t *dtp, pid_t pid, uintptr_t addr,
|
||||
* another debugger attached to this process. The original instruction
|
||||
* can't be recovered so this must fail.
|
||||
*/
|
||||
if (x86dis.d86_len == 1 && instr[0] == FASTTRAP_INSTR)
|
||||
if (x86dis.d86_len == 1 &&
|
||||
(uchar_t)x86dis.d86_bytes[0] == FASTTRAP_INSTR)
|
||||
return (-1);
|
||||
|
||||
return (x86dis.d86_len);
|
||||
|
@ -1885,6 +1885,10 @@ get_numeric_property(zfs_handle_t *zhp, zfs_prop_t prop, zprop_source_t *src,
|
||||
zcmd_free_nvlists(&zc);
|
||||
break;
|
||||
|
||||
case ZFS_PROP_INCONSISTENT:
|
||||
*val = zhp->zfs_dmustats.dds_inconsistent;
|
||||
break;
|
||||
|
||||
default:
|
||||
switch (zfs_prop_get_type(prop)) {
|
||||
case PROP_TYPE_NUMBER:
|
||||
@ -3379,13 +3383,16 @@ zfs_snapshot_cb(zfs_handle_t *zhp, void *arg)
|
||||
char name[ZFS_MAXNAMELEN];
|
||||
int rv = 0;
|
||||
|
||||
(void) snprintf(name, sizeof (name),
|
||||
"%s@%s", zfs_get_name(zhp), sd->sd_snapname);
|
||||
if (zfs_prop_get_int(zhp, ZFS_PROP_INCONSISTENT) == 0) {
|
||||
(void) snprintf(name, sizeof (name),
|
||||
"%s@%s", zfs_get_name(zhp), sd->sd_snapname);
|
||||
|
||||
fnvlist_add_boolean(sd->sd_nvl, name);
|
||||
fnvlist_add_boolean(sd->sd_nvl, name);
|
||||
|
||||
rv = zfs_iter_filesystems(zhp, zfs_snapshot_cb, sd);
|
||||
rv = zfs_iter_filesystems(zhp, zfs_snapshot_cb, sd);
|
||||
}
|
||||
zfs_close(zhp);
|
||||
|
||||
return (rv);
|
||||
}
|
||||
|
||||
|
@ -1576,8 +1576,8 @@ zfs_send(zfs_handle_t *zhp, const char *fromsnap, const char *tosnap,
|
||||
if (tid != 0) {
|
||||
if (err != 0)
|
||||
(void) pthread_cancel(tid);
|
||||
(void) pthread_join(tid, NULL);
|
||||
(void) close(pipefd[0]);
|
||||
(void) pthread_join(tid, NULL);
|
||||
}
|
||||
|
||||
if (sdd.cleanup_fd != -1) {
|
||||
@ -1613,8 +1613,8 @@ err_out:
|
||||
VERIFY(0 == close(sdd.cleanup_fd));
|
||||
if (tid != 0) {
|
||||
(void) pthread_cancel(tid);
|
||||
(void) pthread_join(tid, NULL);
|
||||
(void) close(pipefd[0]);
|
||||
(void) pthread_join(tid, NULL);
|
||||
}
|
||||
return (err);
|
||||
}
|
||||
|
@ -52,6 +52,8 @@ static char *curfile;
|
||||
#define CTF_BUF_CHUNK_SIZE (64 * 1024)
|
||||
#define RES_BUF_CHUNK_SIZE (64 * 1024)
|
||||
|
||||
static int ntypes = 0; /* The number of types. */
|
||||
|
||||
struct ctf_buf {
|
||||
strtab_t ctb_strtab; /* string table */
|
||||
caddr_t ctb_base; /* pointer to base of buffer */
|
||||
@ -1143,6 +1145,10 @@ resurrect_types(ctf_header_t *h, tdata_t *td, tdesc_t **tdarr, int tdsize,
|
||||
(*mpp)->ml_type = tdarr[ctm->ctm_type];
|
||||
(*mpp)->ml_offset = ctm->ctm_offset;
|
||||
(*mpp)->ml_size = 0;
|
||||
if (ctm->ctm_type > ntypes) {
|
||||
parseterminate("Invalid member type ctm_type=%d",
|
||||
ctm->ctm_type);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (i = 0, mpp = &tdp->t_members; i < vlen;
|
||||
@ -1159,6 +1165,10 @@ resurrect_types(ctf_header_t *h, tdata_t *td, tdesc_t **tdarr, int tdsize,
|
||||
(*mpp)->ml_offset =
|
||||
(int)CTF_LMEM_OFFSET(ctlm);
|
||||
(*mpp)->ml_size = 0;
|
||||
if (ctlm->ctlm_type > ntypes) {
|
||||
parseterminate("Invalid lmember type ctlm_type=%d",
|
||||
ctlm->ctlm_type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1272,9 +1282,10 @@ ctf_parse(ctf_header_t *h, caddr_t buf, symit_data_t *si, char *label)
|
||||
{
|
||||
tdata_t *td = tdata_new();
|
||||
tdesc_t **tdarr;
|
||||
int ntypes = count_types(h, buf);
|
||||
int idx, i;
|
||||
|
||||
ntypes = count_types(h, buf);
|
||||
|
||||
/* shudder */
|
||||
tdarr = xcalloc(sizeof (tdesc_t *) * (ntypes + 1));
|
||||
tdarr[0] = NULL;
|
||||
|
@ -159,7 +159,7 @@ typedef struct ardef {
|
||||
/* Auxiliary structure for structure/union tdesc_t */
|
||||
typedef struct mlist {
|
||||
int ml_offset; /* Offset from start of structure (in bits) */
|
||||
int ml_size; /* Member size (in bits) */
|
||||
uint_t ml_size; /* Member size (in bits) */
|
||||
char *ml_name; /* Member name */
|
||||
struct tdesc *ml_type; /* Member type */
|
||||
struct mlist *ml_next; /* Next member */
|
||||
|
@ -674,6 +674,13 @@ die_array_create(dwarf_t *dw, Dwarf_Die arr, Dwarf_Off off, tdesc_t *tdp)
|
||||
tdesc_t *dimtdp;
|
||||
int flags;
|
||||
|
||||
/* Check for bogus gcc DW_AT_byte_size attribute */
|
||||
if (uval == (unsigned)-1) {
|
||||
printf("dwarf.c:%s() working around bogus -1 DW_AT_byte_size\n",
|
||||
__func__);
|
||||
uval = 0;
|
||||
}
|
||||
|
||||
tdp->t_size = uval;
|
||||
|
||||
/*
|
||||
@ -760,6 +767,12 @@ die_enum_create(dwarf_t *dw, Dwarf_Die die, Dwarf_Off off, tdesc_t *tdp)
|
||||
tdp->t_type = ENUM;
|
||||
|
||||
(void) die_unsigned(dw, die, DW_AT_byte_size, &uval, DW_ATTR_REQ);
|
||||
/* Check for bogus gcc DW_AT_byte_size attribute */
|
||||
if (uval == (unsigned)-1) {
|
||||
printf("dwarf.c:%s() working around bogus -1 DW_AT_byte_size\n",
|
||||
__func__);
|
||||
uval = 0;
|
||||
}
|
||||
tdp->t_size = uval;
|
||||
|
||||
if ((mem = die_child(dw, die)) != NULL) {
|
||||
@ -873,7 +886,7 @@ static void
|
||||
die_sou_create(dwarf_t *dw, Dwarf_Die str, Dwarf_Off off, tdesc_t *tdp,
|
||||
int type, const char *typename)
|
||||
{
|
||||
Dwarf_Unsigned sz, bitsz, bitoff;
|
||||
Dwarf_Unsigned sz, bitsz, bitoff, maxsz=0;
|
||||
Dwarf_Die mem;
|
||||
mlist_t *ml, **mlastp;
|
||||
iidesc_t *ii;
|
||||
@ -929,6 +942,8 @@ die_sou_create(dwarf_t *dw, Dwarf_Die str, Dwarf_Off off, tdesc_t *tdp,
|
||||
ml->ml_name = NULL;
|
||||
|
||||
ml->ml_type = die_lookup_pass1(dw, mem, DW_AT_type);
|
||||
debug(3, "die_sou_create(): ml_type = %p t_id = %d\n",
|
||||
ml->ml_type, ml->ml_type->t_id);
|
||||
|
||||
if (die_mem_offset(dw, mem, DW_AT_data_member_location,
|
||||
&mloff, 0)) {
|
||||
@ -956,8 +971,24 @@ die_sou_create(dwarf_t *dw, Dwarf_Die str, Dwarf_Off off, tdesc_t *tdp,
|
||||
|
||||
*mlastp = ml;
|
||||
mlastp = &ml->ml_next;
|
||||
|
||||
/* Find the size of the largest member to work around a gcc
|
||||
* bug. See GCC Bugzilla 35998.
|
||||
*/
|
||||
if (maxsz < ml->ml_size)
|
||||
maxsz = ml->ml_size;
|
||||
|
||||
} while ((mem = die_sibling(dw, mem)) != NULL);
|
||||
|
||||
/* See if we got a bogus DW_AT_byte_size. GCC will sometimes
|
||||
* emit this.
|
||||
*/
|
||||
if (sz == (unsigned)-1) {
|
||||
printf("dwarf.c:%s() working around bogus -1 DW_AT_byte_size\n",
|
||||
__func__);
|
||||
tdp->t_size = maxsz / 8; /* maxsz is in bits, t_size is bytes */
|
||||
}
|
||||
|
||||
/*
|
||||
* GCC will attempt to eliminate unused types, thus decreasing the
|
||||
* size of the emitted dwarf. That is, if you declare a foo_t in your
|
||||
@ -1054,7 +1085,7 @@ die_sou_resolve(tdesc_t *tdp, tdesc_t **tdpp __unused, void *private)
|
||||
}
|
||||
|
||||
if (ml->ml_size != 0 && mt->t_type == INTRINSIC &&
|
||||
mt->t_intr->intr_nbits != ml->ml_size) {
|
||||
mt->t_intr->intr_nbits != (int)ml->ml_size) {
|
||||
/*
|
||||
* This member is a bitfield, and needs to reference
|
||||
* an intrinsic type with the same width. If the
|
||||
@ -1370,6 +1401,13 @@ die_base_create(dwarf_t *dw, Dwarf_Die base, Dwarf_Off off, tdesc_t *tdp)
|
||||
*/
|
||||
(void) die_unsigned(dw, base, DW_AT_byte_size, &sz, DW_ATTR_REQ);
|
||||
|
||||
/* Check for bogus gcc DW_AT_byte_size attribute */
|
||||
if (sz == (unsigned)-1) {
|
||||
printf("dwarf.c:%s() working around bogus -1 DW_AT_byte_size\n",
|
||||
__func__);
|
||||
sz = 0;
|
||||
}
|
||||
|
||||
if (tdp->t_name == NULL)
|
||||
terminate("die %llu: base type without name\n", off);
|
||||
|
||||
|
@ -952,7 +952,7 @@ soudef(char *cp, stabtype_t type, tdesc_t **rtdp)
|
||||
|
||||
itdp = find_intrinsic(tdp);
|
||||
if (itdp->t_type == INTRINSIC) {
|
||||
if (mlp->ml_size != itdp->t_intr->intr_nbits) {
|
||||
if ((int)mlp->ml_size != itdp->t_intr->intr_nbits) {
|
||||
parse_debug(4, cp, "making %d bit intrinsic "
|
||||
"from %s", mlp->ml_size, tdesc_name(itdp));
|
||||
mlp->ml_type = bitintrinsic(itdp, mlp->ml_size);
|
||||
@ -1173,7 +1173,7 @@ resolve_typed_bitfields_cb(void *arg, void *private __unused)
|
||||
while (tdp) {
|
||||
switch (tdp->t_type) {
|
||||
case INTRINSIC:
|
||||
if (ml->ml_size != tdp->t_intr->intr_nbits) {
|
||||
if ((int)ml->ml_size != tdp->t_intr->intr_nbits) {
|
||||
debug(3, "making %d bit intrinsic from %s",
|
||||
ml->ml_size, tdesc_name(tdp));
|
||||
ml->ml_type = bitintrinsic(tdp, ml->ml_size);
|
||||
|
@ -1,45 +1,100 @@
|
||||
-*- coding: utf-8 -*-
|
||||
Changes with APR-Util 1.4.1
|
||||
Changes with APR-util 1.5.2
|
||||
|
||||
*) Apply Windows build fixes for the apr_crypto API. [Mladen Turk]
|
||||
*) Windows: Add command line makefiles. [Gregg Smith]
|
||||
|
||||
Changes with APR-util 1.4.0
|
||||
*) apr_uri_parse(): Do not accept invalid characters in the scheme.
|
||||
Per RFC 3986 3.3, enforce that the first segment of a relative path does
|
||||
not contain a colon. PR 52479. [Stefan Fritsch]
|
||||
|
||||
*) apr_ldap_init: Pass secure=1 to ldapssl_init() with Solaris LDAP SDK.
|
||||
PR: 42682 [Stefan Fritsch]
|
||||
*) Fix memory leak in hook sorting function. PR 51256.
|
||||
[<horowity checkpoint com>]
|
||||
|
||||
*) apr_memcache_server_create: Fix possible segfault. PR 51064.
|
||||
[Michajlo Matijkiw <michajlo_matijkiw comcast com>]
|
||||
*) Speedup md5 calculation by avoiding some copying on little endian
|
||||
architectures. PR 49011. [Stefan Fritsch, Stefan Fuhrmann
|
||||
<stefanfuhrmann alice-dsl de>]
|
||||
|
||||
*) apr_thread_pool: Fix thread unsafe pool usage. [Stefan Fritsch]
|
||||
*) Use heap memory for crypt in apr_password_validate(), to reduce stack
|
||||
usage. PR 54572. [Stefan Fritsch]
|
||||
|
||||
*) Do not include apr.h and apr_errno.h from system search path in
|
||||
apu_errno.h. PR 46487 [Rainer Jung]
|
||||
*) Fix password validation failure for all crypt and crypt_r based
|
||||
algorithms. PR 54603. [Harvey Eneman <harvey.eneman oracle.com>]
|
||||
|
||||
*) Add optional dbm, openssl and nss subpackages to the RPM spec file.
|
||||
[Graham Leggett]
|
||||
*) Fix syntax error in crypto/apr_passwd.c on non-glibc systems. PR 54275.
|
||||
[Stefan Fritsch]
|
||||
|
||||
*) apr_dbd_freetds: The sybdb.h header file might be freetds/sybdb.h
|
||||
or sybdb.h. [Graham Leggett]
|
||||
*) Fix potential data corruption in apr_brigade_write() and friends if
|
||||
the last bucket of the brigade is a heap bucket that has been split,
|
||||
and there are still references to the next part of the original bucket
|
||||
in use. [Stefan Fritsch]
|
||||
|
||||
*) Add apr_crypto implementations for OpenSSL and Mozilla NSS. Add a unit
|
||||
test to verify the interoperability of the two modules. Builds default
|
||||
to disabled unless explicitly enabled.
|
||||
[Graham Leggett]
|
||||
*) Remove duplicated logic in apr_brigade_puts(). PR 53740. [Christophe
|
||||
Jaillet <christophe jaillet wanadoo fr>]
|
||||
|
||||
*) Add the apr_crypto interface, a rewrite of the earlier apr_ssl code,
|
||||
based on the modular dso interface used for dbd and ldap. Initially,
|
||||
the interface supports symmetrical encryption and decryption. The
|
||||
purpose of the interface is to offer portable and interoperable
|
||||
access to basic crypto using the native crypto libraries present on
|
||||
each platform. [Graham Leggett]
|
||||
*) apr_crypto: If --with-crypto is passed to configure but no crypto
|
||||
libraries are enabled, autodetect available libraries. [Jeff Trawick]
|
||||
|
||||
*) Add trace probes to hooks, making it easier to inspect APR Hook based
|
||||
applications with DTrace or other such mechanisms.
|
||||
[Theo Schlossnagle <jesus omniti.com>, generalized by Jeff Trawick]
|
||||
*) memcache: Fix dead server retry logic. [Gavin Shelley <columbusmonkey me.com>]
|
||||
|
||||
*) Implement resource list when threads are unavailable. PR 24325
|
||||
[Bojan Smojver]
|
||||
Changes with APR-util 1.5.1
|
||||
|
||||
*) testmemcache: Fix crash. PR 52705. [Peter Poeml <peter poeml de>]
|
||||
|
||||
*) MinGW: Support shared builds of apr-util when apr is shared.
|
||||
PR 46175. [Carlo Bramini <carlo.bramix libero.it>, Jeff Trawick]
|
||||
|
||||
*) Add support for Berkeley DB 5.2 and 5.3. Simplify detection script.
|
||||
PR 53684. [Rainer Jung]
|
||||
|
||||
*) configure: Allow to specify library specific custom linker flags
|
||||
via the LDADD_XXX variables. [Rainer Jung]
|
||||
|
||||
*) apr_password_validate(): Fix intermittent errors on systems
|
||||
such as FreeBSD where the crypt() function is used.
|
||||
(Broken only in 1.5.0) [Jeff Trawick]
|
||||
|
||||
*) Improve platform detection for bundled expat by updating
|
||||
config.guess and config.sub. [Rainer Jung]
|
||||
|
||||
Changes with APR-util 1.5.0
|
||||
|
||||
*) dbd_pgsql_escape: Use PQescapeStringConn. [Nick Kew]
|
||||
|
||||
*) apr_password_validate, apr_bcrypt_encode: Add support for bcrypt encoded
|
||||
passwords. The bcrypt implementation uses code from crypt_blowfish
|
||||
written by Solar Designer <solar openwall com>. apr_bcrypt_encode creates
|
||||
hashes with "$2y$" prefix, but apr_password_validate also accepts the old
|
||||
prefix "$2a$". PR 49288. [Stefan Fritsch]
|
||||
|
||||
*) APR dbd: Allow to use apr_dbd_get_row() with a different pool than
|
||||
apr_dbd_select(). PR 53533. [<arthur echo gmail com>]
|
||||
|
||||
*) APR dbd FreeTDS support: Fix spurious API errors caused by uninitialized
|
||||
fields. [TROY.LIU 劉春偉 <TROY.LIU deltaww.com.cn>]
|
||||
|
||||
*) apr_password_validate: Increase maximum hash string length to allow
|
||||
more than 9999 rounds with sha512-crypt. PR 53410. [Stefan Fritsch]
|
||||
|
||||
*) Fix segfaults in crypt() and crypt_r() failure modes.
|
||||
PR 47272. [Arkadiusz Miskiewicz <arekm pld-linux.org>]
|
||||
|
||||
*) apr_crypto: Ensure that the if/else that governs the static
|
||||
initialisation of each crypto driver works when the first driver
|
||||
isn't in use. [Graham Leggett]
|
||||
|
||||
*) apr_crypto: Ensure the *driver variable is initialised when a statically
|
||||
compiled library is initialised for the first time. [Graham Leggett]
|
||||
|
||||
*) apr_crypto: Ensure the *driver variable is initialised when the library
|
||||
has already been loaded. Fix ported from apr_dbd. [Graham Leggett]
|
||||
|
||||
*) apr_crypto: Move the static initialisation of DRIVER_LOAD from
|
||||
apr_crypto_init() to apr_crypto_get_driver(), so that we don't lose
|
||||
the parameters. [Graham Leggett]
|
||||
|
||||
Changes with APR-util 1.4.x and later:
|
||||
|
||||
*) http://svn.apache.org/viewvc/apr/apr-util/branches/1.4.x/CHANGES?view=markup
|
||||
|
||||
Changes for APR-util 1.3.x and later:
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
# install - compile everything
|
||||
# clean - mop up everything
|
||||
#
|
||||
# You can override the build mechansim, choose only one;
|
||||
# You can override the build mechanism, choose only one;
|
||||
#
|
||||
# USEMAK=1 - compile from exported make files
|
||||
# USEDSW=1 - compile from .dsw / .dsp VC6 projects
|
||||
|
@ -259,6 +259,7 @@ FILES_lib_objs = \
|
||||
$(OBJDIR)/apr_md4.o \
|
||||
$(OBJDIR)/apr_md5.o \
|
||||
$(OBJDIR)/apr_memcache.o \
|
||||
$(OBJDIR)/apr_passwd.o \
|
||||
$(OBJDIR)/apr_queue.o \
|
||||
$(OBJDIR)/apr_reslist.o \
|
||||
$(OBJDIR)/apr_rmm.o \
|
||||
@ -269,6 +270,7 @@ FILES_lib_objs = \
|
||||
$(OBJDIR)/apr_strmatch.o \
|
||||
$(OBJDIR)/apr_thread_pool.o \
|
||||
$(OBJDIR)/apr_uri.o \
|
||||
$(OBJDIR)/crypt_blowfish.o \
|
||||
$(OBJDIR)/sdbm.o \
|
||||
$(OBJDIR)/sdbm_hash.o \
|
||||
$(OBJDIR)/sdbm_lock.o \
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
Summary: Apache Portable Runtime Utility library
|
||||
Name: apr-util
|
||||
Version: 1.4.1
|
||||
Version: 1.5.2
|
||||
Release: 1
|
||||
License: Apache Software License
|
||||
Group: System Environment/Libraries
|
||||
|
@ -1,794 +0,0 @@
|
||||
# Microsoft Developer Studio Project File - Name="aprutil" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Static Library" 0x0104
|
||||
|
||||
CFG=aprutil - Win32 Release
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "aprutil.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "aprutil.mak" CFG="aprutil - Win32 Release"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "aprutil - Win32 Release" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "aprutil - Win32 Debug" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "aprutil - x64 Release" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "aprutil - x64 Debug" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "aprutil - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "LibR"
|
||||
# PROP BASE Intermediate_Dir "LibR"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "LibR"
|
||||
# PROP Intermediate_Dir "LibR"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /O2 /Oy- /Zi /I "./include" /I "../apr/include" /I "./include/private" /I "../apr-iconv/include" /I "./dbm/sdbm" /I "./xml/expat/lib" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "APU_DECLARE_STATIC" /D "API_DECLARE_STATIC" /D "APU_USE_SDBM" /D "HAVE_SQL_H" /D "XML_STATIC" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\aprutil-1" /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo /out:"LibR\aprutil-1.lib"
|
||||
|
||||
!ELSEIF "$(CFG)" == "aprutil - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "LibD"
|
||||
# PROP BASE Intermediate_Dir "LibD"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "LibD"
|
||||
# PROP Intermediate_Dir "LibD"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MDd /W3 /EHsc /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c
|
||||
# ADD CPP /nologo /MDd /W3 /EHsc /Zi /Od /I "./include" /I "../apr/include" /I "./include/private" /I "../apr-iconv/include" /I "./dbm/sdbm" /I "./xml/expat/lib" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "APU_DECLARE_STATIC" /D "API_DECLARE_STATIC" /D "APU_USE_SDBM" /D "HAVE_SQL_H" /D "XML_STATIC" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\aprutil-1" /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo /out:"LibD\aprutil-1.lib"
|
||||
|
||||
!ELSEIF "$(CFG)" == "aprutil - x64 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "x64\LibR"
|
||||
# PROP BASE Intermediate_Dir "x64\LibR"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "x64\LibR"
|
||||
# PROP Intermediate_Dir "x64\LibR"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "./include" /I "../apr/include" /I "./include/private" /I "../apr-iconv/include" /I "./dbm/sdbm" /I "./xml/expat/lib" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "APU_DECLARE_STATIC" /D "API_DECLARE_STATIC" /D "APU_USE_SDBM" /D "HAVE_SQL_H" /D "XML_STATIC" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\aprutil-1" /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo /out:"x64\LibR\aprutil-1.lib"
|
||||
|
||||
!ELSEIF "$(CFG)" == "aprutil - x64 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "x64\LibD"
|
||||
# PROP BASE Intermediate_Dir "x64\LibD"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "x64\LibD"
|
||||
# PROP Intermediate_Dir "x64\LibD"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c
|
||||
# ADD CPP /nologo /MDd /W3 /Zi /Od /I "./include" /I "../apr/include" /I "./include/private" /I "../apr-iconv/include" /I "./dbm/sdbm" /I "./xml/expat/lib" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "APU_DECLARE_STATIC" /D "API_DECLARE_STATIC" /D "APU_USE_SDBM" /D "HAVE_SQL_H" /D "XML_STATIC" /D "WIN32" /D "_WINDOWS" /Fo"$(INTDIR)\" /Fd"$(OUTDIR)\aprutil-1" /FD /EHsc /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo /out:"x64\LibD\aprutil-1.lib"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "aprutil - Win32 Release"
|
||||
# Name "aprutil - Win32 Debug"
|
||||
# Name "aprutil - x64 Release"
|
||||
# Name "aprutil - x64 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Group "buckets"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\buckets\apr_brigade.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\buckets\apr_buckets.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\buckets\apr_buckets_alloc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\buckets\apr_buckets_eos.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\buckets\apr_buckets_file.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\buckets\apr_buckets_flush.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\buckets\apr_buckets_heap.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\buckets\apr_buckets_mmap.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\buckets\apr_buckets_pipe.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\buckets\apr_buckets_pool.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\buckets\apr_buckets_refcount.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\buckets\apr_buckets_simple.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\buckets\apr_buckets_socket.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "crypto"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\crypto\apr_crypto.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\crypto\apr_md4.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\crypto\apr_md5.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\crypto\apr_sha1.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\crypto\getuuid.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\crypto\uuid.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "dbd"
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dbd\apr_dbd.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dbd\apr_dbd_freetds.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dbd\apr_dbd_mysql.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dbd\apr_dbd_odbc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dbd\apr_dbd_oracle.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dbd\apr_dbd_pgsql.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dbd\apr_dbd_sqlite2.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dbd\apr_dbd_sqlite3.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "dbm"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dbm\apr_dbm.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dbm\apr_dbm_berkeleydb.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dbm\apr_dbm_gdbm.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dbm\apr_dbm_sdbm.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "encoding"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\encoding\apr_base64.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "hooks"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\hooks\apr_hooks.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "ldap"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ldap\apr_ldap_init.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ldap\apr_ldap_option.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ldap\apr_ldap_rebind.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ldap\apr_ldap_stub.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ldap\apr_ldap_url.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "memcache"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\memcache\apr_memcache.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "misc"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\misc\apr_date.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\misc\apu_dso.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\misc\apr_queue.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\misc\apr_reslist.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\misc\apr_rmm.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\misc\apr_thread_pool.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\misc\apu_version.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "sdbm"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dbm\sdbm\sdbm.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dbm\sdbm\sdbm_hash.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dbm\sdbm\sdbm_lock.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dbm\sdbm\sdbm_pair.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dbm\sdbm\sdbm_pair.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dbm\sdbm\sdbm_private.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dbm\sdbm\sdbm_tune.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "strmatch"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\strmatch\apr_strmatch.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "uri"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\uri\apr_uri.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "xlate"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\xlate\xlate.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "xml"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\xml\apr_xml.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Group
|
||||
# Begin Group "Generated Files"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\include\apr_ldap.h.in
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\include\apr_ldap.hnw
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\include\apr_ldap.hw
|
||||
|
||||
!IF "$(CFG)" == "aprutil - Win32 Release"
|
||||
|
||||
# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw
|
||||
InputPath=.\include\apr_ldap.hw
|
||||
|
||||
".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
type .\include\apr_ldap.hw > .\include\apr_ldap.h
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "aprutil - Win32 Debug"
|
||||
|
||||
# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw
|
||||
InputPath=.\include\apr_ldap.hw
|
||||
|
||||
".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
type .\include\apr_ldap.hw > .\include\apr_ldap.h
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "aprutil - x64 Release"
|
||||
|
||||
# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw
|
||||
InputPath=.\include\apr_ldap.hw
|
||||
|
||||
".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
type .\include\apr_ldap.hw > .\include\apr_ldap.h
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "aprutil - x64 Debug"
|
||||
|
||||
# Begin Custom Build - Creating apr_ldap.h from apr_ldap.hw
|
||||
InputPath=.\include\apr_ldap.hw
|
||||
|
||||
".\include\apr_ldap.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
type .\include\apr_ldap.hw > .\include\apr_ldap.h
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\include\apu.h.in
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\include\apu.hnw
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\include\apu.hw
|
||||
|
||||
!IF "$(CFG)" == "aprutil - Win32 Release"
|
||||
|
||||
# Begin Custom Build - Creating apu.h from apu.hw
|
||||
InputPath=.\include\apu.hw
|
||||
|
||||
".\include\apu.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
type .\include\apu.hw > .\include\apu.h
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "aprutil - Win32 Debug"
|
||||
|
||||
# Begin Custom Build - Creating apu.h from apu.hw
|
||||
InputPath=.\include\apu.hw
|
||||
|
||||
".\include\apu.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
type .\include\apu.hw > .\include\apu.h
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "aprutil - x64 Release"
|
||||
|
||||
# Begin Custom Build - Creating apu.h from apu.hw
|
||||
InputPath=.\include\apu.hw
|
||||
|
||||
".\include\apu.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
type .\include\apu.hw > .\include\apu.h
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "aprutil - x64 Debug"
|
||||
|
||||
# Begin Custom Build - Creating apu.h from apu.hw
|
||||
InputPath=.\include\apu.hw
|
||||
|
||||
".\include\apu.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
type .\include\apu.hw > .\include\apu.h
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\include\private\apu_config.h.in
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\include\private\apu_config.hw
|
||||
|
||||
!IF "$(CFG)" == "aprutil - Win32 Release"
|
||||
|
||||
# Begin Custom Build - Creating apu_config.h from apu_config.hw
|
||||
InputPath=.\include\private\apu_config.hw
|
||||
|
||||
".\include\private\apu_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
type .\include\private\apu_config.hw > .\include\private\apu_config.h
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "aprutil - Win32 Debug"
|
||||
|
||||
# Begin Custom Build - Creating apu_config.h from apu_config.hw
|
||||
InputPath=.\include\private\apu_config.hw
|
||||
|
||||
".\include\private\apu_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
type .\include\private\apu_config.hw > .\include\private\apu_config.h
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "aprutil - x64 Release"
|
||||
|
||||
# Begin Custom Build - Creating apu_config.h from apu_config.hw
|
||||
InputPath=.\include\private\apu_config.hw
|
||||
|
||||
".\include\private\apu_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
type .\include\private\apu_config.hw > .\include\private\apu_config.h
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "aprutil - x64 Debug"
|
||||
|
||||
# Begin Custom Build - Creating apu_config.h from apu_config.hw
|
||||
InputPath=.\include\private\apu_config.hw
|
||||
|
||||
".\include\private\apu_config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
type .\include\private\apu_config.hw > .\include\private\apu_config.h
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\include\private\apu_select_dbm.h.in
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\include\private\apu_select_dbm.hw
|
||||
|
||||
!IF "$(CFG)" == "aprutil - Win32 Release"
|
||||
|
||||
# Begin Custom Build - Creating apu_select_dbm.h from apu_select_dbm.hw
|
||||
InputPath=.\include\private\apu_select_dbm.hw
|
||||
|
||||
".\include\private\apu_select_dbm.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
type .\include\private\apu_select_dbm.hw > .\include\private\apu_select_dbm.h
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "aprutil - Win32 Debug"
|
||||
|
||||
# Begin Custom Build - Creating apu_select_dbm.h from apu_select_dbm.hw
|
||||
InputPath=.\include\private\apu_select_dbm.hw
|
||||
|
||||
".\include\private\apu_select_dbm.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
type .\include\private\apu_select_dbm.hw > .\include\private\apu_select_dbm.h
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "aprutil - x64 Release"
|
||||
|
||||
# Begin Custom Build - Creating apu_select_dbm.h from apu_select_dbm.hw
|
||||
InputPath=.\include\private\apu_select_dbm.hw
|
||||
|
||||
".\include\private\apu_select_dbm.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
type .\include\private\apu_select_dbm.hw > .\include\private\apu_select_dbm.h
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "aprutil - x64 Debug"
|
||||
|
||||
# Begin Custom Build - Creating apu_select_dbm.h from apu_select_dbm.hw
|
||||
InputPath=.\include\private\apu_select_dbm.hw
|
||||
|
||||
".\include\private\apu_select_dbm.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
type .\include\private\apu_select_dbm.hw > .\include\private\apu_select_dbm.h
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\include\apu_want.h.in
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\include\apu_want.hnw
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\include\apu_want.hw
|
||||
|
||||
!IF "$(CFG)" == "aprutil - Win32 Release"
|
||||
|
||||
# Begin Custom Build - Creating apu_want.h from apu_want.hw
|
||||
InputPath=.\include\apu_want.hw
|
||||
|
||||
".\include\apu_want.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
type .\include\apu_want.hw > .\include\apu_want.h
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "aprutil - Win32 Debug"
|
||||
|
||||
# Begin Custom Build - Creating apu_want.h from apu_want.hw
|
||||
InputPath=.\include\apu_want.hw
|
||||
|
||||
".\include\apu_want.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
type .\include\apu_want.hw > .\include\apu_want.h
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "aprutil - x64 Release"
|
||||
|
||||
# Begin Custom Build - Creating apu_want.h from apu_want.hw
|
||||
InputPath=.\include\apu_want.hw
|
||||
|
||||
".\include\apu_want.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
type .\include\apu_want.hw > .\include\apu_want.h
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "aprutil - x64 Debug"
|
||||
|
||||
# Begin Custom Build - Creating apu_want.h from apu_want.hw
|
||||
InputPath=.\include\apu_want.hw
|
||||
|
||||
".\include\apu_want.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
type .\include\apu_want.hw > .\include\apu_want.h
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Public Header Files"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\include\apr_anylock.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\include\apr_base64.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\include\apr_buckets.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\include\apr_date.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\include\apr_dbm.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\include\apr_hooks.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\include\apr_ldap_url.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\include\apr_md4.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\include\apr_md5.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\include\apr_memcache.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\include\apr_optional.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\include\apr_optional_hooks.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\include\apr_queue.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\include\apr_reslist.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\include\apr_rmm.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\include\apr_sdbm.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\include\apr_sha1.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\include\apr_strmatch.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\include\apr_thread_pool.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\include\apr_uri.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\include\apr_uuid.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\include\apr_xlate.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\include\apr_xml.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\include\apu_version.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
@ -391,17 +391,30 @@ APU_DECLARE(apr_status_t) apr_brigade_vputstrs(apr_bucket_brigade *b,
|
||||
void *ctx,
|
||||
va_list va)
|
||||
{
|
||||
#define MAX_VECS 8
|
||||
struct iovec vec[MAX_VECS];
|
||||
apr_size_t i = 0;
|
||||
|
||||
for (;;) {
|
||||
const char *str = va_arg(va, const char *);
|
||||
char *str = va_arg(va, char *);
|
||||
apr_status_t rv;
|
||||
|
||||
if (str == NULL)
|
||||
break;
|
||||
|
||||
rv = apr_brigade_write(b, flush, ctx, str, strlen(str));
|
||||
if (rv != APR_SUCCESS)
|
||||
return rv;
|
||||
vec[i].iov_base = str;
|
||||
vec[i].iov_len = strlen(str);
|
||||
i++;
|
||||
|
||||
if (i == MAX_VECS) {
|
||||
rv = apr_brigade_writev(b, flush, ctx, vec, i);
|
||||
if (rv != APR_SUCCESS)
|
||||
return rv;
|
||||
i = 0;
|
||||
}
|
||||
}
|
||||
if (i != 0)
|
||||
return apr_brigade_writev(b, flush, ctx, vec, i);
|
||||
|
||||
return APR_SUCCESS;
|
||||
}
|
||||
@ -422,7 +435,12 @@ APU_DECLARE(apr_status_t) apr_brigade_write(apr_bucket_brigade *b,
|
||||
apr_size_t remaining = APR_BUCKET_BUFF_SIZE;
|
||||
char *buf = NULL;
|
||||
|
||||
if (!APR_BRIGADE_EMPTY(b) && APR_BUCKET_IS_HEAP(e)) {
|
||||
/*
|
||||
* If the last bucket is a heap bucket and its buffer is not shared with
|
||||
* another bucket, we may write into that bucket.
|
||||
*/
|
||||
if (!APR_BRIGADE_EMPTY(b) && APR_BUCKET_IS_HEAP(e)
|
||||
&& ((apr_bucket_heap *)(e->data))->refcount.refcount == 1) {
|
||||
apr_bucket_heap *h = e->data;
|
||||
|
||||
/* HEAP bucket start offsets are always in-memory, safe to cast */
|
||||
@ -512,10 +530,11 @@ APU_DECLARE(apr_status_t) apr_brigade_writev(apr_bucket_brigade *b,
|
||||
i = 0;
|
||||
|
||||
/* If there is a heap bucket at the end of the brigade
|
||||
* already, copy into the existing bucket.
|
||||
* already, and its refcount is 1, copy into the existing bucket.
|
||||
*/
|
||||
e = APR_BRIGADE_LAST(b);
|
||||
if (!APR_BRIGADE_EMPTY(b) && APR_BUCKET_IS_HEAP(e)) {
|
||||
if (!APR_BRIGADE_EMPTY(b) && APR_BUCKET_IS_HEAP(e)
|
||||
&& ((apr_bucket_heap *)(e->data))->refcount.refcount == 1) {
|
||||
apr_bucket_heap *h = e->data;
|
||||
apr_size_t remaining = h->alloc_len -
|
||||
(e->length + (apr_size_t)e->start);
|
||||
@ -591,29 +610,7 @@ APU_DECLARE(apr_status_t) apr_brigade_puts(apr_bucket_brigade *bb,
|
||||
apr_brigade_flush flush, void *ctx,
|
||||
const char *str)
|
||||
{
|
||||
apr_size_t len = strlen(str);
|
||||
apr_bucket *bkt = APR_BRIGADE_LAST(bb);
|
||||
if (!APR_BRIGADE_EMPTY(bb) && APR_BUCKET_IS_HEAP(bkt)) {
|
||||
/* If there is enough space available in a heap bucket
|
||||
* at the end of the brigade, copy the string directly
|
||||
* into the heap bucket
|
||||
*/
|
||||
apr_bucket_heap *h = bkt->data;
|
||||
apr_size_t bytes_avail = h->alloc_len - bkt->length;
|
||||
|
||||
if (bytes_avail >= len) {
|
||||
char *buf = h->base + bkt->start + bkt->length;
|
||||
memcpy(buf, str, len);
|
||||
bkt->length += len;
|
||||
return APR_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
/* If the string could not be copied into an existing heap
|
||||
* bucket, delegate the work to apr_brigade_write(), which
|
||||
* knows how to grow the brigade
|
||||
*/
|
||||
return apr_brigade_write(bb, flush, ctx, str, len);
|
||||
return apr_brigade_write(bb, flush, ctx, str, strlen(str));
|
||||
}
|
||||
|
||||
APU_DECLARE_NONSTD(apr_status_t) apr_brigade_putstrs(apr_bucket_brigade *b,
|
||||
|
@ -65,12 +65,20 @@ APU_DECLARE_NONSTD(apr_bucket_alloc_t *) apr_bucket_alloc_create(apr_pool_t *p)
|
||||
/* may be NULL for debug mode. */
|
||||
if (allocator == NULL) {
|
||||
if (apr_allocator_create(&allocator) != APR_SUCCESS) {
|
||||
apr_abortfunc_t fn = apr_pool_abort_get(p);
|
||||
if (fn)
|
||||
(fn)(APR_ENOMEM);
|
||||
abort();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
list = apr_bucket_alloc_create_ex(allocator);
|
||||
if (list == NULL) {
|
||||
apr_abortfunc_t fn = apr_pool_abort_get(p);
|
||||
if (fn)
|
||||
(fn)(APR_ENOMEM);
|
||||
abort();
|
||||
}
|
||||
list->pool = p;
|
||||
apr_pool_cleanup_register(list->pool, list, alloc_cleanup,
|
||||
apr_pool_cleanup_null);
|
||||
@ -131,6 +139,7 @@ APU_DECLARE_NONSTD(void *) apr_bucket_alloc(apr_size_t size,
|
||||
if (endp >= active->endp) {
|
||||
list->blocks = apr_allocator_alloc(list->allocator, ALLOC_AMT);
|
||||
if (!list->blocks) {
|
||||
list->blocks = active;
|
||||
return NULL;
|
||||
}
|
||||
list->blocks->next = active;
|
||||
|
@ -15,8 +15,10 @@ buckets/apr_buckets_simple.lo: buckets/apr_buckets_simple.c .make.dirs include/a
|
||||
buckets/apr_buckets_socket.lo: buckets/apr_buckets_socket.c .make.dirs include/apr_buckets.h
|
||||
crypto/apr_crypto.lo: crypto/apr_crypto.c .make.dirs include/apr_crypto.h include/apu_errno.h include/apu_version.h include/private/apr_crypto_internal.h include/private/apu_internal.h
|
||||
crypto/apr_md4.lo: crypto/apr_md4.c .make.dirs include/apr_md4.h include/apr_xlate.h
|
||||
crypto/apr_md5.lo: crypto/apr_md5.c .make.dirs include/apr_md5.h include/apr_sha1.h include/apr_xlate.h
|
||||
crypto/apr_md5.lo: crypto/apr_md5.c .make.dirs include/apr_md5.h include/apr_xlate.h
|
||||
crypto/apr_passwd.lo: crypto/apr_passwd.c .make.dirs include/apr_md5.h include/apr_sha1.h include/apr_xlate.h
|
||||
crypto/apr_sha1.lo: crypto/apr_sha1.c .make.dirs include/apr_base64.h include/apr_sha1.h include/apr_xlate.h
|
||||
crypto/crypt_blowfish.lo: crypto/crypt_blowfish.c .make.dirs
|
||||
crypto/getuuid.lo: crypto/getuuid.c .make.dirs include/apr_md5.h include/apr_uuid.h include/apr_xlate.h
|
||||
crypto/uuid.lo: crypto/uuid.c .make.dirs include/apr_uuid.h
|
||||
dbd/apr_dbd.lo: dbd/apr_dbd.c .make.dirs include/apr_dbd.h include/apu_version.h include/private/apr_dbd_internal.h include/private/apu_internal.h
|
||||
@ -43,7 +45,7 @@ uri/apr_uri.lo: uri/apr_uri.c .make.dirs include/apr_uri.h
|
||||
xlate/xlate.lo: xlate/xlate.c .make.dirs include/apr_xlate.h
|
||||
xml/apr_xml.lo: xml/apr_xml.c .make.dirs include/apr_xlate.h include/apr_xml.h
|
||||
|
||||
OBJECTS_all = buckets/apr_brigade.lo buckets/apr_buckets.lo buckets/apr_buckets_alloc.lo buckets/apr_buckets_eos.lo buckets/apr_buckets_file.lo buckets/apr_buckets_flush.lo buckets/apr_buckets_heap.lo buckets/apr_buckets_mmap.lo buckets/apr_buckets_pipe.lo buckets/apr_buckets_pool.lo buckets/apr_buckets_refcount.lo buckets/apr_buckets_simple.lo buckets/apr_buckets_socket.lo crypto/apr_crypto.lo crypto/apr_md4.lo crypto/apr_md5.lo crypto/apr_sha1.lo crypto/getuuid.lo crypto/uuid.lo dbd/apr_dbd.lo dbm/apr_dbm.lo dbm/apr_dbm_sdbm.lo dbm/sdbm/sdbm.lo dbm/sdbm/sdbm_hash.lo dbm/sdbm/sdbm_lock.lo dbm/sdbm/sdbm_pair.lo encoding/apr_base64.lo hooks/apr_hooks.lo ldap/apr_ldap_stub.lo ldap/apr_ldap_url.lo memcache/apr_memcache.lo misc/apr_date.lo misc/apr_queue.lo misc/apr_reslist.lo misc/apr_rmm.lo misc/apr_thread_pool.lo misc/apu_dso.lo misc/apu_version.lo strmatch/apr_strmatch.lo uri/apr_uri.lo xlate/xlate.lo xml/apr_xml.lo
|
||||
OBJECTS_all = buckets/apr_brigade.lo buckets/apr_buckets.lo buckets/apr_buckets_alloc.lo buckets/apr_buckets_eos.lo buckets/apr_buckets_file.lo buckets/apr_buckets_flush.lo buckets/apr_buckets_heap.lo buckets/apr_buckets_mmap.lo buckets/apr_buckets_pipe.lo buckets/apr_buckets_pool.lo buckets/apr_buckets_refcount.lo buckets/apr_buckets_simple.lo buckets/apr_buckets_socket.lo crypto/apr_crypto.lo crypto/apr_md4.lo crypto/apr_md5.lo crypto/apr_passwd.lo crypto/apr_sha1.lo crypto/crypt_blowfish.lo crypto/getuuid.lo crypto/uuid.lo dbd/apr_dbd.lo dbm/apr_dbm.lo dbm/apr_dbm_sdbm.lo dbm/sdbm/sdbm.lo dbm/sdbm/sdbm_hash.lo dbm/sdbm/sdbm_lock.lo dbm/sdbm/sdbm_pair.lo encoding/apr_base64.lo hooks/apr_hooks.lo ldap/apr_ldap_stub.lo ldap/apr_ldap_url.lo memcache/apr_memcache.lo misc/apr_date.lo misc/apr_queue.lo misc/apr_reslist.lo misc/apr_rmm.lo misc/apr_thread_pool.lo misc/apu_dso.lo misc/apu_version.lo strmatch/apr_strmatch.lo uri/apr_uri.lo xlate/xlate.lo xml/apr_xml.lo
|
||||
|
||||
OBJECTS_unix = $(OBJECTS_all)
|
||||
|
||||
|
@ -10,9 +10,11 @@ paths =
|
||||
crypto/apr_crypto.c
|
||||
crypto/apr_md4.c
|
||||
crypto/apr_md5.c
|
||||
crypto/apr_passwd.c
|
||||
crypto/apr_sha1.c
|
||||
crypto/getuuid.c
|
||||
crypto/uuid.c
|
||||
crypto/crypt_blowfish.c
|
||||
dbm/apr_dbm_sdbm.c
|
||||
dbm/apr_dbm.c
|
||||
dbm/sdbm/*.c
|
||||
|
13507
contrib/apr-util/configure
vendored
13507
contrib/apr-util/configure
vendored
File diff suppressed because it is too large
Load Diff
@ -42,13 +42,20 @@ AC_CANONICAL_SYSTEM
|
||||
|
||||
AC_PROG_INSTALL
|
||||
|
||||
# Use -no-install to link the test programs on all platforms
|
||||
# but Darwin, where it would cause the programs to be linked
|
||||
# against installed versions of libapr instead of those just
|
||||
# built.
|
||||
# Use -no-install or -no-fast-install to link the test
|
||||
# programs on all platforms but Darwin, where it would cause
|
||||
# the programs to be linked against installed versions of
|
||||
# libapr instead of those just built.
|
||||
case $host in
|
||||
*-apple-darwin*) LT_NO_INSTALL="" ;;
|
||||
*) LT_NO_INSTALL="-no-install" ;;
|
||||
*-apple-darwin*)
|
||||
LT_NO_INSTALL=""
|
||||
;;
|
||||
*-mingw*)
|
||||
LT_NO_INSTALL="-no-fast-install"
|
||||
;;
|
||||
*)
|
||||
LT_NO_INSTALL="-no-install"
|
||||
;;
|
||||
esac
|
||||
AC_SUBST(LT_NO_INSTALL)
|
||||
|
||||
@ -151,8 +158,6 @@ dnl Determine what DBM backend type to use.
|
||||
dnl Find Expat
|
||||
dnl Find an iconv library
|
||||
APU_CHECK_CRYPTO
|
||||
APU_CHECK_CRYPTO_OPENSSL
|
||||
APU_CHECK_CRYPTO_NSS
|
||||
APU_FIND_LDAP
|
||||
APU_CHECK_DBM
|
||||
APU_CHECK_DBD
|
||||
@ -224,7 +229,22 @@ dnl copy apr's rules.mk into our build directory.
|
||||
if test ! -d ./build; then
|
||||
$mkdir_p build
|
||||
fi
|
||||
cp $APR_BUILD_DIR/apr_rules.mk $abs_builddir/build/rules.mk
|
||||
dnl
|
||||
dnl MinGW: If APR is shared, APR_DECLARE_EXPORT will be defined in the
|
||||
dnl internal CPPFLAGS, but APR-Util needs APU_DECLARE_EXPORT instead.
|
||||
dnl If APR is static, APR_DECLARE_STATIC will be defined in the
|
||||
dnl internal CPPFLAGS, but APR-Util needs APU_DECLARE_STATIC too.
|
||||
dnl
|
||||
case $host in
|
||||
*-mingw*)
|
||||
sed -e 's/-DAPR_DECLARE_EXPORT/-DAPU_DECLARE_EXPORT/' \
|
||||
-e 's/-DAPR_DECLARE_STATIC/-DAPU_DECLARE_STATIC -DAPR_DECLARE_STATIC/' \
|
||||
< $APR_BUILD_DIR/apr_rules.mk > $abs_builddir/build/rules.mk
|
||||
;;
|
||||
*)
|
||||
cp $APR_BUILD_DIR/apr_rules.mk $abs_builddir/build/rules.mk
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl
|
||||
dnl BSD/OS (BSDi) needs to use a different include syntax in the Makefiles
|
||||
|
@ -68,13 +68,14 @@ typedef struct apr_crypto_clear_t {
|
||||
} apr_crypto_clear_t;
|
||||
|
||||
#if !APU_DSO_BUILD
|
||||
#define DRIVER_LOAD(name,driver,pool,params) \
|
||||
#define DRIVER_LOAD(name,driver_name,pool,params,rv,result) \
|
||||
{ \
|
||||
extern const apr_crypto_driver_t driver; \
|
||||
apr_hash_set(drivers,name,APR_HASH_KEY_STRING,&driver); \
|
||||
if (driver.init) { \
|
||||
driver.init(pool, params); \
|
||||
extern const apr_crypto_driver_t driver_name; \
|
||||
apr_hash_set(drivers,name,APR_HASH_KEY_STRING,&driver_name); \
|
||||
if (driver_name.init) { \
|
||||
rv = driver_name.init(pool, params, result); \
|
||||
} \
|
||||
*driver = &driver_name; \
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -107,22 +108,6 @@ APU_DECLARE(apr_status_t) apr_crypto_init(apr_pool_t *pool)
|
||||
#endif
|
||||
drivers = apr_hash_make(pool);
|
||||
|
||||
#if !APU_DSO_BUILD
|
||||
/* Load statically-linked drivers: */
|
||||
#if APU_HAVE_OPENSSL
|
||||
DRIVER_LOAD("openssl", apr_crypto_openssl_driver, pool, params);
|
||||
#endif
|
||||
#if APU_HAVE_NSS
|
||||
DRIVER_LOAD("nss", apr_crypto_nss_driver, pool, params);
|
||||
#endif
|
||||
#if APU_HAVE_MSCAPI
|
||||
DRIVER_LOAD("mscapi", apr_crypto_mscapi_driver, pool, params);
|
||||
#endif
|
||||
#if APU_HAVE_MSCNG
|
||||
DRIVER_LOAD("mscng", apr_crypto_mscng_driver, pool, params);
|
||||
#endif
|
||||
#endif /* APU_DSO_BUILD */
|
||||
|
||||
apr_pool_cleanup_register(pool, NULL, apr_crypto_term,
|
||||
apr_pool_cleanup_null);
|
||||
|
||||
@ -165,7 +150,10 @@ APU_DECLARE(apr_status_t) apr_crypto_get_driver(
|
||||
apr_dso_handle_sym_t symbol;
|
||||
#endif
|
||||
apr_status_t rv;
|
||||
int rc = 0;
|
||||
|
||||
if (result) {
|
||||
*result = NULL; /* until further notice */
|
||||
}
|
||||
|
||||
#if APU_DSO_BUILD
|
||||
rv = apu_dso_mutex_lock();
|
||||
@ -197,37 +185,53 @@ APU_DECLARE(apr_status_t) apr_crypto_get_driver(
|
||||
#endif
|
||||
apr_snprintf(symname, sizeof(symname), "apr_crypto_%s_driver", name);
|
||||
rv = apu_dso_load(&dso, &symbol, modname, symname, pool);
|
||||
if (rv != APR_SUCCESS) { /* APR_EDSOOPEN or APR_ESYMNOTFOUND? */
|
||||
if (rv == APR_EINIT) { /* previously loaded?!? */
|
||||
name = apr_pstrdup(pool, name);
|
||||
apr_hash_set(drivers, name, APR_HASH_KEY_STRING, *driver);
|
||||
rv = APR_SUCCESS;
|
||||
if (rv == APR_SUCCESS || rv == APR_EINIT) { /* previously loaded?!? */
|
||||
*driver = symbol;
|
||||
name = apr_pstrdup(pool, name);
|
||||
apr_hash_set(drivers, name, APR_HASH_KEY_STRING, *driver);
|
||||
rv = APR_SUCCESS;
|
||||
if ((*driver)->init) {
|
||||
rv = (*driver)->init(pool, params, result);
|
||||
}
|
||||
goto unlock;
|
||||
}
|
||||
*driver = symbol;
|
||||
if ((*driver)->init) {
|
||||
rv = (*driver)->init(pool, params, &rc);
|
||||
}
|
||||
name = apr_pstrdup(pool, name);
|
||||
apr_hash_set(drivers, name, APR_HASH_KEY_STRING, *driver);
|
||||
apu_dso_mutex_unlock();
|
||||
|
||||
unlock: apu_dso_mutex_unlock();
|
||||
|
||||
if (APR_SUCCESS != rv && result) {
|
||||
if (APR_SUCCESS != rv && result && !*result) {
|
||||
char *buffer = apr_pcalloc(pool, ERROR_SIZE);
|
||||
apu_err_t *err = apr_pcalloc(pool, sizeof(apu_err_t));
|
||||
if (err && buffer) {
|
||||
apr_dso_error(dso, buffer, ERROR_SIZE - 1);
|
||||
err->msg = buffer;
|
||||
err->reason = modname;
|
||||
err->rc = rc;
|
||||
*result = err;
|
||||
}
|
||||
}
|
||||
|
||||
#else /* not builtin and !APR_HAS_DSO => not implemented */
|
||||
rv = APR_ENOTIMPL;
|
||||
|
||||
/* Load statically-linked drivers: */
|
||||
#if APU_HAVE_OPENSSL
|
||||
if (name[0] == 'o' && !strcmp(name, "openssl")) {
|
||||
DRIVER_LOAD("openssl", apr_crypto_openssl_driver, pool, params, rv, result);
|
||||
}
|
||||
#endif
|
||||
#if APU_HAVE_NSS
|
||||
if (name[0] == 'n' && !strcmp(name, "nss")) {
|
||||
DRIVER_LOAD("nss", apr_crypto_nss_driver, pool, params, rv, result);
|
||||
}
|
||||
#endif
|
||||
#if APU_HAVE_MSCAPI
|
||||
if (name[0] == 'm' && !strcmp(name, "mscapi")) {
|
||||
DRIVER_LOAD("mscapi", apr_crypto_mscapi_driver, pool, params, rv, result);
|
||||
}
|
||||
#endif
|
||||
#if APU_HAVE_MSCNG
|
||||
if (name[0] == 'm' && !strcmp(name, "mscng")) {
|
||||
DRIVER_LOAD("mscng", apr_crypto_mscng_driver, pool, params, rv, result);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
return rv;
|
||||
|
@ -57,7 +57,7 @@ struct apr_crypto_t {
|
||||
};
|
||||
|
||||
struct apr_crypto_config_t {
|
||||
void *opaque;
|
||||
void *opaque;
|
||||
};
|
||||
|
||||
struct apr_crypto_key_t {
|
||||
@ -121,7 +121,8 @@ static apr_status_t crypto_shutdown_helper(void *data)
|
||||
/**
|
||||
* Initialise the crypto library and perform one time initialisation.
|
||||
*/
|
||||
static apr_status_t crypto_init(apr_pool_t *pool, const char *params, int *rc)
|
||||
static apr_status_t crypto_init(apr_pool_t *pool, const char *params,
|
||||
const apu_err_t **result)
|
||||
{
|
||||
SECStatus s;
|
||||
const char *dir = NULL;
|
||||
@ -209,8 +210,12 @@ static apr_status_t crypto_init(apr_pool_t *pool, const char *params, int *rc)
|
||||
s = NSS_NoDB_Init(NULL);
|
||||
}
|
||||
if (s != SECSuccess) {
|
||||
if (rc) {
|
||||
*rc = PR_GetError();
|
||||
if (result) {
|
||||
apu_err_t *err = apr_pcalloc(pool, sizeof(apu_err_t));
|
||||
err->rc = PR_GetError();
|
||||
err->msg = PR_ErrorToName(s);
|
||||
err->reason = "Error during 'nss' initialisation";
|
||||
*result = err;
|
||||
}
|
||||
return APR_ECRYPT;
|
||||
}
|
||||
|
@ -1,203 +0,0 @@
|
||||
# Microsoft Developer Studio Project File - Name="apr_crypto_nss" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
|
||||
|
||||
CFG=apr_crypto_nss - Win32 Release
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "apr_crypto_nss.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "apr_crypto_nss.mak" CFG="apr_crypto_nss - Win32 Release"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "apr_crypto_nss - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "apr_crypto_nss - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "apr_crypto_nss - x64 Release" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "apr_crypto_nss - x64 Debug" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "apr_crypto_nss - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_NSS=1 /D HAVE_NSS_H=1 /D HAVE_PK11PUB_H=1 /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_crypto_nss_src" /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL"
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL"
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /fo"Release/apr_crypto_nss-1.res" /d DLL_NAME="apr_crypto_nss" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib nss3.lib nspr4.lib /nologo /base:"0x6F110000" /subsystem:windows /dll /incremental:no /debug /opt:ref
|
||||
# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib nss3.lib nspr4.lib nspr4.lib /nologo /base:"0x6F110000" /subsystem:windows /dll /incremental:no /debug /out:"Release\apr_crypto_nss-1.dll" /pdb:"Release\apr_crypto_nss-1.pdb" /implib:"Release\apr_crypto_nss-1.lib" /MACHINE:X86 /opt:ref
|
||||
# Begin Special Build Tool
|
||||
TargetPath=Release\apr_crypto_nss-1.dll
|
||||
SOURCE="$(InputPath)"
|
||||
PostBuild_Desc=Embed .manifest
|
||||
PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2
|
||||
# End Special Build Tool
|
||||
|
||||
!ELSEIF "$(CFG)" == "apr_crypto_nss - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c
|
||||
# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_NSS=1 /D HAVE_NSS_H=1 /D HAVE_PK11PUB_H=1 /D /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_crypto_nss_src" /FD /EHsc /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL"
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL"
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /fo"Debug/apr_crypto_nss-1.res" /d DLL_NAME="apr_crypto_nss" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib nss3.lib nspr4.lib /nologo /base:"0x6F110000" /subsystem:windows /dll /incremental:no /debug
|
||||
# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib nss3.lib nspr4.lib /nologo /base:"0x6F110000" /subsystem:windows /dll /incremental:no /debug /out:"Debug\apr_crypto_nss-1.dll" /pdb:"Debug\apr_crypto_nss-1.pdb" /implib:"Debug\apr_crypto_nss-1.lib" /MACHINE:X86
|
||||
# Begin Special Build Tool
|
||||
TargetPath=Debug\apr_crypto_nss-1.dll
|
||||
SOURCE="$(InputPath)"
|
||||
PostBuild_Desc=Embed .manifest
|
||||
PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2
|
||||
# End Special Build Tool
|
||||
|
||||
!ELSEIF "$(CFG)" == "apr_crypto_nss - x64 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "x64\Release"
|
||||
# PROP BASE Intermediate_Dir "x64\Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "x64\Release"
|
||||
# PROP Intermediate_Dir "x64\Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /Zi /O2 /Oy- /I "../include" /I "../../apr/include" /I "../include/private" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_NSS=1 /D HAVE_NSS_H=1 /D HAVE_PK11PUB_H=1 /D /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_crypto_nss_src" /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL"
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL"
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /fo"x64/Release/apr_crypto_nss-1.res" /d DLL_NAME="apr_crypto_nss" /d "NDEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib nss3.lib nspr4.lib /nologo /base:"0x6F110000" /subsystem:windows /dll /incremental:no /debug /opt:ref
|
||||
# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib nss3.lib nspr4.lib /nologo /base:"0x6F110000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Release\apr_crypto_nss-1.dll" /pdb:"x64\Release\apr_crypto_nss-1.pdb" /implib:"x64\Release\apr_crypto_nss-1.lib" /MACHINE:X64 /opt:ref
|
||||
# Begin Special Build Tool
|
||||
TargetPath=x64\Release\apr_crypto_nss-1.dll
|
||||
SOURCE="$(InputPath)"
|
||||
PostBuild_Desc=Embed .manifest
|
||||
PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2
|
||||
# End Special Build Tool
|
||||
|
||||
!ELSEIF "$(CFG)" == "apr_crypto_nss - x64 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "x64\Debug"
|
||||
# PROP BASE Intermediate_Dir "x64\Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "x64\Debug"
|
||||
# PROP Intermediate_Dir "x64\Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MDd /W3 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /EHsc /c
|
||||
# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DSO_MODULE_BUILD" /D APU_HAVE_NSS=1 /D HAVE_NSS_H=1 /D HAVE_PK11PUB_H=1 /D /Fo"$(INTDIR)\" /Fd"$(INTDIR)\apr_crypto_nss_src" /FD /EHsc /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL"
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL"
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /fo"x64/Debug/apr_crypto_nss-1.res" /d DLL_NAME="apr_crypto_nss" /d "_DEBUG" /d "APU_VERSION_ONLY" /I "../include" /I "../../apr/include"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib nss3.lib nspr4.lib /nologo /base:"0x6F110000" /subsystem:windows /dll /incremental:no /debug
|
||||
# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib nss3.lib nspr4.lib /nologo /base:"0x6F110000" /subsystem:windows /dll /incremental:no /debug /out:"x64\Debug\apr_crypto_nss-1.dll" /pdb:"x64\Debug\apr_crypto_nss-1.pdb" /implib:"x64\Debug\apr_crypto_nss-1.lib" /MACHINE:X64
|
||||
# Begin Special Build Tool
|
||||
TargetPath=x64\Debug\apr_crypto_nss-1.dll
|
||||
SOURCE="$(InputPath)"
|
||||
PostBuild_Desc=Embed .manifest
|
||||
PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2
|
||||
# End Special Build Tool
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "apr_crypto_nss - Win32 Release"
|
||||
# Name "apr_crypto_nss - Win32 Debug"
|
||||
# Name "apr_crypto_nss - x64 Release"
|
||||
# Name "apr_crypto_nss - x64 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\apr_crypto_nss.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Public Header Files"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\include\apr_crypto.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Internal Header Files"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\include\private\apu_config.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\include\private\apu_internal.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\libaprutil.rc
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
@ -108,7 +108,8 @@ static apr_status_t crypto_shutdown_helper(void *data)
|
||||
/**
|
||||
* Initialise the crypto library and perform one time initialisation.
|
||||
*/
|
||||
static apr_status_t crypto_init(apr_pool_t *pool, const char *params, int *rc)
|
||||
static apr_status_t crypto_init(apr_pool_t *pool, const char *params,
|
||||
const apu_err_t **result)
|
||||
{
|
||||
CRYPTO_malloc_init();
|
||||
ERR_load_crypto_strings();
|
||||
|
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