MFhead @ r283351
This commit is contained in:
commit
1a0cbcd01a
@ -1,4 +1,5 @@
|
||||
{
|
||||
"project.name": "S",
|
||||
"phabricator.uri" : "https://reviews.freebsd.org/"
|
||||
"phabricator.uri" : "https://reviews.freebsd.org/",
|
||||
"history.immutable" : true
|
||||
}
|
||||
|
10
Makefile
10
Makefile
@ -373,19 +373,19 @@ kernel-toolchains:
|
||||
# existing system is.
|
||||
#
|
||||
.if make(universe) || make(universe_kernels) || make(tinderbox) || make(targets)
|
||||
TARGETS?=amd64 arm i386 mips pc98 powerpc sparc64
|
||||
# XXX Add arm64 to universe only if we have an external binutils installed.
|
||||
# It does not build with the in-tree linnker.
|
||||
# It does not build with the in-tree linker.
|
||||
.if exists(/usr/local/aarch64-freebsd/bin/ld)
|
||||
TARGETS+=arm64
|
||||
TARGET_ARCHES_arm64?= aarch64
|
||||
.else
|
||||
UNIVERSE_arm64=arm64
|
||||
.elif empty(${TARGETS})
|
||||
universe: universe_arm64_skip
|
||||
universe_epilogue: universe_arm64_skip
|
||||
universe_arm64_skip: universe_prologue
|
||||
@echo ">> arm64 skipped - install aarch64-binutils port or package to build"
|
||||
.endif
|
||||
TARGETS?=amd64 arm ${UNIVERSE_arm64} i386 mips pc98 powerpc sparc64
|
||||
TARGET_ARCHES_arm?= arm armeb armv6 armv6hf
|
||||
TARGET_ARCHES_arm64?= aarch64
|
||||
TARGET_ARCHES_mips?= mipsel mips mips64el mips64 mipsn32
|
||||
TARGET_ARCHES_powerpc?= powerpc powerpc64
|
||||
TARGET_ARCHES_pc98?= i386
|
||||
|
@ -1263,7 +1263,8 @@ _gperf= gnu/usr.bin/gperf
|
||||
.endif
|
||||
|
||||
.if ${MK_GROFF} != "no"
|
||||
_groff= gnu/usr.bin/groff
|
||||
_groff= gnu/usr.bin/groff \
|
||||
usr.bin/soelim
|
||||
.endif
|
||||
|
||||
.if ${MK_VT} != "no"
|
||||
@ -1296,7 +1297,9 @@ _cat= bin/cat
|
||||
_lex= usr.bin/lex
|
||||
.endif
|
||||
|
||||
.if ${BOOTSTRAPPING} < 1001507
|
||||
# r277259 crunchide: Correct 64-bit section header offset
|
||||
# r281674 crunchide: always include both 32- and 64-bit ELF support
|
||||
.if ${BOOTSTRAPPING} < 1100071
|
||||
_crunch= usr.sbin/crunch
|
||||
.endif
|
||||
|
||||
@ -1360,6 +1363,9 @@ _kerberos5_bootstrap_tools= \
|
||||
.ORDER: ${_kerberos5_bootstrap_tools:C/^/${_bt}-/g}
|
||||
.endif
|
||||
|
||||
# Rebuild up-to-date libmd for xinstall
|
||||
${_bt}-usr.bin/xinstall: ${_bt}-lib/libmd
|
||||
|
||||
bootstrap-tools: .PHONY
|
||||
|
||||
# Please document (add comment) why something is in 'bootstrap-tools'.
|
||||
@ -1462,11 +1468,6 @@ kernel-tools: .MAKE
|
||||
_btxld= usr.sbin/btxld
|
||||
.endif
|
||||
.endif
|
||||
.if ${TARGET_ARCH} != ${MACHINE_ARCH}
|
||||
.if ${MK_RESCUE} != "no"
|
||||
_crunchide= usr.sbin/crunch/crunchide
|
||||
.endif
|
||||
.endif
|
||||
|
||||
# If we're given an XAS, don't build binutils.
|
||||
.if ${XAS:M/*} == ""
|
||||
@ -1501,6 +1502,9 @@ _clang_libs= lib/clang
|
||||
_cc= gnu/usr.bin/cc
|
||||
.endif
|
||||
.endif
|
||||
.if ${MK_USB} != "no"
|
||||
_usb_tools= sys/boot/usb/tools
|
||||
.endif
|
||||
|
||||
cross-tools: .MAKE
|
||||
.for _tool in \
|
||||
@ -1511,7 +1515,7 @@ cross-tools: .MAKE
|
||||
${_cc} \
|
||||
${_btxld} \
|
||||
${_crunchide} \
|
||||
sys/boot/usb/tools
|
||||
${_usb_tools}
|
||||
${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \
|
||||
cd ${.CURDIR}/${_tool} && \
|
||||
${MAKE} DIRPRFX=${_tool}/ obj && \
|
||||
@ -1522,7 +1526,8 @@ cross-tools: .MAKE
|
||||
|
||||
NXBENV= MAKEOBJDIRPREFIX=${OBJTREE}/nxb \
|
||||
INSTALL="sh ${.CURDIR}/tools/install.sh" \
|
||||
VERSION="${VERSION}"
|
||||
VERSION="${VERSION}" \
|
||||
PATH=${PATH}:${OBJTREE}/gperf_for_gcc/usr/bin
|
||||
NXBMAKE= ${NXBENV} ${MAKE} \
|
||||
TBLGEN=${OBJTREE}/nxb-bin/usr/bin/tblgen \
|
||||
CLANG_TBLGEN=${OBJTREE}/nxb-bin/usr/bin/clang-tblgen \
|
||||
@ -1535,7 +1540,21 @@ NXBMAKE= ${NXBENV} ${MAKE} \
|
||||
MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \
|
||||
MK_LLDB=no
|
||||
|
||||
# native-xtools is the current target for qemu-user cross builds of ports
|
||||
# via poudriere and the imgact_binmisc kernel module.
|
||||
# For non-clang enabled targets that are still using the in tree gcc
|
||||
# we must build a gperf binary for one instance of its Makefiles. On
|
||||
# clang-enabled systems, the gperf binary is obsolete.
|
||||
native-xtools: .MAKE
|
||||
.if ${MK_GCC_BOOTSTRAP} != "no"
|
||||
mkdir -p ${OBJTREE}/gperf_for_gcc/usr/bin
|
||||
${_+_}@${ECHODIR} "===> ${_gperf} (obj,depend,all,install)"; \
|
||||
cd ${.CURDIR}/${_gperf} && \
|
||||
${NXBMAKE} DIRPRFX=${_gperf}/ obj && \
|
||||
${NXBMAKE} DIRPRFX=${_gperf}/ depend && \
|
||||
${NXBMAKE} DIRPRFX=${_gperf}/ all && \
|
||||
${NXBMAKE} DIRPRFX=${_gperf}/ DESTDIR=${OBJTREE}/gperf_for_gcc install
|
||||
.endif
|
||||
mkdir -p ${OBJTREE}/nxb-bin/bin
|
||||
mkdir -p ${OBJTREE}/nxb-bin/sbin
|
||||
mkdir -p ${OBJTREE}/nxb-bin/usr
|
||||
@ -1641,13 +1660,7 @@ _prereq_libs= gnu/lib/libssp/libssp_nonshared gnu/lib/libgcc lib/libcompiler_rt
|
||||
# all shared libraries for ELF.
|
||||
#
|
||||
_startup_libs= gnu/lib/csu
|
||||
.if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-elf)
|
||||
_startup_libs+= lib/csu/${MACHINE_ARCH}-elf
|
||||
.elif exists(${.CURDIR}/lib/csu/${MACHINE_ARCH})
|
||||
_startup_libs+= lib/csu/${MACHINE_ARCH}
|
||||
.else
|
||||
_startup_libs+= lib/csu/${MACHINE_CPUARCH}
|
||||
.endif
|
||||
_startup_libs+= lib/csu
|
||||
_startup_libs+= gnu/lib/libgcc
|
||||
_startup_libs+= lib/libcompiler_rt
|
||||
_startup_libs+= lib/libc
|
||||
@ -1666,7 +1679,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1} \
|
||||
${_kerberos5_lib_libhdb} \
|
||||
${_kerberos5_lib_libheimbase} \
|
||||
${_kerberos5_lib_libheimntlm} \
|
||||
${_kerberos5_lib_libheimsqlite} \
|
||||
${_libsqlite3} \
|
||||
${_kerberos5_lib_libheimipcc} \
|
||||
${_kerberos5_lib_libhx509} ${_kerberos5_lib_libkrb5} \
|
||||
${_kerberos5_lib_libroken} \
|
||||
@ -1742,6 +1755,13 @@ _cddl_lib= cddl/lib
|
||||
cddl/lib/libzfs_core__L: cddl/lib/libnvpair__L
|
||||
cddl/lib/libzfs__L: lib/libgeom__L
|
||||
cddl/lib/libctf__L: lib/libz__L
|
||||
# cddl/lib/libdtrace requires lib/libproc and lib/librtld_db; it's only built
|
||||
# on select architectures though (see cddl/lib/Makefile)
|
||||
.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || \
|
||||
${MACHINE_CPUARCH} == "mips" || ${MACHINE_CPUARCH} == "powerpc" || \
|
||||
${MACHINE_CPUARCH} == "arm"
|
||||
_prebuild_libs+= lib/libproc lib/librtld_db
|
||||
.endif
|
||||
.endif
|
||||
|
||||
.if ${MK_CRYPT} != "no"
|
||||
@ -1773,7 +1793,7 @@ _secure_lib= secure/lib
|
||||
kerberos5/lib/libasn1__L: lib/libcom_err__L kerberos5/lib/libroken__L
|
||||
kerberos5/lib/libhdb__L: kerberos5/lib/libasn1__L lib/libcom_err__L \
|
||||
kerberos5/lib/libkrb5__L kerberos5/lib/libroken__L \
|
||||
kerberos5/lib/libwind__L kerberos5/lib/libheimsqlite__L
|
||||
kerberos5/lib/libwind__L lib/libsqlite3__L
|
||||
kerberos5/lib/libheimntlm__L: secure/lib/libcrypto__L kerberos5/lib/libkrb5__L \
|
||||
kerberos5/lib/libroken__L lib/libcom_err__L
|
||||
kerberos5/lib/libhx509__L: kerberos5/lib/libasn1__L lib/libcom_err__L \
|
||||
@ -1786,7 +1806,7 @@ kerberos5/lib/libroken__L: lib/libcrypt__L
|
||||
kerberos5/lib/libwind__L: kerberos5/lib/libroken__L lib/libcom_err__L
|
||||
kerberos5/lib/libheimbase__L: lib/libthr__L
|
||||
kerberos5/lib/libheimipcc__L: kerberos5/lib/libroken__L kerberos5/lib/libheimbase__L lib/libthr__L
|
||||
kerberos5/lib/libheimsqlite__L: lib/libthr__L
|
||||
lib/libsqlite3__L: lib/libthr__L
|
||||
.endif
|
||||
|
||||
.if ${MK_GSSAPI} != "no"
|
||||
@ -1802,7 +1822,7 @@ _kerberos5_lib_libkrb5= kerberos5/lib/libkrb5
|
||||
_kerberos5_lib_libhx509= kerberos5/lib/libhx509
|
||||
_kerberos5_lib_libroken= kerberos5/lib/libroken
|
||||
_kerberos5_lib_libheimntlm= kerberos5/lib/libheimntlm
|
||||
_kerberos5_lib_libheimsqlite= kerberos5/lib/libheimsqlite
|
||||
_libsqlite3= lib/libsqlite3
|
||||
_kerberos5_lib_libheimipcc= kerberos5/lib/libheimipcc
|
||||
_kerberos5_lib_libwind= kerberos5/lib/libwind
|
||||
_libcom_err= lib/libcom_err
|
||||
@ -1816,6 +1836,16 @@ _lib_libypclnt= lib/libypclnt
|
||||
lib/libradius__L: lib/libmd__L
|
||||
.endif
|
||||
|
||||
lib/libproc__L: \
|
||||
${_cddl_lib_libctf:D${_cddl_lib_libctf}__L} lib/libelf__L lib/librtld_db__L lib/libutil__L
|
||||
.if ${MK_CXX} != "no"
|
||||
.if ${MK_LIBCPLUSPLUS} != "no"
|
||||
lib/libproc__L: lib/libcxxrt__L
|
||||
.else # This implies MK_GNUCXX != "no"; see lib/libproc
|
||||
lib/libproc__L: gnu/lib/libsupc++__L
|
||||
.endif
|
||||
.endif
|
||||
|
||||
gnu/lib/libdialog__L: lib/msun__L lib/ncurses/ncursesw__L
|
||||
|
||||
.for _lib in ${_prereq_libs}
|
||||
|
@ -38,6 +38,111 @@
|
||||
# xargs -n1 | sort | uniq -d;
|
||||
# done
|
||||
|
||||
# 20150521
|
||||
OLD_FILES+=usr/bin/demandoc
|
||||
OLD_FILES+=usr/share/man/man1/demandoc.1.gz
|
||||
OLD_FILES+=usr/share/man/man3/mandoc.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/mandoc_headers.3.gz
|
||||
# 20150520
|
||||
OLD_FILES+=usr/lib/libheimsqlite.a
|
||||
OLD_FILES+=usr/lib/libheimsqlite.so
|
||||
OLD_LIBS+=usr/lib/libheimsqlite.so.11
|
||||
OLD_FILES+=usr/lib/libheimsqlite_p.a
|
||||
OLD_FILES+=usr/lib32/libheimsqlite.a
|
||||
OLD_FILES+=usr/lib32/libheimsqlite.so
|
||||
OLD_LIBS+=usr/lib32/libheimsqlite.so.11
|
||||
OLD_FILES+=usr/lib32/libheimsqlite_p.a
|
||||
# 20150506
|
||||
OLD_FILES+=usr/share/man/man9/NDHASGIANT.9.gz
|
||||
# 20150504
|
||||
OLD_LIBS+=usr/lib32/private/libatf-c++.so.2
|
||||
OLD_LIBS+=usr/lib32/private/libbsdstat.so.1
|
||||
OLD_LIBS+=usr/lib32/private/libheimipcs.so.11
|
||||
OLD_LIBS+=usr/lib32/private/libsqlite3.so.0
|
||||
OLD_LIBS+=usr/lib32/private/libunbound.so.5
|
||||
OLD_LIBS+=usr/lib32/private/libatf-c.so.1
|
||||
OLD_LIBS+=usr/lib32/private/libheimipcc.so.11
|
||||
OLD_LIBS+=usr/lib32/private/libldns.so.5
|
||||
OLD_LIBS+=usr/lib32/private/libssh.so.5
|
||||
OLD_LIBS+=usr/lib32/private/libucl.so.1
|
||||
OLD_DIRS+=usr/lib32/private
|
||||
OLD_LIBS+=usr/lib/private/libatf-c++.so.2
|
||||
OLD_LIBS+=usr/lib/private/libbsdstat.so.1
|
||||
OLD_LIBS+=usr/lib/private/libheimipcs.so.11
|
||||
OLD_LIBS+=usr/lib/private/libsqlite3.so.0
|
||||
OLD_LIBS+=usr/lib/private/libunbound.so.5
|
||||
OLD_LIBS+=usr/lib/private/libatf-c.so.1
|
||||
OLD_LIBS+=usr/lib/private/libheimipcc.so.11
|
||||
OLD_LIBS+=usr/lib/private/libldns.so.5
|
||||
OLD_LIBS+=usr/lib/private/libssh.so.5
|
||||
OLD_LIBS+=usr/lib/private/libucl.so.1
|
||||
OLD_DIRS+=usr/lib/private
|
||||
# 20150501
|
||||
OLD_FILES+=usr/bin/soeliminate
|
||||
OLD_FILES+=usr/share/man/man1/soeliminate.1.gz
|
||||
# 20150501: Remove the nvlist_.*[vf] functions manpages.
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_addf_binary.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_addf_bool.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_addf_descriptor.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_addf_null.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_addf_number.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_addf_nvlist.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_addf_string.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_addv_binary.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_addv_bool.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_addv_descriptor.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_addv_null.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_addv_number.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_addv_nvlist.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_addv_string.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_existsf_binary.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_existsf_bool.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_existsf_descriptor.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_existsf_null.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_existsf_number.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_existsf_nvlist.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_existsf_string.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_existsf_type.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_existsv_binary.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_existsv_bool.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_existsv_descriptor.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_existsv_null.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_existsv_number.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_existsv_nvlist.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_existsv_string.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_existsv_type.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_freef_binary.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_freef_bool.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_freef_descriptor.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_freef_null.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_freef_number.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_freef_nvlist.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_freef_string.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_freef_type.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_freev_binary.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_freev_bool.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_freev_descriptor.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_freev_null.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_freev_number.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_freev_nvlist.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_freev_string.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_freev_type.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_getf_binary.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_getf_bool.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_getf_descriptor.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_getf_number.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_getf_nvlist.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_getf_string.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_getv_binary.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_getv_bool.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_getv_descriptor.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_getv_number.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_getv_nvlist.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_getv_string.3.gz
|
||||
# 20150429:
|
||||
OLD_FILES+=usr/share/docs/papers/hwpmc.ascii.gz
|
||||
# 20150427: test/sys/kern/mmap_test moved to test/sys/vm/mmap_test
|
||||
OLD_FILES+=usr/tests/sys/kern/mmap_test
|
||||
# 20150418
|
||||
OLD_FILES+=sbin/mount_oldnfs
|
||||
OLD_FILES+=usr/share/man/man8/mount_oldnfs.8.gz
|
||||
@ -357,6 +462,33 @@ OLD_LIBS+=usr/lib32/libopie.so.7
|
||||
OLD_FILES+=usr/bin/otp-sha
|
||||
OLD_FILES+=usr/share/man/man1/otp-sha.1.gz
|
||||
# 20140807: Remove private lib files that should not be installed.
|
||||
OLD_FILES+=usr/lib32/private/libatf-c.a
|
||||
OLD_FILES+=usr/lib32/private/libatf-c.so
|
||||
OLD_FILES+=usr/lib32/private/libatf-c_p.a
|
||||
OLD_FILES+=usr/lib32/private/libatf-c++.a
|
||||
OLD_FILES+=usr/lib32/private/libatf-c++.so
|
||||
OLD_FILES+=usr/lib32/private/libatf-c++_p.a
|
||||
OLD_FILES+=usr/lib32/private/libbsdstat.a
|
||||
OLD_FILES+=usr/lib32/private/libbsdstat.so
|
||||
OLD_FILES+=usr/lib32/private/libbsdstat_p.a
|
||||
OLD_FILES+=usr/lib32/private/libheimipcc.a
|
||||
OLD_FILES+=usr/lib32/private/libheimipcc.so
|
||||
OLD_FILES+=usr/lib32/private/libheimipcc_p.a
|
||||
OLD_FILES+=usr/lib32/private/libheimipcs.a
|
||||
OLD_FILES+=usr/lib32/private/libheimipcs.so
|
||||
OLD_FILES+=usr/lib32/private/libheimipcs_p.a
|
||||
OLD_FILES+=usr/lib32/private/libldns.a
|
||||
OLD_FILES+=usr/lib32/private/libldns.so
|
||||
OLD_FILES+=usr/lib32/private/libldns_p.a
|
||||
OLD_FILES+=usr/lib32/private/libssh.a
|
||||
OLD_FILES+=usr/lib32/private/libssh.so
|
||||
OLD_FILES+=usr/lib32/private/libssh_p.a
|
||||
OLD_FILES+=usr/lib32/private/libunbound.a
|
||||
OLD_FILES+=usr/lib32/private/libunbound.so
|
||||
OLD_FILES+=usr/lib32/private/libunbound_p.a
|
||||
OLD_FILES+=usr/lib32/private/libucl.a
|
||||
OLD_FILES+=usr/lib32/private/libucl.so
|
||||
OLD_FILES+=usr/lib32/private/libucl_p.a
|
||||
OLD_FILES+=usr/lib/private/libatf-c.a
|
||||
OLD_FILES+=usr/lib/private/libatf-c.so
|
||||
OLD_FILES+=usr/lib/private/libatf-c_p.a
|
||||
@ -377,7 +509,7 @@ OLD_FILES+=usr/lib/private/libldns.so
|
||||
OLD_FILES+=usr/lib/private/libldns_p.a
|
||||
OLD_FILES+=usr/lib/private/libssh.a
|
||||
OLD_FILES+=usr/lib/private/libssh.so
|
||||
OLD_FILES+=usr/lib/private/libssh.p.a
|
||||
OLD_FILES+=usr/lib/private/libssh_p.a
|
||||
OLD_FILES+=usr/lib/private/libunbound.a
|
||||
OLD_FILES+=usr/lib/private/libunbound.so
|
||||
OLD_FILES+=usr/lib/private/libunbound_p.a
|
||||
@ -529,8 +661,12 @@ OLD_FILES+=usr/libexec/bsdconfig/070.usermgmt/groupinput
|
||||
# 20140223: Remove libyaml
|
||||
OLD_FILES+=usr/lib/private/libyaml.a
|
||||
OLD_FILES+=usr/lib/private/libyaml.so
|
||||
OLD_FILES+=usr/lib/private/libyaml.so.1
|
||||
OLD_LIBS+=usr/lib/private/libyaml.so.1
|
||||
OLD_FILES+=usr/lib/private/libyaml_p.a
|
||||
OLD_FILES+=usr/lib32/private/libyaml.a
|
||||
OLD_FILES+=usr/lib32/private/libyaml.so
|
||||
OLD_LIBS+=usr/lib32/private/libyaml.so.1
|
||||
OLD_FILES+=usr/lib32/private/libyaml_p.a
|
||||
# 20140216: new clang import which bumps version from 3.3 to 3.4.
|
||||
OLD_FILES+=usr/bin/llvm-prof
|
||||
OLD_FILES+=usr/bin/llvm-ranlib
|
||||
|
22
UPDATING
22
UPDATING
@ -31,6 +31,28 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11.x IS SLOW:
|
||||
disable the most expensive debugging functionality run
|
||||
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
|
||||
|
||||
20150521:
|
||||
TI platform code switched to using vendor DTS files and this update
|
||||
may break existing systems running on Beaglebone, Beaglebone Black,
|
||||
and Pandaboard:
|
||||
|
||||
- dtb files should be regenerated/reinstalled. Filenames are the
|
||||
same but content is different now
|
||||
- GPIO addressing was changed, now each GPIO bank (32 pins per bank)
|
||||
has its own /dev/gpiocX device, e.g. pin 121 on /dev/gpioc0 in old
|
||||
addressing scheme is now pin 25 on /dev/gpioc3.
|
||||
- Pandaboard: /etc/ttys should be updated, serial console device is
|
||||
now /dev/ttyu2, not /dev/ttyu0
|
||||
|
||||
20150501:
|
||||
soelim(1) from gnu/usr.bin/groff has been replaced by usr.bin/soelim.
|
||||
If you need the GNU extension from groff soelim(1), install groff
|
||||
from package: pkg install groff, or via ports: textproc/groff.
|
||||
|
||||
20150423:
|
||||
chmod, chflags, chown and chgrp now affect symlinks in -R mode as
|
||||
defined in symlink(7); previously symlinks were silently ignored.
|
||||
|
||||
20150415:
|
||||
The const qualifier has been removed from iconv(3) to comply with
|
||||
POSIX. The ports tree is aware of this from r384038 onwards.
|
||||
|
@ -32,7 +32,7 @@
|
||||
.\" @(#)chflags.1 8.4 (Berkeley) 5/2/95
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd April 8, 2013
|
||||
.Dd April 20, 2015
|
||||
.Dt CHFLAGS 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -66,8 +66,9 @@ nor modify the exit status to reflect such failures.
|
||||
.It Fl H
|
||||
If the
|
||||
.Fl R
|
||||
option is specified, symbolic links on the command line are followed.
|
||||
(Symbolic links encountered in the tree traversal are not followed.)
|
||||
option is specified, symbolic links on the command line are followed
|
||||
and hence unaffected by the command.
|
||||
(Symbolic links encountered during traversal are not followed.)
|
||||
.It Fl h
|
||||
If the
|
||||
.Ar file
|
||||
@ -83,8 +84,12 @@ If the
|
||||
option is specified, no symbolic links are followed.
|
||||
This is the default.
|
||||
.It Fl R
|
||||
Change the file flags for the file hierarchies rooted
|
||||
in the files instead of just the files themselves.
|
||||
Change the file flags of the file hierarchies rooted in the files,
|
||||
instead of just the files themselves.
|
||||
Beware of unintentionally matching the
|
||||
.Dq Pa ".."
|
||||
hard link to the parent directory when using wildcards like
|
||||
.Dq Li ".*" .
|
||||
.It Fl v
|
||||
Cause
|
||||
.Nm
|
||||
|
@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <fts.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@ -65,7 +66,6 @@ main(int argc, char *argv[])
|
||||
int Hflag, Lflag, Rflag, fflag, hflag, vflag;
|
||||
int ch, fts_options, oct, rval;
|
||||
char *flags, *ep;
|
||||
int (*change_flags)(const char *, unsigned long);
|
||||
|
||||
Hflag = Lflag = Rflag = fflag = hflag = vflag = 0;
|
||||
while ((ch = getopt(argc, argv, "HLPRfhv")) != -1)
|
||||
@ -104,20 +104,23 @@ main(int argc, char *argv[])
|
||||
usage();
|
||||
|
||||
if (Rflag) {
|
||||
fts_options = FTS_PHYSICAL;
|
||||
if (hflag)
|
||||
errx(1, "the -R and -h options "
|
||||
"may not be specified together");
|
||||
if (Hflag)
|
||||
fts_options |= FTS_COMFOLLOW;
|
||||
errx(1, "the -R and -h options may not be "
|
||||
"specified together.");
|
||||
if (Lflag) {
|
||||
fts_options &= ~FTS_PHYSICAL;
|
||||
fts_options |= FTS_LOGICAL;
|
||||
}
|
||||
} else
|
||||
fts_options = hflag ? FTS_PHYSICAL : FTS_LOGICAL;
|
||||
fts_options = FTS_LOGICAL;
|
||||
} else {
|
||||
fts_options = FTS_PHYSICAL;
|
||||
|
||||
change_flags = hflag ? lchflags : chflags;
|
||||
if (Hflag) {
|
||||
fts_options |= FTS_COMFOLLOW;
|
||||
}
|
||||
}
|
||||
} else if (hflag) {
|
||||
fts_options = FTS_PHYSICAL;
|
||||
} else {
|
||||
fts_options = FTS_LOGICAL;
|
||||
}
|
||||
|
||||
flags = *argv;
|
||||
if (*flags >= '0' && *flags <= '7') {
|
||||
@ -142,12 +145,21 @@ main(int argc, char *argv[])
|
||||
err(1, NULL);
|
||||
|
||||
for (rval = 0; (p = fts_read(ftsp)) != NULL;) {
|
||||
int atflag;
|
||||
|
||||
if ((fts_options & FTS_LOGICAL) ||
|
||||
((fts_options & FTS_COMFOLLOW) &&
|
||||
p->fts_level == FTS_ROOTLEVEL))
|
||||
atflag = 0;
|
||||
else
|
||||
atflag = AT_SYMLINK_NOFOLLOW;
|
||||
|
||||
switch (p->fts_info) {
|
||||
case FTS_D: /* Change it at FTS_DP if we're recursive. */
|
||||
if (!Rflag)
|
||||
fts_set(ftsp, p, FTS_SKIP);
|
||||
continue;
|
||||
case FTS_DNR: /* Warn, chflag, continue. */
|
||||
case FTS_DNR: /* Warn, chflags. */
|
||||
warnx("%s: %s", p->fts_path, strerror(p->fts_errno));
|
||||
rval = 1;
|
||||
break;
|
||||
@ -156,16 +168,6 @@ main(int argc, char *argv[])
|
||||
warnx("%s: %s", p->fts_path, strerror(p->fts_errno));
|
||||
rval = 1;
|
||||
continue;
|
||||
case FTS_SL: /* Ignore. */
|
||||
case FTS_SLNONE:
|
||||
/*
|
||||
* The only symlinks that end up here are ones that
|
||||
* don't point to anything and ones that we found
|
||||
* doing a physical walk.
|
||||
*/
|
||||
if (!hflag)
|
||||
continue;
|
||||
/* FALLTHROUGH */
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -175,7 +177,8 @@ main(int argc, char *argv[])
|
||||
newflags = (p->fts_statp->st_flags | set) & clear;
|
||||
if (newflags == p->fts_statp->st_flags)
|
||||
continue;
|
||||
if ((*change_flags)(p->fts_accpath, newflags) && !fflag) {
|
||||
if (chflagsat(AT_FDCWD, p->fts_accpath, newflags,
|
||||
atflag) == -1 && !fflag) {
|
||||
warn("%s", p->fts_path);
|
||||
rval = 1;
|
||||
} else if (vflag) {
|
||||
|
@ -32,7 +32,7 @@
|
||||
.\" @(#)chmod.1 8.4 (Berkeley) 3/31/94
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd January 26, 2009
|
||||
.Dd April 20, 2015
|
||||
.Dt CHMOD 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -63,9 +63,9 @@ nor modify the exit status to reflect such failures.
|
||||
.It Fl H
|
||||
If the
|
||||
.Fl R
|
||||
option is specified, symbolic links on the command line are followed.
|
||||
(Symbolic links encountered in the tree traversal are not followed by
|
||||
default.)
|
||||
option is specified, symbolic links on the command line are followed
|
||||
and hence unaffected by the command.
|
||||
(Symbolic links encountered during tree traversal are not followed.)
|
||||
.It Fl h
|
||||
If the file is a symbolic link, change the mode of the link itself
|
||||
rather than the file that the link points to.
|
||||
@ -79,8 +79,12 @@ If the
|
||||
option is specified, no symbolic links are followed.
|
||||
This is the default.
|
||||
.It Fl R
|
||||
Change the modes of the file hierarchies rooted in the files
|
||||
Change the modes of the file hierarchies rooted in the files,
|
||||
instead of just the files themselves.
|
||||
Beware of unintentionally matching the
|
||||
.Dq Pa ".."
|
||||
hard link to the parent directory when using wildcards like
|
||||
.Dq Li ".*" .
|
||||
.It Fl v
|
||||
Cause
|
||||
.Nm
|
||||
|
@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <fts.h>
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
@ -62,7 +63,7 @@ main(int argc, char *argv[])
|
||||
FTS *ftsp;
|
||||
FTSENT *p;
|
||||
mode_t *set;
|
||||
int Hflag, Lflag, Rflag, ch, error, fflag, fts_options, hflag, rval;
|
||||
int Hflag, Lflag, Rflag, ch, fflag, fts_options, hflag, rval;
|
||||
int vflag;
|
||||
char *mode;
|
||||
mode_t newmode;
|
||||
@ -126,18 +127,23 @@ done: argv += optind;
|
||||
usage();
|
||||
|
||||
if (Rflag) {
|
||||
fts_options = FTS_PHYSICAL;
|
||||
if (hflag)
|
||||
errx(1,
|
||||
"the -R and -h options may not be specified together.");
|
||||
if (Hflag)
|
||||
fts_options |= FTS_COMFOLLOW;
|
||||
errx(1, "the -R and -h options may not be "
|
||||
"specified together.");
|
||||
if (Lflag) {
|
||||
fts_options &= ~FTS_PHYSICAL;
|
||||
fts_options |= FTS_LOGICAL;
|
||||
fts_options = FTS_LOGICAL;
|
||||
} else {
|
||||
fts_options = FTS_PHYSICAL;
|
||||
|
||||
if (Hflag) {
|
||||
fts_options |= FTS_COMFOLLOW;
|
||||
}
|
||||
}
|
||||
} else
|
||||
fts_options = hflag ? FTS_PHYSICAL : FTS_LOGICAL;
|
||||
} else if (hflag) {
|
||||
fts_options = FTS_PHYSICAL;
|
||||
} else {
|
||||
fts_options = FTS_LOGICAL;
|
||||
}
|
||||
|
||||
mode = *argv;
|
||||
if ((set = setmode(mode)) == NULL)
|
||||
@ -146,12 +152,21 @@ done: argv += optind;
|
||||
if ((ftsp = fts_open(++argv, fts_options, 0)) == NULL)
|
||||
err(1, "fts_open");
|
||||
for (rval = 0; (p = fts_read(ftsp)) != NULL;) {
|
||||
int atflag;
|
||||
|
||||
if ((fts_options & FTS_LOGICAL) ||
|
||||
((fts_options & FTS_COMFOLLOW) &&
|
||||
p->fts_level == FTS_ROOTLEVEL))
|
||||
atflag = 0;
|
||||
else
|
||||
atflag = AT_SYMLINK_NOFOLLOW;
|
||||
|
||||
switch (p->fts_info) {
|
||||
case FTS_D: /* Change it at FTS_DP. */
|
||||
if (!Rflag)
|
||||
fts_set(ftsp, p, FTS_SKIP);
|
||||
continue;
|
||||
case FTS_DNR: /* Warn, chmod, continue. */
|
||||
case FTS_DNR: /* Warn, chmod. */
|
||||
warnx("%s: %s", p->fts_path, strerror(p->fts_errno));
|
||||
rval = 1;
|
||||
break;
|
||||
@ -160,16 +175,6 @@ done: argv += optind;
|
||||
warnx("%s: %s", p->fts_path, strerror(p->fts_errno));
|
||||
rval = 1;
|
||||
continue;
|
||||
case FTS_SL: /* Ignore. */
|
||||
case FTS_SLNONE:
|
||||
/*
|
||||
* The only symlinks that end up here are ones that
|
||||
* don't point to anything and ones that we found
|
||||
* doing a physical walk.
|
||||
*/
|
||||
if (!hflag)
|
||||
continue;
|
||||
/* FALLTHROUGH */
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -182,32 +187,25 @@ done: argv += optind;
|
||||
if (may_have_nfs4acl(p, hflag) == 0 &&
|
||||
(newmode & ALLPERMS) == (p->fts_statp->st_mode & ALLPERMS))
|
||||
continue;
|
||||
if (hflag)
|
||||
error = lchmod(p->fts_accpath, newmode);
|
||||
else
|
||||
error = chmod(p->fts_accpath, newmode);
|
||||
if (error) {
|
||||
if (!fflag) {
|
||||
warn("%s", p->fts_path);
|
||||
rval = 1;
|
||||
}
|
||||
} else {
|
||||
if (vflag) {
|
||||
(void)printf("%s", p->fts_path);
|
||||
if (fchmodat(AT_FDCWD, p->fts_accpath, newmode, atflag) == -1
|
||||
&& !fflag) {
|
||||
warn("%s", p->fts_path);
|
||||
rval = 1;
|
||||
} else if (vflag) {
|
||||
(void)printf("%s", p->fts_path);
|
||||
|
||||
if (vflag > 1) {
|
||||
char m1[12], m2[12];
|
||||
if (vflag > 1) {
|
||||
char m1[12], m2[12];
|
||||
|
||||
strmode(p->fts_statp->st_mode, m1);
|
||||
strmode((p->fts_statp->st_mode &
|
||||
S_IFMT) | newmode, m2);
|
||||
(void)printf(": 0%o [%s] -> 0%o [%s]",
|
||||
p->fts_statp->st_mode, m1,
|
||||
(p->fts_statp->st_mode & S_IFMT) |
|
||||
newmode, m2);
|
||||
}
|
||||
(void)printf("\n");
|
||||
strmode(p->fts_statp->st_mode, m1);
|
||||
strmode((p->fts_statp->st_mode &
|
||||
S_IFMT) | newmode, m2);
|
||||
(void)printf(": 0%o [%s] -> 0%o [%s]",
|
||||
p->fts_statp->st_mode, m1,
|
||||
(p->fts_statp->st_mode & S_IFMT) |
|
||||
newmode, m2);
|
||||
}
|
||||
(void)printf("\n");
|
||||
}
|
||||
}
|
||||
if (errno)
|
||||
|
29
bin/cp/cp.c
29
bin/cp/cp.c
@ -90,7 +90,6 @@ volatile sig_atomic_t info;
|
||||
enum op { FILE_TO_FILE, FILE_TO_DIR, DIR_TO_DNE };
|
||||
|
||||
static int copy(char *[], enum op, int);
|
||||
static int mastercmp(const FTSENT * const *, const FTSENT * const *);
|
||||
static void siginfo(int __unused);
|
||||
|
||||
int
|
||||
@ -274,7 +273,7 @@ copy(char *argv[], enum op type, int fts_options)
|
||||
mask = ~umask(0777);
|
||||
umask(~mask);
|
||||
|
||||
if ((ftsp = fts_open(argv, fts_options, mastercmp)) == NULL)
|
||||
if ((ftsp = fts_open(argv, fts_options, NULL)) == NULL)
|
||||
err(1, "fts_open");
|
||||
for (badcp = rval = 0; (curr = fts_read(ftsp)) != NULL; badcp = 0) {
|
||||
switch (curr->fts_info) {
|
||||
@ -488,32 +487,6 @@ copy(char *argv[], enum op type, int fts_options)
|
||||
return (rval);
|
||||
}
|
||||
|
||||
/*
|
||||
* mastercmp --
|
||||
* The comparison function for the copy order. The order is to copy
|
||||
* non-directory files before directory files. The reason for this
|
||||
* is because files tend to be in the same cylinder group as their
|
||||
* parent directory, whereas directories tend not to be. Copying the
|
||||
* files first reduces seeking.
|
||||
*/
|
||||
static int
|
||||
mastercmp(const FTSENT * const *a, const FTSENT * const *b)
|
||||
{
|
||||
int a_info, b_info;
|
||||
|
||||
a_info = (*a)->fts_info;
|
||||
if (a_info == FTS_ERR || a_info == FTS_NS || a_info == FTS_DNR)
|
||||
return (0);
|
||||
b_info = (*b)->fts_info;
|
||||
if (b_info == FTS_ERR || b_info == FTS_NS || b_info == FTS_DNR)
|
||||
return (0);
|
||||
if (a_info == FTS_D)
|
||||
return (-1);
|
||||
if (b_info == FTS_D)
|
||||
return (1);
|
||||
return (0);
|
||||
}
|
||||
|
||||
static void
|
||||
siginfo(int sig __unused)
|
||||
{
|
||||
|
@ -32,7 +32,7 @@
|
||||
.\" @(#)date.1 8.3 (Berkeley) 4/28/95
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd April 26, 2014
|
||||
.Dd May 7, 2015
|
||||
.Dt DATE 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -41,7 +41,7 @@
|
||||
.Sh SYNOPSIS
|
||||
.Nm
|
||||
.Op Fl jRu
|
||||
.Op Fl r Ar seconds
|
||||
.Op Fl r Ar seconds | Ar filename
|
||||
.Oo
|
||||
.Fl v
|
||||
.Sm off
|
||||
@ -150,6 +150,9 @@ is the number of seconds since the Epoch
|
||||
see
|
||||
.Xr time 3 ) ,
|
||||
and can be specified in decimal, octal, or hex.
|
||||
.It Fl r Ar filename
|
||||
Print the date and time of the last modification of
|
||||
.Ar filename .
|
||||
.It Fl t Ar minutes_west
|
||||
Set the system's value for minutes west of
|
||||
.Tn GMT .
|
||||
|
@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <ctype.h>
|
||||
#include <err.h>
|
||||
@ -85,6 +86,7 @@ main(int argc, char *argv[])
|
||||
struct vary *v;
|
||||
const struct vary *badv;
|
||||
struct tm lt;
|
||||
struct stat sb;
|
||||
|
||||
v = NULL;
|
||||
fmt = NULL;
|
||||
@ -116,8 +118,12 @@ main(int argc, char *argv[])
|
||||
case 'r': /* user specified seconds */
|
||||
rflag = 1;
|
||||
tval = strtoq(optarg, &tmp, 0);
|
||||
if (*tmp != 0)
|
||||
usage();
|
||||
if (*tmp != 0) {
|
||||
if (stat(optarg, &sb) == 0)
|
||||
tval = sb.st_mtim.tv_sec;
|
||||
else
|
||||
usage();
|
||||
}
|
||||
break;
|
||||
case 't': /* minutes west of UTC */
|
||||
/* error check; don't allow "PST" */
|
||||
|
@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$");
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include "pax.h"
|
||||
#include "extern.h"
|
||||
|
||||
|
@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$");
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "pax.h"
|
||||
#include "extern.h"
|
||||
|
@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$");
|
||||
#include <stdio.h>
|
||||
#include <pwd.h>
|
||||
#include <grp.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include "pax.h"
|
||||
#include "cache.h"
|
||||
|
@ -45,8 +45,6 @@ __FBSDID("$FreeBSD$");
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include "pax.h"
|
||||
#include "cpio.h"
|
||||
#include "extern.h"
|
||||
|
@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$");
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <sys/uio.h>
|
||||
#include <stdlib.h>
|
||||
#include "pax.h"
|
||||
#include "options.h"
|
||||
#include "extern.h"
|
||||
|
@ -45,8 +45,6 @@ __FBSDID("$FreeBSD$");
|
||||
#include <langinfo.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "pax.h"
|
||||
#include "extern.h"
|
||||
|
@ -19,8 +19,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "pax.h"
|
||||
#include "extern.h"
|
||||
int getoldopt(int, char **, const char *);
|
||||
|
||||
int
|
||||
getoldopt(int argc, char **argv, const char *optstring)
|
||||
|
@ -43,9 +43,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <sys/stat.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#ifdef NET2_REGEX
|
||||
#include <regexp.h>
|
||||
#else
|
||||
|
@ -58,7 +58,6 @@ __FBSDID("$FreeBSD$");
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include "pax.h"
|
||||
#include "extern.h"
|
||||
static int gen_init(void);
|
||||
|
@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$");
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include "pax.h"
|
||||
#include "sel_subs.h"
|
||||
|
@ -44,8 +44,6 @@ __FBSDID("$FreeBSD$");
|
||||
#include <sys/stat.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include "pax.h"
|
||||
#include "extern.h"
|
||||
#include "tar.h"
|
||||
|
@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$");
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "pax.h"
|
||||
#include "extern.h"
|
||||
|
@ -11,6 +11,6 @@ SRCS= fmt.c keyword.c nlist.c print.c ps.c
|
||||
# on large systems.
|
||||
#
|
||||
CFLAGS+=-DLAZY_PS
|
||||
LIBADD= m kvm jail
|
||||
LIBADD= m kvm jail xo
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
282
bin/ps/keyword.c
282
bin/ps/keyword.c
@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <libxo/xo.h>
|
||||
|
||||
#include "ps.h"
|
||||
|
||||
@ -64,116 +65,170 @@ static int vcmp(const void *, const void *);
|
||||
|
||||
/* PLEASE KEEP THE TABLE BELOW SORTED ALPHABETICALLY!!! */
|
||||
static VAR var[] = {
|
||||
{"%cpu", "%CPU", NULL, 0, pcpu, 0, CHAR, NULL, 0},
|
||||
{"%mem", "%MEM", NULL, 0, pmem, 0, CHAR, NULL, 0},
|
||||
{"acflag", "ACFLG", NULL, 0, kvar, KOFF(ki_acflag), USHORT, "x", 0},
|
||||
{"acflg", "", "acflag", 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"args", "COMMAND", NULL, COMM|LJUST|USER, arguments, 0,
|
||||
CHAR, NULL, 0},
|
||||
{"blocked", "", "sigmask", 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"caught", "", "sigcatch", 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"class", "CLASS", NULL, LJUST, loginclass, 0, CHAR, NULL, 0},
|
||||
{"comm", "COMMAND", NULL, LJUST, ucomm, 0, CHAR, NULL, 0},
|
||||
{"command", "COMMAND", NULL, COMM|LJUST|USER, command, 0,
|
||||
CHAR, NULL, 0},
|
||||
{"cow", "COW", NULL, 0, kvar, KOFF(ki_cow), UINT, "u", 0},
|
||||
{"cpu", "CPU", NULL, 0, kvar, KOFF(ki_estcpu), UINT, "d", 0},
|
||||
{"cputime", "", "time", 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"dsiz", "DSIZ", NULL, 0, kvar, KOFF(ki_dsize), PGTOK, "ld", 0},
|
||||
{"egid", "", "gid", 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"egroup", "", "group", 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"emul", "EMUL", NULL, LJUST, emulname, 0, CHAR, NULL, 0},
|
||||
{"etime", "ELAPSED", NULL, USER, elapsed, 0, CHAR, NULL, 0},
|
||||
{"etimes", "ELAPSED", NULL, USER, elapseds, 0, CHAR, NULL, 0},
|
||||
{"euid", "", "uid", 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"f", "F", NULL, 0, kvar, KOFF(ki_flag), INT, "x", 0},
|
||||
{"f2", "F2", NULL, 0, kvar, KOFF(ki_flag2), INT, "08x", 0},
|
||||
{"fib", "FIB", NULL, 0, kvar, KOFF(ki_fibnum), INT, "d", 0},
|
||||
{"flags", "", "f", 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"flags2", "", "f2", 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"gid", "GID", NULL, 0, kvar, KOFF(ki_groups), UINT, UIDFMT, 0},
|
||||
{"group", "GROUP", NULL, LJUST, egroupname, 0, CHAR, NULL, 0},
|
||||
{"ignored", "", "sigignore", 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"inblk", "INBLK", NULL, USER, rvar, ROFF(ru_inblock), LONG, "ld", 0},
|
||||
{"inblock", "", "inblk", 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"jid", "JID", NULL, 0, kvar, KOFF(ki_jid), INT, "d", 0},
|
||||
{"jobc", "JOBC", NULL, 0, kvar, KOFF(ki_jobc), SHORT, "d", 0},
|
||||
{"ktrace", "KTRACE", NULL, 0, kvar, KOFF(ki_traceflag), INT, "x", 0},
|
||||
{"label", "LABEL", NULL, LJUST, label, 0, CHAR, NULL, 0},
|
||||
{"lim", "LIM", NULL, 0, maxrss, 0, CHAR, NULL, 0},
|
||||
{"lockname", "LOCK", NULL, LJUST, lockname, 0, CHAR, NULL, 0},
|
||||
{"login", "LOGIN", NULL, LJUST, logname, 0, CHAR, NULL, 0},
|
||||
{"logname", "", "login", 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"lstart", "STARTED", NULL, LJUST|USER, lstarted, 0, CHAR, NULL, 0},
|
||||
{"lwp", "LWP", NULL, 0, kvar, KOFF(ki_tid), UINT, LWPFMT, 0},
|
||||
{"majflt", "MAJFLT", NULL, USER, rvar, ROFF(ru_majflt), LONG, "ld", 0},
|
||||
{"minflt", "MINFLT", NULL, USER, rvar, ROFF(ru_minflt), LONG, "ld", 0},
|
||||
{"msgrcv", "MSGRCV", NULL, USER, rvar, ROFF(ru_msgrcv), LONG, "ld", 0},
|
||||
{"msgsnd", "MSGSND", NULL, USER, rvar, ROFF(ru_msgsnd), LONG, "ld", 0},
|
||||
{"mwchan", "MWCHAN", NULL, LJUST, mwchan, 0, CHAR, NULL, 0},
|
||||
{"ni", "", "nice", 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"nice", "NI", NULL, 0, kvar, KOFF(ki_nice), CHAR, "d", 0},
|
||||
{"nivcsw", "NIVCSW", NULL, USER, rvar, ROFF(ru_nivcsw), LONG, "ld", 0},
|
||||
{"nlwp", "NLWP", NULL, 0, kvar, KOFF(ki_numthreads), UINT, NLWPFMT, 0},
|
||||
{"nsignals", "", "nsigs", 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"nsigs", "NSIGS", NULL, USER, rvar, ROFF(ru_nsignals), LONG, "ld", 0},
|
||||
{"nswap", "NSWAP", NULL, USER, rvar, ROFF(ru_nswap), LONG, "ld", 0},
|
||||
{"nvcsw", "NVCSW", NULL, USER, rvar, ROFF(ru_nvcsw), LONG, "ld", 0},
|
||||
{"nwchan", "NWCHAN", NULL, LJUST, nwchan, 0, CHAR, NULL, 0},
|
||||
{"oublk", "OUBLK", NULL, USER, rvar, ROFF(ru_oublock), LONG, "ld", 0},
|
||||
{"oublock", "", "oublk", 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"paddr", "PADDR", NULL, 0, kvar, KOFF(ki_paddr), KPTR, "lx", 0},
|
||||
{"pagein", "PAGEIN", NULL, USER, pagein, 0, CHAR, NULL, 0},
|
||||
{"pcpu", "", "%cpu", 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"pending", "", "sig", 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"pgid", "PGID", NULL, 0, kvar, KOFF(ki_pgid), UINT, PIDFMT, 0},
|
||||
{"pid", "PID", NULL, 0, kvar, KOFF(ki_pid), UINT, PIDFMT, 0},
|
||||
{"pmem", "", "%mem", 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"ppid", "PPID", NULL, 0, kvar, KOFF(ki_ppid), UINT, PIDFMT, 0},
|
||||
{"pri", "PRI", NULL, 0, pri, 0, CHAR, NULL, 0},
|
||||
{"re", "RE", NULL, INF127, kvar, KOFF(ki_swtime), UINT, "d", 0},
|
||||
{"rgid", "RGID", NULL, 0, kvar, KOFF(ki_rgid), UINT, UIDFMT, 0},
|
||||
{"rgroup", "RGROUP", NULL, LJUST, rgroupname, 0, CHAR, NULL, 0},
|
||||
{"rss", "RSS", NULL, 0, kvar, KOFF(ki_rssize), PGTOK, "ld", 0},
|
||||
{"rtprio", "RTPRIO", NULL, 0, priorityr, KOFF(ki_pri), CHAR, NULL, 0},
|
||||
{"ruid", "RUID", NULL, 0, kvar, KOFF(ki_ruid), UINT, UIDFMT, 0},
|
||||
{"ruser", "RUSER", NULL, LJUST, runame, 0, CHAR, NULL, 0},
|
||||
{"sid", "SID", NULL, 0, kvar, KOFF(ki_sid), UINT, PIDFMT, 0},
|
||||
{"sig", "PENDING", NULL, 0, kvar, KOFF(ki_siglist), INT, "x", 0},
|
||||
{"sigcatch", "CAUGHT", NULL, 0, kvar, KOFF(ki_sigcatch), UINT, "x", 0},
|
||||
{"sigignore", "IGNORED", NULL, 0, kvar, KOFF(ki_sigignore),
|
||||
UINT, "x", 0},
|
||||
{"sigmask", "BLOCKED", NULL, 0, kvar, KOFF(ki_sigmask), UINT, "x", 0},
|
||||
{"sl", "SL", NULL, INF127, kvar, KOFF(ki_slptime), UINT, "d", 0},
|
||||
{"ssiz", "SSIZ", NULL, 0, kvar, KOFF(ki_ssize), PGTOK, "ld", 0},
|
||||
{"start", "STARTED", NULL, LJUST|USER, started, 0, CHAR, NULL, 0},
|
||||
{"stat", "", "state", 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"state", "STAT", NULL, LJUST, state, 0, CHAR, NULL, 0},
|
||||
{"svgid", "SVGID", NULL, 0, kvar, KOFF(ki_svgid), UINT, UIDFMT, 0},
|
||||
{"svuid", "SVUID", NULL, 0, kvar, KOFF(ki_svuid), UINT, UIDFMT, 0},
|
||||
{"systime", "SYSTIME", NULL, USER, systime, 0, CHAR, NULL, 0},
|
||||
{"tdaddr", "TDADDR", NULL, 0, kvar, KOFF(ki_tdaddr), KPTR, "lx", 0},
|
||||
{"tdev", "TDEV", NULL, 0, tdev, 0, CHAR, NULL, 0},
|
||||
{"tdnam", "TDNAM", NULL, LJUST, tdnam, 0, CHAR, NULL, 0},
|
||||
{"time", "TIME", NULL, USER, cputime, 0, CHAR, NULL, 0},
|
||||
{"tpgid", "TPGID", NULL, 0, kvar, KOFF(ki_tpgid), UINT, PIDFMT, 0},
|
||||
{"tracer", "TRACER", NULL, 0, kvar, KOFF(ki_tracer), UINT, PIDFMT, 0},
|
||||
{"tsid", "TSID", NULL, 0, kvar, KOFF(ki_tsid), UINT, PIDFMT, 0},
|
||||
{"tsiz", "TSIZ", NULL, 0, kvar, KOFF(ki_tsize), PGTOK, "ld", 0},
|
||||
{"tt", "TT ", NULL, 0, tname, 0, CHAR, NULL, 0},
|
||||
{"tty", "TTY", NULL, LJUST, longtname, 0, CHAR, NULL, 0},
|
||||
{"ucomm", "UCOMM", NULL, LJUST, ucomm, 0, CHAR, NULL, 0},
|
||||
{"uid", "UID", NULL, 0, kvar, KOFF(ki_uid), UINT, UIDFMT, 0},
|
||||
{"upr", "UPR", NULL, 0, upr, 0, CHAR, NULL, 0},
|
||||
{"uprocp", "UPROCP", NULL, 0, kvar, KOFF(ki_paddr), KPTR, "lx", 0},
|
||||
{"user", "USER", NULL, LJUST, uname, 0, CHAR, NULL, 0},
|
||||
{"usertime", "USERTIME", NULL, USER, usertime, 0, CHAR, NULL, 0},
|
||||
{"usrpri", "", "upr", 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"vsize", "", "vsz", 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"vsz", "VSZ", NULL, 0, vsize, 0, CHAR, NULL, 0},
|
||||
{"wchan", "WCHAN", NULL, LJUST, wchan, 0, CHAR, NULL, 0},
|
||||
{"xstat", "XSTAT", NULL, 0, kvar, KOFF(ki_xstat), USHORT, "x", 0},
|
||||
{"", NULL, NULL, 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"%cpu", "%CPU", NULL, "percent-cpu", 0, pcpu, 0, CHAR, NULL, 0},
|
||||
{"%mem", "%MEM", NULL, "percent-memory", 0, pmem, 0, CHAR, NULL, 0},
|
||||
{"acflag", "ACFLG", NULL, "accounting-flag", 0, kvar, KOFF(ki_acflag),
|
||||
USHORT, "x", 0},
|
||||
{"acflg", "", "acflag", NULL, 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"args", "COMMAND", NULL, "arguments", COMM|LJUST|USER, arguments, 0,
|
||||
CHAR, NULL, 0},
|
||||
{"blocked", "", "sigmask", NULL, 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"caught", "", "sigcatch", NULL, 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"class", "CLASS", NULL, "login-class", LJUST, loginclass, 0, CHAR,
|
||||
NULL, 0},
|
||||
{"comm", "COMMAND", NULL, "command", LJUST, ucomm, 0, CHAR, NULL, 0},
|
||||
{"command", "COMMAND", NULL, "command", COMM|LJUST|USER, command, 0,
|
||||
CHAR, NULL, 0},
|
||||
{"cow", "COW", NULL, "copy-on-write-faults", 0, kvar, KOFF(ki_cow),
|
||||
UINT, "u", 0},
|
||||
{"cpu", "CPU", NULL, "cpu-usage", 0, kvar, KOFF(ki_estcpu), UINT, "d",
|
||||
0},
|
||||
{"cputime", "", "time", NULL, 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"dsiz", "DSIZ", NULL, "data-size", 0, kvar, KOFF(ki_dsize), PGTOK,
|
||||
"ld", 0},
|
||||
{"egid", "", "gid", NULL, 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"egroup", "", "group", NULL, 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"emul", "EMUL", NULL, "emulation-envirnment", LJUST, emulname, 0,
|
||||
CHAR, NULL, 0},
|
||||
{"etime", "ELAPSED", NULL, "elapsed-time", USER, elapsed, 0, CHAR,
|
||||
NULL, 0},
|
||||
{"etimes", "ELAPSED", NULL, "elapsed-times", USER, elapseds, 0, CHAR,
|
||||
NULL, 0},
|
||||
{"euid", "", "uid", NULL, 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"f", "F", NULL, "flags", 0, kvar, KOFF(ki_flag), INT, "x", 0},
|
||||
{"f2", "F2", NULL, "flags2", 0, kvar, KOFF(ki_flag2), INT, "08x", 0},
|
||||
{"fib", "FIB", NULL, "fib", 0, kvar, KOFF(ki_fibnum), INT, "d", 0},
|
||||
{"flags", "", "f", NULL, 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"flags2", "", "f2", NULL, 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"gid", "GID", NULL, "gid", 0, kvar, KOFF(ki_groups), UINT, UIDFMT, 0},
|
||||
{"group", "GROUP", NULL, "group", LJUST, egroupname, 0, CHAR, NULL, 0},
|
||||
{"ignored", "", "sigignore", NULL, 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"inblk", "INBLK", NULL, "read-blocks", USER, rvar, ROFF(ru_inblock),
|
||||
LONG, "ld", 0},
|
||||
{"inblock", "", "inblk", NULL, 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"jid", "JID", NULL, "jail-id", 0, kvar, KOFF(ki_jid), INT, "d", 0},
|
||||
{"jobc", "JOBC", NULL, "job-control-count", 0, kvar, KOFF(ki_jobc),
|
||||
SHORT, "d", 0},
|
||||
{"ktrace", "KTRACE", NULL, "ktrace", 0, kvar, KOFF(ki_traceflag), INT,
|
||||
"x", 0},
|
||||
{"label", "LABEL", NULL, "label", LJUST, label, 0, CHAR, NULL, 0},
|
||||
{"lim", "LIM", NULL, "memory-limit", 0, maxrss, 0, CHAR, NULL, 0},
|
||||
{"lockname", "LOCK", NULL, "lock-name", LJUST, lockname, 0, CHAR, NULL,
|
||||
0},
|
||||
{"login", "LOGIN", NULL, "login-name", LJUST, logname, 0, CHAR, NULL,
|
||||
0},
|
||||
{"logname", "", "login", NULL, 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"lstart", "STARTED", NULL, "start-time", LJUST|USER, lstarted, 0,
|
||||
CHAR, NULL, 0},
|
||||
{"lwp", "LWP", NULL, "process-thread-id", 0, kvar, KOFF(ki_tid), UINT,
|
||||
LWPFMT, 0},
|
||||
{"majflt", "MAJFLT", NULL, "major-faults", USER, rvar, ROFF(ru_majflt),
|
||||
LONG, "ld", 0},
|
||||
{"minflt", "MINFLT", NULL, "minor-faults", USER, rvar, ROFF(ru_minflt),
|
||||
LONG, "ld", 0},
|
||||
{"msgrcv", "MSGRCV", NULL, "received-messages", USER, rvar,
|
||||
ROFF(ru_msgrcv), LONG, "ld", 0},
|
||||
{"msgsnd", "MSGSND", NULL, "sent-messages", USER, rvar,
|
||||
ROFF(ru_msgsnd), LONG, "ld", 0},
|
||||
{"mwchan", "MWCHAN", NULL, "wait-channel", LJUST, mwchan, 0, CHAR,
|
||||
NULL, 0},
|
||||
{"ni", "", "nice", NULL, 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"nice", "NI", NULL, "nice", 0, kvar, KOFF(ki_nice), CHAR, "d", 0},
|
||||
{"nivcsw", "NIVCSW", NULL, "involuntary-context-switches", USER, rvar,
|
||||
ROFF(ru_nivcsw), LONG, "ld", 0},
|
||||
{"nlwp", "NLWP", NULL, "threads", 0, kvar, KOFF(ki_numthreads), UINT,
|
||||
NLWPFMT, 0},
|
||||
{"nsignals", "", "nsigs", NULL, 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"nsigs", "NSIGS", NULL, "signals-taken", USER, rvar,
|
||||
ROFF(ru_nsignals), LONG, "ld", 0},
|
||||
{"nswap", "NSWAP", NULL, "swaps", USER, rvar, ROFF(ru_nswap), LONG,
|
||||
"ld", 0},
|
||||
{"nvcsw", "NVCSW", NULL, "voluntary-context-switches", USER, rvar,
|
||||
ROFF(ru_nvcsw), LONG, "ld", 0},
|
||||
{"nwchan", "NWCHAN", NULL, "wait-channel-address", LJUST, nwchan, 0,
|
||||
CHAR, NULL, 0},
|
||||
{"oublk", "OUBLK", NULL, "written-blocks", USER, rvar,
|
||||
ROFF(ru_oublock), LONG, "ld", 0},
|
||||
{"oublock", "", "oublk", NULL, 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"paddr", "PADDR", NULL, "process-address", 0, kvar, KOFF(ki_paddr),
|
||||
KPTR, "lx", 0},
|
||||
{"pagein", "PAGEIN", NULL, "pageins", USER, pagein, 0, CHAR, NULL, 0},
|
||||
{"pcpu", "", "%cpu", NULL, 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"pending", "", "sig", NULL, 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"pgid", "PGID", NULL, "process-group", 0, kvar, KOFF(ki_pgid), UINT,
|
||||
PIDFMT, 0},
|
||||
{"pid", "PID", NULL, "pid", 0, kvar, KOFF(ki_pid), UINT, PIDFMT, 0},
|
||||
{"pmem", "", "%mem", NULL, 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"ppid", "PPID", NULL, "ppid", 0, kvar, KOFF(ki_ppid), UINT, PIDFMT, 0},
|
||||
{"pri", "PRI", NULL, "priority", 0, pri, 0, CHAR, NULL, 0},
|
||||
{"re", "RE", NULL, "residency-time", INF127, kvar, KOFF(ki_swtime),
|
||||
UINT, "d", 0},
|
||||
{"rgid", "RGID", NULL, "real-gid", 0, kvar, KOFF(ki_rgid), UINT,
|
||||
UIDFMT, 0},
|
||||
{"rgroup", "RGROUP", NULL, "real-group", LJUST, rgroupname, 0, CHAR,
|
||||
NULL, 0},
|
||||
{"rss", "RSS", NULL, "rss", 0, kvar, KOFF(ki_rssize), PGTOK, "ld", 0},
|
||||
{"rtprio", "RTPRIO", NULL, "realtime-priority", 0, priorityr,
|
||||
KOFF(ki_pri), CHAR, NULL, 0},
|
||||
{"ruid", "RUID", NULL, "real-uid", 0, kvar, KOFF(ki_ruid), UINT,
|
||||
UIDFMT, 0},
|
||||
{"ruser", "RUSER", NULL, "real-user", LJUST, runame, 0, CHAR, NULL, 0},
|
||||
{"sid", "SID", NULL, "sid", 0, kvar, KOFF(ki_sid), UINT, PIDFMT, 0},
|
||||
{"sig", "PENDING", NULL, "signals-pending", 0, kvar, KOFF(ki_siglist),
|
||||
INT, "x", 0},
|
||||
{"sigcatch", "CAUGHT", NULL, "signals-caught", 0, kvar,
|
||||
KOFF(ki_sigcatch), UINT, "x", 0},
|
||||
{"sigignore", "IGNORED", NULL, "signals-ignored", 0, kvar,
|
||||
KOFF(ki_sigignore), UINT, "x", 0},
|
||||
{"sigmask", "BLOCKED", NULL, "signal-mask", 0, kvar, KOFF(ki_sigmask),
|
||||
UINT, "x", 0},
|
||||
{"sl", "SL", NULL, "sleep-time", INF127, kvar, KOFF(ki_slptime), UINT,
|
||||
"d", 0},
|
||||
{"ssiz", "SSIZ", NULL, "stack-size", 0, kvar, KOFF(ki_ssize), PGTOK,
|
||||
"ld", 0},
|
||||
{"start", "STARTED", NULL, "start-time", LJUST|USER, started, 0, CHAR,
|
||||
NULL, 0},
|
||||
{"stat", "", "state", NULL, 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"state", "STAT", NULL, "state", LJUST, state, 0, CHAR, NULL, 0},
|
||||
{"svgid", "SVGID", NULL, "saved-gid", 0, kvar, KOFF(ki_svgid), UINT,
|
||||
UIDFMT, 0},
|
||||
{"svuid", "SVUID", NULL, "saved-uid", 0, kvar, KOFF(ki_svuid), UINT,
|
||||
UIDFMT, 0},
|
||||
{"systime", "SYSTIME", NULL, "system-time", USER, systime, 0, CHAR,
|
||||
NULL, 0},
|
||||
{"tdaddr", "TDADDR", NULL, "thread-address", 0, kvar, KOFF(ki_tdaddr),
|
||||
KPTR, "lx", 0},
|
||||
{"tdev", "TDEV", NULL, "terminal-device", 0, tdev, 0, CHAR, NULL, 0},
|
||||
{"tdnam", "TDNAM", NULL, "terminal-device-name", LJUST, tdnam, 0, CHAR,
|
||||
NULL, 0},
|
||||
{"time", "TIME", NULL, "cpu-time", USER, cputime, 0, CHAR, NULL, 0},
|
||||
{"tpgid", "TPGID", NULL, "terminal-process-gid", 0, kvar,
|
||||
KOFF(ki_tpgid), UINT, PIDFMT, 0},
|
||||
{"tracer", "TRACER", NULL, "tracer", 0, kvar, KOFF(ki_tracer), UINT,
|
||||
PIDFMT, 0},
|
||||
{"tsid", "TSID", NULL, "terminal-sid", 0, kvar, KOFF(ki_tsid), UINT,
|
||||
PIDFMT, 0},
|
||||
{"tsiz", "TSIZ", NULL, "text-size", 0, kvar, KOFF(ki_tsize), PGTOK,
|
||||
"ld", 0},
|
||||
{"tt", "TT ", NULL, "terminal-name", 0, tname, 0, CHAR, NULL, 0},
|
||||
{"tty", "TTY", NULL, "tty", LJUST, longtname, 0, CHAR, NULL, 0},
|
||||
{"ucomm", "UCOMM", NULL, "accounting-name", LJUST, ucomm, 0, CHAR,
|
||||
NULL, 0},
|
||||
{"uid", "UID", NULL, "uid", 0, kvar, KOFF(ki_uid), UINT, UIDFMT, 0},
|
||||
{"upr", "UPR", NULL, "user-priority", 0, upr, 0, CHAR, NULL, 0},
|
||||
{"uprocp", "UPROCP", NULL, "process-address", 0, kvar, KOFF(ki_paddr),
|
||||
KPTR, "lx", 0},
|
||||
{"user", "USER", NULL, "user", LJUST, uname, 0, CHAR, NULL, 0},
|
||||
{"usertime", "USERTIME", NULL, "user-time", USER, usertime, 0, CHAR,
|
||||
NULL, 0},
|
||||
{"usrpri", "", "upr", NULL, 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"vsize", "", "vsz", NULL, 0, NULL, 0, CHAR, NULL, 0},
|
||||
{"vsz", "VSZ", NULL, "virtual-size", 0, vsize, 0, CHAR, NULL, 0},
|
||||
{"wchan", "WCHAN", NULL, "wait-channel", LJUST, wchan, 0, CHAR, NULL,
|
||||
0},
|
||||
{"xstat", "XSTAT", NULL, "exit-status", 0, kvar, KOFF(ki_xstat),
|
||||
USHORT, "x", 0},
|
||||
{"", NULL, NULL, NULL, 0, NULL, 0, CHAR, NULL, 0},
|
||||
};
|
||||
|
||||
void
|
||||
@ -185,16 +240,19 @@ showkey(void)
|
||||
|
||||
i = 0;
|
||||
sep = "";
|
||||
xo_open_list("key");
|
||||
for (v = var; *(p = v->name); ++v) {
|
||||
int len = strlen(p);
|
||||
if (termwidth && (i += len + 1) > termwidth) {
|
||||
i = len;
|
||||
sep = "\n";
|
||||
}
|
||||
(void) printf("%s%s", sep, p);
|
||||
xo_emit("{P:/%s}{l:key/%s}", sep, p);
|
||||
sep = " ";
|
||||
}
|
||||
(void) printf("\n");
|
||||
xo_emit("\n");
|
||||
xo_close_list("key");
|
||||
xo_finish();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <vis.h>
|
||||
#include <libxo/xo.h>
|
||||
|
||||
#include "ps.h"
|
||||
|
||||
@ -85,15 +86,15 @@ printheader(void)
|
||||
v = vent->var;
|
||||
if (v->flag & LJUST) {
|
||||
if (STAILQ_NEXT(vent, next_ve) == NULL) /* last one */
|
||||
(void)printf("%s", vent->header);
|
||||
xo_emit("{T:/%s}", vent->header);
|
||||
else
|
||||
(void)printf("%-*s", v->width, vent->header);
|
||||
xo_emit("{T:/%-*s}", v->width, vent->header);
|
||||
} else
|
||||
(void)printf("%*s", v->width, vent->header);
|
||||
xo_emit("{T:/%*s}", v->width, vent->header);
|
||||
if (STAILQ_NEXT(vent, next_ve) != NULL)
|
||||
(void)putchar(' ');
|
||||
xo_emit("{P: }");
|
||||
}
|
||||
(void)putchar('\n');
|
||||
xo_emit("\n");
|
||||
}
|
||||
|
||||
char *
|
||||
@ -102,7 +103,7 @@ arguments(KINFO *k, VARENT *ve)
|
||||
char *vis_args;
|
||||
|
||||
if ((vis_args = malloc(strlen(k->ki_args) * 4 + 1)) == NULL)
|
||||
errx(1, "malloc failed");
|
||||
xo_errx(1, "malloc failed");
|
||||
strvis(vis_args, k->ki_args, VIS_TAB | VIS_NL | VIS_NOSLASH);
|
||||
|
||||
if (STAILQ_NEXT(ve, next_ve) != NULL && strlen(vis_args) > ARGUMENTS_WIDTH)
|
||||
@ -130,7 +131,7 @@ command(KINFO *k, VARENT *ve)
|
||||
return (str);
|
||||
}
|
||||
if ((vis_args = malloc(strlen(k->ki_args) * 4 + 1)) == NULL)
|
||||
errx(1, "malloc failed");
|
||||
xo_errx(1, "malloc failed");
|
||||
strvis(vis_args, k->ki_args, VIS_TAB | VIS_NL | VIS_NOSLASH);
|
||||
|
||||
if (STAILQ_NEXT(ve, next_ve) == NULL) {
|
||||
@ -139,7 +140,7 @@ command(KINFO *k, VARENT *ve)
|
||||
if (k->ki_env) {
|
||||
if ((vis_env = malloc(strlen(k->ki_env) * 4 + 1))
|
||||
== NULL)
|
||||
errx(1, "malloc failed");
|
||||
xo_errx(1, "malloc failed");
|
||||
strvis(vis_env, k->ki_env,
|
||||
VIS_TAB | VIS_NL | VIS_NOSLASH);
|
||||
} else
|
||||
@ -215,7 +216,7 @@ state(KINFO *k, VARENT *ve __unused)
|
||||
|
||||
buf = malloc(16);
|
||||
if (buf == NULL)
|
||||
errx(1, "malloc failed");
|
||||
xo_errx(1, "malloc failed");
|
||||
|
||||
flag = k->ki_p->ki_flag;
|
||||
tdflags = k->ki_p->ki_tdflags; /* XXXKSE */
|
||||
@ -391,7 +392,7 @@ started(KINFO *k, VARENT *ve __unused)
|
||||
|
||||
buf = malloc(buflen);
|
||||
if (buf == NULL)
|
||||
errx(1, "malloc failed");
|
||||
xo_errx(1, "malloc failed");
|
||||
|
||||
then = k->ki_p->ki_start.tv_sec;
|
||||
tp = localtime(&then);
|
||||
@ -416,7 +417,7 @@ lstarted(KINFO *k, VARENT *ve __unused)
|
||||
|
||||
buf = malloc(buflen);
|
||||
if (buf == NULL)
|
||||
errx(1, "malloc failed");
|
||||
xo_errx(1, "malloc failed");
|
||||
|
||||
then = k->ki_p->ki_start.tv_sec;
|
||||
(void)strftime(buf, buflen, "%c", localtime(&then));
|
||||
@ -762,7 +763,7 @@ printval(void *bp, VAR *v)
|
||||
(void)asprintf(&str, ofmt, ps_pgtok(*(u_long *)bp));
|
||||
break;
|
||||
default:
|
||||
errx(1, "unknown type %d", v->type);
|
||||
xo_errx(1, "unknown type %d", v->type);
|
||||
}
|
||||
|
||||
return (str);
|
||||
@ -804,7 +805,7 @@ label(KINFO *k, VARENT *ve __unused)
|
||||
|
||||
string = NULL;
|
||||
if (mac_prepare_process_label(&proclabel) == -1) {
|
||||
warn("mac_prepare_process_label");
|
||||
xo_warn("mac_prepare_process_label");
|
||||
goto out;
|
||||
}
|
||||
error = mac_get_pid(k->ki_p->ki_pid, proclabel);
|
||||
|
@ -29,7 +29,7 @@
|
||||
.\" @(#)ps.1 8.3 (Berkeley) 4/18/94
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd December 9, 2014
|
||||
.Dd May 22, 2015
|
||||
.Dt PS 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -37,6 +37,7 @@
|
||||
.Nd process status
|
||||
.Sh SYNOPSIS
|
||||
.Nm
|
||||
.Op Fl -libxo
|
||||
.Op Fl aCcdefHhjlmrSTuvwXxZ
|
||||
.Op Fl O Ar fmt | Fl o Ar fmt
|
||||
.Op Fl G Ar gid Ns Op , Ns Ar gid Ns Ar ...
|
||||
@ -47,6 +48,7 @@
|
||||
.Op Fl t Ar tty Ns Op , Ns Ar tty Ns Ar ...
|
||||
.Op Fl U Ar user Ns Op , Ns Ar user Ns Ar ...
|
||||
.Nm
|
||||
.Op Fl -libxo
|
||||
.Op Fl L
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
@ -733,7 +735,9 @@ Display information on all system processes:
|
||||
.Xr procstat 1 ,
|
||||
.Xr w 1 ,
|
||||
.Xr kvm 3 ,
|
||||
.Xr libxo 3
|
||||
.Xr strftime 3 ,
|
||||
.Xr xo_parse_args 3
|
||||
.Xr mac 4 ,
|
||||
.Xr procfs 5 ,
|
||||
.Xr pstat 8 ,
|
||||
|
101
bin/ps/ps.c
101
bin/ps/ps.c
@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <libxo/xo.h>
|
||||
|
||||
#include "ps.h"
|
||||
|
||||
@ -184,7 +185,9 @@ main(int argc, char *argv[])
|
||||
int all, ch, elem, flag, _fmt, i, lineno, linelen, left;
|
||||
int descendancy, nentries, nkept, nselectors;
|
||||
int prtheader, wflag, what, xkeep, xkeep_implied;
|
||||
int fwidthmin, fwidthmax;
|
||||
char errbuf[_POSIX2_LINE_MAX];
|
||||
char fmtbuf[_POSIX2_LINE_MAX];
|
||||
|
||||
(void) setlocale(LC_ALL, "");
|
||||
time(&now); /* Used by routines in print.c. */
|
||||
@ -221,6 +224,11 @@ main(int argc, char *argv[])
|
||||
init_list(&uidlist, addelem_uid, sizeof(uid_t), "user");
|
||||
memf = _PATH_DEVNULL;
|
||||
nlistf = NULL;
|
||||
|
||||
argc = xo_parse_args(argc, argv);
|
||||
if (argc < 0)
|
||||
exit(1);
|
||||
|
||||
while ((ch = getopt(argc, argv, PS_ARGS)) != -1)
|
||||
switch (ch) {
|
||||
case 'A':
|
||||
@ -363,7 +371,7 @@ main(int argc, char *argv[])
|
||||
#endif
|
||||
case 'T':
|
||||
if ((optarg = ttyname(STDIN_FILENO)) == NULL)
|
||||
errx(1, "stdin: not a terminal");
|
||||
xo_errx(1, "stdin: not a terminal");
|
||||
/* FALLTHROUGH */
|
||||
case 't':
|
||||
add_list(&ttylist, optarg);
|
||||
@ -434,8 +442,7 @@ main(int argc, char *argv[])
|
||||
argv++;
|
||||
}
|
||||
if (*argv) {
|
||||
fprintf(stderr, "%s: illegal argument: %s\n",
|
||||
getprogname(), *argv);
|
||||
xo_warnx("illegal argument: %s\n", *argv);
|
||||
usage();
|
||||
}
|
||||
if (optfatal)
|
||||
@ -445,7 +452,7 @@ main(int argc, char *argv[])
|
||||
|
||||
kd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, errbuf);
|
||||
if (kd == 0)
|
||||
errx(1, "%s", errbuf);
|
||||
xo_errx(1, "%s", errbuf);
|
||||
|
||||
if (!_fmt)
|
||||
parsefmt(dfmt, 0);
|
||||
@ -453,7 +460,7 @@ main(int argc, char *argv[])
|
||||
if (nselectors == 0) {
|
||||
uidlist.l.ptr = malloc(sizeof(uid_t));
|
||||
if (uidlist.l.ptr == NULL)
|
||||
errx(1, "malloc failed");
|
||||
xo_errx(1, "malloc failed");
|
||||
nselectors = 1;
|
||||
uidlist.count = uidlist.maxcount = 1;
|
||||
*uidlist.l.uids = getuid();
|
||||
@ -515,11 +522,11 @@ main(int argc, char *argv[])
|
||||
nentries = -1;
|
||||
kp = kvm_getprocs(kd, what, flag, &nentries);
|
||||
if ((kp == NULL && nentries > 0) || (kp != NULL && nentries < 0))
|
||||
errx(1, "%s", kvm_geterr(kd));
|
||||
xo_errx(1, "%s", kvm_geterr(kd));
|
||||
nkept = 0;
|
||||
if (nentries > 0) {
|
||||
if ((kinfo = malloc(nentries * sizeof(*kinfo))) == NULL)
|
||||
errx(1, "malloc failed");
|
||||
xo_errx(1, "malloc failed");
|
||||
for (i = nentries; --i >= 0; ++kp) {
|
||||
/*
|
||||
* If the user specified multiple selection-criteria,
|
||||
@ -629,13 +636,18 @@ main(int argc, char *argv[])
|
||||
/*
|
||||
* Print header.
|
||||
*/
|
||||
xo_open_container("process-information");
|
||||
printheader();
|
||||
if (xo_get_style(NULL) != XO_STYLE_TEXT)
|
||||
termwidth = UNLIMITED;
|
||||
|
||||
/*
|
||||
* Output formatted lines.
|
||||
*/
|
||||
xo_open_list("process");
|
||||
for (i = lineno = 0; i < nkept; i++) {
|
||||
linelen = 0;
|
||||
xo_open_instance("process");
|
||||
STAILQ_FOREACH(vent, &varlist, next_ve) {
|
||||
if (vent->var->flag & LJUST)
|
||||
fmtstr = "%-*s";
|
||||
@ -645,21 +657,27 @@ main(int argc, char *argv[])
|
||||
ks = STAILQ_FIRST(&kinfo[i].ki_ks);
|
||||
STAILQ_REMOVE_HEAD(&kinfo[i].ki_ks, ks_next);
|
||||
/* Truncate rightmost column if necessary. */
|
||||
fwidthmax = _POSIX2_LINE_MAX;
|
||||
if (STAILQ_NEXT(vent, next_ve) == NULL &&
|
||||
termwidth != UNLIMITED && ks->ks_str != NULL) {
|
||||
left = termwidth - linelen;
|
||||
if (left > 0 && left < (int)strlen(ks->ks_str))
|
||||
ks->ks_str[left] = '\0';
|
||||
fwidthmax = left;
|
||||
}
|
||||
|
||||
str = ks->ks_str;
|
||||
if (str == NULL)
|
||||
str = "-";
|
||||
/* No padding for the last column, if it's LJUST. */
|
||||
if (STAILQ_NEXT(vent, next_ve) == NULL &&
|
||||
vent->var->flag & LJUST)
|
||||
linelen += printf(fmtstr, 0, str);
|
||||
else
|
||||
linelen += printf(fmtstr, vent->var->width, str);
|
||||
fwidthmin = (xo_get_style(NULL) != XO_STYLE_TEXT ||
|
||||
(STAILQ_NEXT(vent, next_ve) == NULL &&
|
||||
(vent->var->flag & LJUST))) ? 0 : vent->var->width;
|
||||
snprintf(fmtbuf, sizeof(fmtbuf), "{:%s/%%%s%d..%ds}",
|
||||
vent->var->field ?: vent->var->name,
|
||||
(vent->var->flag & LJUST) ? "-" : "",
|
||||
fwidthmin, fwidthmax);
|
||||
xo_emit(fmtbuf, str);
|
||||
linelen += fwidthmin;
|
||||
|
||||
if (ks->ks_str != NULL) {
|
||||
free(ks->ks_str);
|
||||
@ -669,17 +687,22 @@ main(int argc, char *argv[])
|
||||
ks = NULL;
|
||||
|
||||
if (STAILQ_NEXT(vent, next_ve) != NULL) {
|
||||
(void)putchar(' ');
|
||||
xo_emit("{P: }");
|
||||
linelen++;
|
||||
}
|
||||
}
|
||||
(void)putchar('\n');
|
||||
xo_emit("\n");
|
||||
xo_close_instance("process");
|
||||
if (prtheader && lineno++ == prtheader - 4) {
|
||||
(void)putchar('\n');
|
||||
xo_emit("\n");
|
||||
printheader();
|
||||
lineno = 0;
|
||||
}
|
||||
}
|
||||
xo_close_list("process");
|
||||
xo_close_container("process-information");
|
||||
xo_finish();
|
||||
|
||||
free_list(&gidlist);
|
||||
free_list(&jidlist);
|
||||
free_list(&pidlist);
|
||||
@ -705,9 +728,9 @@ addelem_gid(struct listinfo *inf, const char *elem)
|
||||
|
||||
if (*elem == '\0' || strlen(elem) >= MAXLOGNAME) {
|
||||
if (*elem == '\0')
|
||||
warnx("Invalid (zero-length) %s name", inf->lname);
|
||||
xo_warnx("Invalid (zero-length) %s name", inf->lname);
|
||||
else
|
||||
warnx("%s name too long: %s", inf->lname, elem);
|
||||
xo_warnx("%s name too long: %s", inf->lname, elem);
|
||||
optfatal = 1;
|
||||
return (0); /* Do not add this value. */
|
||||
}
|
||||
@ -732,7 +755,7 @@ addelem_gid(struct listinfo *inf, const char *elem)
|
||||
if (grp == NULL)
|
||||
grp = getgrnam(elem);
|
||||
if (grp == NULL) {
|
||||
warnx("No %s %s '%s'", inf->lname, nameorID, elem);
|
||||
xo_warnx("No %s %s '%s'", inf->lname, nameorID, elem);
|
||||
optfatal = 1;
|
||||
return (0);
|
||||
}
|
||||
@ -773,7 +796,7 @@ addelem_pid(struct listinfo *inf, const char *elem)
|
||||
long tempid;
|
||||
|
||||
if (*elem == '\0') {
|
||||
warnx("Invalid (zero-length) process id");
|
||||
xo_warnx("Invalid (zero-length) process id");
|
||||
optfatal = 1;
|
||||
return (0); /* Do not add this value. */
|
||||
}
|
||||
@ -781,10 +804,10 @@ addelem_pid(struct listinfo *inf, const char *elem)
|
||||
errno = 0;
|
||||
tempid = strtol(elem, &endp, 10);
|
||||
if (*endp != '\0' || tempid < 0 || elem == endp) {
|
||||
warnx("Invalid %s: %s", inf->lname, elem);
|
||||
xo_warnx("Invalid %s: %s", inf->lname, elem);
|
||||
errno = ERANGE;
|
||||
} else if (errno != 0 || tempid > pid_max) {
|
||||
warnx("%s too large: %s", inf->lname, elem);
|
||||
xo_warnx("%s too large: %s", inf->lname, elem);
|
||||
errno = ERANGE;
|
||||
}
|
||||
if (errno == ERANGE) {
|
||||
@ -855,19 +878,19 @@ addelem_tty(struct listinfo *inf, const char *elem)
|
||||
if (ttypath) {
|
||||
if (stat(ttypath, &sb) == -1) {
|
||||
if (pathbuf3[0] != '\0')
|
||||
warn("%s, %s, and %s", pathbuf3, pathbuf2,
|
||||
xo_warn("%s, %s, and %s", pathbuf3, pathbuf2,
|
||||
ttypath);
|
||||
else
|
||||
warn("%s", ttypath);
|
||||
xo_warn("%s", ttypath);
|
||||
optfatal = 1;
|
||||
return (0);
|
||||
}
|
||||
if (!S_ISCHR(sb.st_mode)) {
|
||||
if (pathbuf3[0] != '\0')
|
||||
warnx("%s, %s, and %s: Not a terminal",
|
||||
xo_warnx("%s, %s, and %s: Not a terminal",
|
||||
pathbuf3, pathbuf2, ttypath);
|
||||
else
|
||||
warnx("%s: Not a terminal", ttypath);
|
||||
xo_warnx("%s: Not a terminal", ttypath);
|
||||
optfatal = 1;
|
||||
return (0);
|
||||
}
|
||||
@ -887,9 +910,9 @@ addelem_uid(struct listinfo *inf, const char *elem)
|
||||
|
||||
if (*elem == '\0' || strlen(elem) >= MAXLOGNAME) {
|
||||
if (*elem == '\0')
|
||||
warnx("Invalid (zero-length) %s name", inf->lname);
|
||||
xo_warnx("Invalid (zero-length) %s name", inf->lname);
|
||||
else
|
||||
warnx("%s name too long: %s", inf->lname, elem);
|
||||
xo_warnx("%s name too long: %s", inf->lname, elem);
|
||||
optfatal = 1;
|
||||
return (0); /* Do not add this value. */
|
||||
}
|
||||
@ -899,12 +922,12 @@ addelem_uid(struct listinfo *inf, const char *elem)
|
||||
errno = 0;
|
||||
bigtemp = strtoul(elem, &endp, 10);
|
||||
if (errno != 0 || *endp != '\0' || bigtemp > UID_MAX)
|
||||
warnx("No %s named '%s'", inf->lname, elem);
|
||||
xo_warnx("No %s named '%s'", inf->lname, elem);
|
||||
else {
|
||||
/* The string is all digits, so it might be a userID. */
|
||||
pwd = getpwuid((uid_t)bigtemp);
|
||||
if (pwd == NULL)
|
||||
warnx("No %s name or ID matches '%s'",
|
||||
xo_warnx("No %s name or ID matches '%s'",
|
||||
inf->lname, elem);
|
||||
}
|
||||
}
|
||||
@ -961,7 +984,7 @@ add_list(struct listinfo *inf, const char *argp)
|
||||
while (*argp != '\0' && strchr(W_SEP T_SEP,
|
||||
*argp) == NULL)
|
||||
argp++;
|
||||
warnx("Value too long: %.*s", (int)(argp - savep),
|
||||
xo_warnx("Value too long: %.*s", (int)(argp - savep),
|
||||
savep);
|
||||
optfatal = 1;
|
||||
}
|
||||
@ -1062,7 +1085,7 @@ descendant_sort(KINFO *ki, int items)
|
||||
continue;
|
||||
}
|
||||
if ((ki[src].ki_d.prefix = malloc(lvl * 2 + 1)) == NULL)
|
||||
errx(1, "malloc failed");
|
||||
xo_errx(1, "malloc failed");
|
||||
for (n = 0; n < lvl - 2; n++) {
|
||||
ki[src].ki_d.prefix[n * 2] =
|
||||
path[n / 8] & 1 << (n % 8) ? '|' : ' ';
|
||||
@ -1100,7 +1123,7 @@ expand_list(struct listinfo *inf)
|
||||
newlist = realloc(inf->l.ptr, newmax * inf->elemsize);
|
||||
if (newlist == NULL) {
|
||||
free(inf->l.ptr);
|
||||
errx(1, "realloc to %d %ss failed", newmax, inf->lname);
|
||||
xo_errx(1, "realloc to %d %ss failed", newmax, inf->lname);
|
||||
}
|
||||
inf->maxcount = newmax;
|
||||
inf->l.ptr = newlist;
|
||||
@ -1174,7 +1197,7 @@ format_output(KINFO *ki)
|
||||
str = (v->oproc)(ki, vent);
|
||||
ks = malloc(sizeof(*ks));
|
||||
if (ks == NULL)
|
||||
errx(1, "malloc failed");
|
||||
xo_errx(1, "malloc failed");
|
||||
ks->ks_str = str;
|
||||
STAILQ_INSERT_TAIL(&ki->ki_ks, ks, ks_next);
|
||||
if (str != NULL) {
|
||||
@ -1240,7 +1263,7 @@ saveuser(KINFO *ki)
|
||||
else
|
||||
asprintf(&ki->ki_args, "(%s)", ki->ki_p->ki_comm);
|
||||
if (ki->ki_args == NULL)
|
||||
errx(1, "malloc failed");
|
||||
xo_errx(1, "malloc failed");
|
||||
} else {
|
||||
ki->ki_args = NULL;
|
||||
}
|
||||
@ -1251,7 +1274,7 @@ saveuser(KINFO *ki)
|
||||
else
|
||||
ki->ki_env = strdup("()");
|
||||
if (ki->ki_env == NULL)
|
||||
errx(1, "malloc failed");
|
||||
xo_errx(1, "malloc failed");
|
||||
} else {
|
||||
ki->ki_env = NULL;
|
||||
}
|
||||
@ -1372,7 +1395,7 @@ kludge_oldps_options(const char *optlist, char *origval, const char *nextarg)
|
||||
* original value.
|
||||
*/
|
||||
if ((newopts = ns = malloc(len + 3)) == NULL)
|
||||
errx(1, "malloc failed");
|
||||
xo_errx(1, "malloc failed");
|
||||
|
||||
if (*origval != '-')
|
||||
*ns++ = '-'; /* add option flag */
|
||||
@ -1401,7 +1424,7 @@ pidmax_init(void)
|
||||
|
||||
intsize = sizeof(pid_max);
|
||||
if (sysctlbyname("kern.pid_max", &pid_max, &intsize, NULL, 0) < 0) {
|
||||
warn("unable to read kern.pid_max");
|
||||
xo_warn("unable to read kern.pid_max");
|
||||
pid_max = 99999;
|
||||
}
|
||||
}
|
||||
@ -1411,7 +1434,7 @@ usage(void)
|
||||
{
|
||||
#define SINGLE_OPTS "[-aCcde" OPT_LAZY_f "HhjlmrSTuvwXxZ]"
|
||||
|
||||
(void)fprintf(stderr, "%s\n%s\n%s\n%s\n",
|
||||
(void)xo_error("%s\n%s\n%s\n%s\n",
|
||||
"usage: ps " SINGLE_OPTS " [-O fmt | -o fmt] [-G gid[,gid...]]",
|
||||
" [-J jid[,jid...]] [-M core] [-N system]",
|
||||
" [-p pid[,pid...]] [-t tty[,tty...]] [-U user[,user...]]",
|
||||
|
@ -65,6 +65,7 @@ typedef struct var {
|
||||
const char *name; /* name(s) of variable */
|
||||
const char *header; /* default header */
|
||||
const char *alias; /* aliases */
|
||||
const char *field; /* xo field name */
|
||||
#define COMM 0x01 /* needs exec arguments and environment (XXX) */
|
||||
#define LJUST 0x02 /* left adjust on output (trailing blanks) */
|
||||
#define USER 0x04 /* needs user structure */
|
||||
|
@ -1328,15 +1328,28 @@ ctf_add_type(ctf_file_t *dst_fp, ctf_file_t *src_fp, ctf_id_t src_type)
|
||||
* we are looking for. This is necessary to permit ctf_add_type() to
|
||||
* operate recursively on entities such as a struct that contains a
|
||||
* pointer member that refers to the same struct type.
|
||||
*
|
||||
* In the case of integer and floating point types, we match using the
|
||||
* type encoding as well - else we may incorrectly return a bitfield
|
||||
* type, for instance.
|
||||
*/
|
||||
if (dst_type == CTF_ERR && name[0] != '\0') {
|
||||
for (dtd = ctf_list_prev(&dst_fp->ctf_dtdefs); dtd != NULL &&
|
||||
CTF_TYPE_TO_INDEX(dtd->dtd_type) > dst_fp->ctf_dtoldid;
|
||||
dtd = ctf_list_prev(dtd)) {
|
||||
if (CTF_INFO_KIND(dtd->dtd_data.ctt_info) == kind &&
|
||||
dtd->dtd_name != NULL &&
|
||||
strcmp(dtd->dtd_name, name) == 0)
|
||||
return (dtd->dtd_type);
|
||||
if (CTF_INFO_KIND(dtd->dtd_data.ctt_info) != kind ||
|
||||
dtd->dtd_name == NULL ||
|
||||
strcmp(dtd->dtd_name, name) != 0)
|
||||
continue;
|
||||
if (kind == CTF_K_INTEGER || kind == CTF_K_FLOAT) {
|
||||
if (ctf_type_encoding(src_fp, src_type,
|
||||
&src_en) != 0)
|
||||
continue;
|
||||
if (bcmp(&src_en, &dtd->dtd_u.dtu_enc,
|
||||
sizeof (ctf_encoding_t)) != 0)
|
||||
continue;
|
||||
}
|
||||
return (dtd->dtd_type);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -743,6 +743,7 @@ yyinit(dt_pcb_t *pcb)
|
||||
#ifdef illumos
|
||||
yysptr = yysbuf;
|
||||
#endif
|
||||
YY_FLUSH_BUFFER;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1785,17 +1785,11 @@ dtrace_program_link(dtrace_hdl_t *dtp, dtrace_prog_t *pgp, uint_t dflags,
|
||||
"failed to open %s: %s", file, strerror(errno)));
|
||||
}
|
||||
#else
|
||||
if (dtp->dt_lazyload) {
|
||||
if ((fd = open(file, O_RDWR | O_CREAT | O_TRUNC, 0666)) < 0)
|
||||
return (dt_link_error(dtp, NULL, -1, NULL,
|
||||
"failed to open %s: %s", file, strerror(errno)));
|
||||
} else {
|
||||
snprintf(tfile, sizeof(tfile), "%s.XXXXXX", file);
|
||||
if ((fd = mkstemp(tfile)) == -1)
|
||||
return (dt_link_error(dtp, NULL, -1, NULL,
|
||||
"failed to create temporary file %s: %s",
|
||||
tfile, strerror(errno)));
|
||||
}
|
||||
snprintf(tfile, sizeof(tfile), "%s.XXXXXX", file);
|
||||
if ((fd = mkostemp(tfile, O_CLOEXEC)) == -1)
|
||||
return (dt_link_error(dtp, NULL, -1, NULL,
|
||||
"failed to create temporary file %s: %s",
|
||||
tfile, strerror(errno)));
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -1868,23 +1862,9 @@ dtrace_program_link(dtrace_hdl_t *dtp, dtrace_prog_t *pgp, uint_t dflags,
|
||||
(void) snprintf(cmd, len, fmt, dtp->dt_ld_path, file, fd, drti);
|
||||
#else
|
||||
const char *fmt = "%s -o %s -r %s %s";
|
||||
dt_dirpath_t *dp = dt_list_next(&dtp->dt_lib_path);
|
||||
|
||||
#if defined(__amd64__)
|
||||
/*
|
||||
* Arches which default to 64-bit need to explicitly use
|
||||
* the 32-bit library path.
|
||||
*/
|
||||
int use_32 = (dtp->dt_oflags & DTRACE_O_ILP32);
|
||||
#else
|
||||
/*
|
||||
* Arches which are 32-bit only just use the normal
|
||||
* library path.
|
||||
*/
|
||||
int use_32 = 0;
|
||||
#endif
|
||||
|
||||
(void) snprintf(drti, sizeof (drti), "/usr/lib%s/dtrace/drti.o",
|
||||
use_32 ? "32" : "");
|
||||
(void) snprintf(drti, sizeof (drti), "%s/drti.o", dp->dir_path);
|
||||
|
||||
len = snprintf(&tmp, 1, fmt, dtp->dt_ld_path, file, tfile,
|
||||
drti) + 1;
|
||||
@ -1951,14 +1931,23 @@ dtrace_program_link(dtrace_hdl_t *dtp, dtrace_prog_t *pgp, uint_t dflags,
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
#ifdef __FreeBSD__
|
||||
if (rename(tfile, file) != 0) {
|
||||
ret = dt_link_error(dtp, NULL, fd, NULL,
|
||||
"failed to rename %s to %s: %s", tfile, file,
|
||||
strerror(errno));
|
||||
goto done;
|
||||
}
|
||||
#endif
|
||||
(void) close(fd);
|
||||
}
|
||||
|
||||
done:
|
||||
dtrace_dof_destroy(dtp, dof);
|
||||
|
||||
#ifndef illumos
|
||||
unlink(tfile);
|
||||
#ifdef __FreeBSD__
|
||||
if (!dtp->dt_lazyload)
|
||||
(void) unlink(tfile);
|
||||
#endif
|
||||
return (ret);
|
||||
}
|
||||
|
@ -792,6 +792,7 @@ const char *_dtrace_libdir = "/usr/lib/dtrace"; /* default library directory */
|
||||
#ifdef illumos
|
||||
const char *_dtrace_provdir = "/dev/dtrace/provider"; /* provider directory */
|
||||
#else
|
||||
const char *_dtrace_libdir32 = "/usr/lib32/dtrace";
|
||||
const char *_dtrace_provdir = "/dev/dtrace"; /* provider directory */
|
||||
#endif
|
||||
|
||||
@ -1581,8 +1582,19 @@ dt_vopen(int version, int flags, int *errp,
|
||||
* compile, and to provide better error reporting (because the full
|
||||
* reporting of compiler errors requires dtrace_open() to succeed).
|
||||
*/
|
||||
#ifdef __FreeBSD__
|
||||
#ifdef __LP64__
|
||||
if ((dtp->dt_oflags & DTRACE_O_ILP32) != 0) {
|
||||
if (dtrace_setopt(dtp, "libdir", _dtrace_libdir32) != 0)
|
||||
return (set_open_errno(dtp, errp, dtp->dt_errno));
|
||||
}
|
||||
#endif
|
||||
if (dtrace_setopt(dtp, "libdir", _dtrace_libdir) != 0)
|
||||
return (set_open_errno(dtp, errp, dtp->dt_errno));
|
||||
#else
|
||||
if (dtrace_setopt(dtp, "libdir", _dtrace_libdir) != 0)
|
||||
return (set_open_errno(dtp, errp, dtp->dt_errno));
|
||||
#endif
|
||||
|
||||
return (dtp);
|
||||
}
|
||||
|
@ -793,6 +793,7 @@ dump_nvlist(nvlist_t *list, int indent)
|
||||
{
|
||||
nvpair_t *elem = NULL;
|
||||
boolean_t bool_value;
|
||||
boolean_t *bool_array_value;
|
||||
nvlist_t *nvlist_value;
|
||||
nvlist_t **nvlist_array_value;
|
||||
uint_t i, count;
|
||||
@ -853,6 +854,16 @@ dump_nvlist(nvlist_t *list, int indent)
|
||||
NVP(elem, string, char *, char *, "'%s'");
|
||||
break;
|
||||
|
||||
case DATA_TYPE_BOOLEAN_ARRAY:
|
||||
(void) nvpair_value_boolean_array(elem,
|
||||
&bool_array_value, &count);
|
||||
for (i = 0; i < count; i++) {
|
||||
(void) printf("%*s%s[%d]: %s\n", indent, "",
|
||||
nvpair_name(elem), i,
|
||||
bool_array_value[i] ? "true" : "false");
|
||||
}
|
||||
break;
|
||||
|
||||
case DATA_TYPE_BYTE_ARRAY:
|
||||
NVPA(elem, byte_array, uchar_t, int, "%u");
|
||||
break;
|
||||
|
@ -33,4 +33,11 @@ _drti= drti
|
||||
_libdtrace= libdtrace
|
||||
.endif
|
||||
|
||||
SUBDIR_DEPEND_libdtrace= libctf
|
||||
SUBDIR_DEPEND_libzfs_core= libnvpair
|
||||
SUBDIR_DEPEND_libzfs= libavl libnvpair libumem libuutil libzfs_core
|
||||
SUBDIR_DEPEND_libzpool= libavl libnvpair libumem
|
||||
|
||||
SUBDIR_PARALLEL=
|
||||
|
||||
.include <bsd.subdir.mk>
|
||||
|
@ -50,6 +50,7 @@ DSRCS= errno.d \
|
||||
io.d \
|
||||
ip.d \
|
||||
psinfo.d \
|
||||
siftr.d \
|
||||
signal.d \
|
||||
tcp.d \
|
||||
udp.d \
|
||||
@ -103,6 +104,8 @@ LFLAGS+=-l
|
||||
|
||||
YFLAGS+=-d
|
||||
|
||||
LIBADD= ctf elf proc pthread rtld_db
|
||||
|
||||
CLEANFILES= dt_errtags.c dt_names.c
|
||||
|
||||
dt_errtags.c:
|
||||
|
100
cddl/lib/libdtrace/siftr.d
Normal file
100
cddl/lib/libdtrace/siftr.d
Normal file
@ -0,0 +1,100 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#pragma D depends_on module siftr
|
||||
#pragma D depends_on provider tcp
|
||||
|
||||
/*
|
||||
* Convert a SIFTR direction value to a string
|
||||
*/
|
||||
#pragma D binding "1.12.1" SIFTR_IN
|
||||
inline int SIFTR_IN = 1;
|
||||
#pragma D binding "1.12.1" SIFTR_OUT
|
||||
inline int SIFTR_OUT = 2;
|
||||
|
||||
/* SIFTR direction strings. */
|
||||
#pragma D binding "1.12.1" siftr_dir_string
|
||||
inline string siftr_dir_string[uint8_t direction] =
|
||||
direction == SIFTR_IN ? "in" :
|
||||
direction == SIFTR_OUT ? "out" :
|
||||
"unknown" ;
|
||||
|
||||
typedef struct siftrinfo {
|
||||
struct timeval tval;
|
||||
uint8_t direction;
|
||||
uint8_t ipver;
|
||||
uint32_t hash;
|
||||
uint16_t tcp_localport;
|
||||
uint16_t tcp_foreignport;
|
||||
uint64_t snd_cwnd;
|
||||
u_long snd_wnd;
|
||||
u_long rcv_wnd;
|
||||
u_long snd_bwnd;
|
||||
u_long snd_ssthresh;
|
||||
int conn_state;
|
||||
u_int max_seg_size;
|
||||
int smoothed_rtt;
|
||||
u_char sack_enabled;
|
||||
u_char snd_scale;
|
||||
u_char rcv_scale;
|
||||
u_int flags;
|
||||
int rxt_length;
|
||||
u_int snd_buf_hiwater;
|
||||
u_int snd_buf_cc;
|
||||
u_int rcv_buf_hiwater;
|
||||
u_int rcv_buf_cc;
|
||||
u_int sent_inflight_bytes;
|
||||
int t_segqlen;
|
||||
u_int flowid;
|
||||
u_int flowtype;
|
||||
} siftrinfo_t;
|
||||
|
||||
#pragma D binding "1.12.1" translator
|
||||
translator siftrinfo_t < struct pkt_node *p > {
|
||||
direction = p == NULL ? 0 : p->direction;
|
||||
ipver = p == NULL ? 0 : p->ipver;
|
||||
hash = p == NULL ? 0 : p->hash;
|
||||
tcp_localport = p == NULL ? 0 : ntohs(p->tcp_localport);
|
||||
tcp_foreignport = p == NULL ? 0 : ntohs(p->tcp_foreignport);
|
||||
snd_cwnd = p == NULL ? 0 : p->snd_cwnd;
|
||||
snd_wnd = p == NULL ? 0 : p->snd_wnd;
|
||||
rcv_wnd = p == NULL ? 0 : p->rcv_wnd;
|
||||
snd_bwnd = p == NULL ? 0 : p->snd_bwnd;
|
||||
snd_ssthresh = p == NULL ? 0 : p->snd_ssthresh;
|
||||
conn_state = p == NULL ? 0 : p->conn_state;
|
||||
max_seg_size = p == NULL ? 0 : p->max_seg_size;
|
||||
smoothed_rtt = p == NULL ? 0 : p->smoothed_rtt;
|
||||
sack_enabled = p == NULL ? 0 : p->sack_enabled;
|
||||
snd_scale = p == NULL ? 0 : p->snd_scale;
|
||||
rcv_scale = p == NULL ? 0 : p->rcv_scale;
|
||||
flags = p == NULL ? 0 : p->flags;
|
||||
rxt_length = p == NULL ? 0 : p->rxt_length;
|
||||
snd_buf_hiwater = p == NULL ? 0 : p->snd_buf_hiwater;
|
||||
snd_buf_cc = p == NULL ? 0 : p->snd_buf_cc;
|
||||
rcv_buf_hiwater = p == NULL ? 0 : p->rcv_buf_hiwater;
|
||||
rcv_buf_cc = p == NULL ? 0 : p->rcv_buf_cc;
|
||||
sent_inflight_bytes = p == NULL ? 0 : p->sent_inflight_bytes;
|
||||
t_segqlen = p == NULL ? 0 : p->t_segqlen;
|
||||
flowid = p == NULL ? 0 : p->flowid;
|
||||
flowtype = p == NULL ? 0 : p->flowtype;
|
||||
};
|
@ -13,4 +13,6 @@ _zfs= zfs
|
||||
_zpool= zpool
|
||||
.endif
|
||||
|
||||
SUBDIR_PARALLEL=
|
||||
|
||||
.include <bsd.subdir.mk>
|
||||
|
@ -26,4 +26,6 @@ _zstreamdump = zstreamdump
|
||||
.endif
|
||||
.endif
|
||||
|
||||
SUBDIR_PARALLEL=
|
||||
|
||||
.include <bsd.subdir.mk>
|
||||
|
@ -3,8 +3,6 @@
|
||||
.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/tools/ctf/common
|
||||
.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/tools/ctf/cvt
|
||||
|
||||
DEBUG_FLAGS= -g
|
||||
|
||||
PROG= ctfconvert
|
||||
SRCS= alist.c \
|
||||
ctf.c \
|
||||
@ -36,7 +34,6 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \
|
||||
-I${OPENSOLARIS_USR_DISTDIR}/tools/ctf/cvt \
|
||||
-I${OPENSOLARIS_SYS_DISTDIR}/uts/common
|
||||
|
||||
DPADD= ${LIBDWARF} ${LIBELF} ${LIBZ} ${LIBPTHREAD}
|
||||
LDADD= -ldwarf -lelf -lz -lpthread
|
||||
LIBADD= dwarf elf z pthread
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
@ -17,7 +17,6 @@ CFLAGS+= -I${OPENSOLARIS_USR_DISTDIR} \
|
||||
-I${OPENSOLARIS_USR_DISTDIR}/tools/ctf/common \
|
||||
-I${OPENSOLARIS_SYS_DISTDIR}/uts/common
|
||||
|
||||
DPADD= ${LIBPTHREAD} ${LIBELF} ${LIBZ}
|
||||
LDADD= -lpthread -lelf -lz
|
||||
LIBADD= elf z
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
@ -46,4 +46,6 @@ _dtruss= dtruss
|
||||
_lockstat= lockstat
|
||||
.endif
|
||||
|
||||
SUBDIR_PARALLEL=
|
||||
|
||||
.include <bsd.subdir.mk>
|
||||
|
@ -20,9 +20,6 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \
|
||||
#CFLAGS+= -DNEED_ERRLOC
|
||||
#YFLAGS+= -d
|
||||
|
||||
DPADD= ${LIBPTHREAD} ${LIBDTRACE} ${LIBY} ${LIBL} ${LIBPROC} \
|
||||
${LIBCTF} ${LIBELF} ${LIBZ} ${LIBUTIL} ${LIBRTLD_DB}
|
||||
LDADD= -lpthread -ldtrace -ly -ll -lproc -lctf -lelf -lz -lutil \
|
||||
-lrtld_db
|
||||
LIBADD= dtrace
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
@ -38,7 +38,6 @@ exclude EXFAIL common/ip/tst.ipv4localudp.ksh
|
||||
exclude EXFAIL common/mdb/tst.dtracedcmd.ksh
|
||||
exclude EXFAIL common/misc/tst.dofmax.ksh
|
||||
exclude EXFAIL common/misc/tst.include.ksh
|
||||
exclude EXFAIL common/pragma/tst.libchain.ksh
|
||||
exclude EXFAIL common/safety/tst.copyin2.d
|
||||
exclude EXFAIL common/safety/tst.msgdsize.d
|
||||
exclude EXFAIL common/safety/tst.msgsize.d
|
||||
|
@ -21,10 +21,6 @@ CFLAGS+= -DNEED_ERRLOC -g
|
||||
|
||||
#YFLAGS+= -d
|
||||
|
||||
DPADD= ${LIBPTHREAD} ${LIBDTRACE} ${LIBY} ${LIBL} ${LIBPROC} \
|
||||
${LIBCTF} ${LIBELF} ${LIBZ} ${LIBRT} ${LIBUTIL} \
|
||||
${LIBRTLD_DB}
|
||||
LDADD= -lpthread -ldtrace -ly -ll -lproc -lctf -lelf -lz -lrt -lutil \
|
||||
-lrtld_db
|
||||
LIBADD= elf dtrace rt
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
@ -18,9 +18,6 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \
|
||||
-I${.CURDIR}/../../../cddl/lib/libdtrace \
|
||||
-I${.CURDIR}/../../../sys
|
||||
|
||||
DPADD= ${LIBPTHREAD} ${LIBDTRACE} ${LIBY} ${LIBL} ${LIBPROC} ${LIBCTF}\
|
||||
${LIBELF} ${LIBZ} ${LIBRT} ${LIBRTLD_DB} ${LIBUTIL}
|
||||
LDADD= -lpthread -ldtrace -ly -ll -lproc -lctf -lelf -lz -lrt \
|
||||
-lrtld_db -lutil
|
||||
LIBADD= dtrace proc
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
@ -164,18 +164,22 @@ equal_body()
|
||||
grep '^failed: \${x} != \${y} (a != b)$' resfile
|
||||
}
|
||||
|
||||
atf_test_case flush_stdout_on_timeout
|
||||
flush_stdout_on_timeout_body()
|
||||
atf_test_case flush_stdout_on_death
|
||||
flush_stdout_on_death_body()
|
||||
{
|
||||
"$(atf_get_srcdir)/misc_helpers" -s "$(atf_get_srcdir)" atf_check_timeout \
|
||||
>out 2>err &
|
||||
CONTROL_FILE="$(pwd)/done" "$(atf_get_srcdir)/misc_helpers" \
|
||||
-s "$(atf_get_srcdir)" atf_check_flush_stdout >out 2>err &
|
||||
pid="${!}"
|
||||
sleep 1
|
||||
kill "${pid}"
|
||||
while [ ! -f ./done ]; do
|
||||
echo "Still waiting for helper to create control file"
|
||||
ls
|
||||
sleep 1
|
||||
done
|
||||
kill -9 "${pid}"
|
||||
|
||||
grep 'Executing command.*true' out \
|
||||
|| atf_fail 'First command not in output'
|
||||
grep 'Executing command.*sleep 42' out \
|
||||
grep 'Executing command.*false' out \
|
||||
|| atf_fail 'Second command not in output'
|
||||
}
|
||||
|
||||
@ -187,7 +191,7 @@ atf_init_test_cases()
|
||||
atf_add_test_case null_stdout
|
||||
atf_add_test_case null_stderr
|
||||
atf_add_test_case equal
|
||||
atf_add_test_case flush_stdout_on_timeout
|
||||
atf_add_test_case flush_stdout_on_death
|
||||
}
|
||||
|
||||
# vim: syntax=sh:expandtab:shiftwidth=4:softtabstop=4
|
||||
|
@ -139,16 +139,20 @@ atf_check_equal_eval_fail_body()
|
||||
atf_check_equal '${x}' '${y}'
|
||||
}
|
||||
|
||||
atf_test_case atf_check_timeout
|
||||
atf_check_timeout_head()
|
||||
atf_test_case atf_check_flush_stdout
|
||||
atf_check_flush_stdout_head()
|
||||
{
|
||||
atf_set "descr" "Helper test case for the t_atf_check test program"
|
||||
atf_set "timeout" 1
|
||||
atf_set "timeout" "30"
|
||||
}
|
||||
atf_check_timeout_body()
|
||||
atf_check_flush_stdout_body()
|
||||
{
|
||||
atf_check true
|
||||
atf_check sleep 42
|
||||
atf_check -s exit:1 false
|
||||
touch "${CONTROL_FILE:-done}"
|
||||
while :; do
|
||||
sleep 1
|
||||
done
|
||||
}
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
@ -281,7 +285,7 @@ atf_init_test_cases()
|
||||
atf_add_test_case atf_check_equal_fail
|
||||
atf_add_test_case atf_check_equal_eval_ok
|
||||
atf_add_test_case atf_check_equal_eval_fail
|
||||
atf_add_test_case atf_check_timeout
|
||||
atf_add_test_case atf_check_flush_stdout
|
||||
|
||||
# Add helper tests for t_config.
|
||||
atf_add_test_case config_get
|
||||
|
@ -6794,15 +6794,31 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd)
|
||||
out_attr[Tag_ABI_VFP_args].i = in_attr[Tag_ABI_VFP_args].i;
|
||||
else if (in_attr[Tag_ABI_FP_number_model].i != 0)
|
||||
{
|
||||
bfd *hasbfd, *hasnotbfd;
|
||||
|
||||
if (in_attr[Tag_ABI_VFP_args].i)
|
||||
{
|
||||
hasbfd = ibfd;
|
||||
hasnotbfd = obfd;
|
||||
}
|
||||
else
|
||||
{
|
||||
hasbfd = obfd;
|
||||
hasnotbfd = ibfd;
|
||||
}
|
||||
|
||||
_bfd_error_handler
|
||||
(_("ERROR: %B uses VFP register arguments, %B does not"),
|
||||
ibfd, obfd);
|
||||
hasbfd, hasnotbfd);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 4; i < NUM_KNOWN_OBJ_ATTRIBUTES; i++)
|
||||
{
|
||||
if (out_attr[i].type == 0)
|
||||
out_attr[i].type = in_attr[i].type;
|
||||
|
||||
/* Merge this attribute with existing attributes. */
|
||||
switch (i)
|
||||
{
|
||||
@ -9359,6 +9375,16 @@ elf32_arm_post_process_headers (bfd * abfd, struct bfd_link_info * link_info ATT
|
||||
if (globals->byteswap_code)
|
||||
i_ehdrp->e_flags |= EF_ARM_BE8;
|
||||
}
|
||||
|
||||
/*
|
||||
* For EABI 5, we have to tag dynamic binaries and execs as either
|
||||
* soft float or hard float.
|
||||
*/
|
||||
if (EF_ARM_EABI_VERSION (i_ehdrp->e_flags) == EF_ARM_EABI_VER5 &&
|
||||
(i_ehdrp->e_type == ET_DYN || i_ehdrp->e_type == ET_EXEC))
|
||||
i_ehdrp->e_flags |=
|
||||
bfd_elf_get_obj_attr_int (abfd, OBJ_ATTR_PROC, Tag_ABI_VFP_args) ?
|
||||
EF_ARM_VFP_FLOAT : EF_ARM_SOFT_FLOAT;
|
||||
}
|
||||
|
||||
static enum elf_reloc_type_class
|
||||
|
@ -1,3 +1,16 @@
|
||||
2015-05-05 Simon J. Gerraty <sjg@bad.crufty.net>
|
||||
|
||||
* Makefile (MAKE_VERSION): 20150505
|
||||
Merge with NetBSD make, pick up
|
||||
o cond.c: be strict about lhs of comparison when evaluating .if
|
||||
but less so when called from variable expansion.
|
||||
o unit-tests/cond2.mk: test various error conditions
|
||||
|
||||
2015-05-04 Simon J. Gerraty <sjg@bad.crufty.net>
|
||||
|
||||
* machine.sh (MACHINE): Add Bitrig
|
||||
patch from joerg@netbsd.org
|
||||
|
||||
2015-04-18 Simon J. Gerraty <sjg@bad.crufty.net>
|
||||
|
||||
* Makefile (MAKE_VERSION): 20150418
|
||||
|
@ -96,6 +96,8 @@ unit-tests/comment.exp
|
||||
unit-tests/comment.mk
|
||||
unit-tests/cond1.exp
|
||||
unit-tests/cond1.mk
|
||||
unit-tests/cond2.exp
|
||||
unit-tests/cond2.mk
|
||||
unit-tests/doterror.exp
|
||||
unit-tests/doterror.mk
|
||||
unit-tests/dotwait.exp
|
||||
|
@ -1,7 +1,7 @@
|
||||
# $Id: Makefile,v 1.36 2015/04/18 19:58:53 sjg Exp $
|
||||
# $Id: Makefile,v 1.38 2015/05/05 21:58:05 sjg Exp $
|
||||
|
||||
# Base version on src date
|
||||
MAKE_VERSION= 20150418
|
||||
MAKE_VERSION= 20150505
|
||||
|
||||
PROG= bmake
|
||||
|
||||
@ -94,7 +94,7 @@ SUBDIR+= unit-tests
|
||||
# we skip a lot of this when building as part of FreeBSD etc.
|
||||
|
||||
# list of OS's which are derrived from BSD4.4
|
||||
BSD44_LIST= NetBSD FreeBSD OpenBSD DragonFly
|
||||
BSD44_LIST= NetBSD FreeBSD OpenBSD DragonFly MirBSD Bitrig
|
||||
# we are...
|
||||
OS!= uname -s
|
||||
# are we 4.4BSD ?
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: cond.c,v 1.67 2012/11/03 13:59:27 christos Exp $ */
|
||||
/* $NetBSD: cond.c,v 1.68 2015/05/05 21:51:09 sjg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
|
||||
@ -70,14 +70,14 @@
|
||||
*/
|
||||
|
||||
#ifndef MAKE_NATIVE
|
||||
static char rcsid[] = "$NetBSD: cond.c,v 1.67 2012/11/03 13:59:27 christos Exp $";
|
||||
static char rcsid[] = "$NetBSD: cond.c,v 1.68 2015/05/05 21:51:09 sjg Exp $";
|
||||
#else
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)cond.c 8.2 (Berkeley) 1/2/94";
|
||||
#else
|
||||
__RCSID("$NetBSD: cond.c,v 1.67 2012/11/03 13:59:27 christos Exp $");
|
||||
__RCSID("$NetBSD: cond.c,v 1.68 2015/05/05 21:51:09 sjg Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
#endif
|
||||
@ -181,6 +181,15 @@ static Token condPushBack=TOK_NONE; /* Single push-back token used in
|
||||
static unsigned int cond_depth = 0; /* current .if nesting level */
|
||||
static unsigned int cond_min_depth = 0; /* depth at makefile open */
|
||||
|
||||
/*
|
||||
* Indicate when we should be strict about lhs of comparisons.
|
||||
* TRUE when Cond_EvalExpression is called from Cond_Eval (.if etc)
|
||||
* FALSE when Cond_EvalExpression is called from var.c:ApplyModifiers
|
||||
* since lhs is already expanded and we cannot tell if
|
||||
* it was a variable reference or not.
|
||||
*/
|
||||
static Boolean lhsStrict;
|
||||
|
||||
static int
|
||||
istoken(const char *str, const char *tok, size_t len)
|
||||
{
|
||||
@ -517,7 +526,7 @@ CondCvtArg(char *str, double *value)
|
||||
*/
|
||||
/* coverity:[+alloc : arg-*2] */
|
||||
static char *
|
||||
CondGetString(Boolean doEval, Boolean *quoted, void **freeIt)
|
||||
CondGetString(Boolean doEval, Boolean *quoted, void **freeIt, Boolean strictLHS)
|
||||
{
|
||||
Buffer buf;
|
||||
char *cp;
|
||||
@ -601,6 +610,16 @@ CondGetString(Boolean doEval, Boolean *quoted, void **freeIt)
|
||||
condExpr--; /* don't skip over next char */
|
||||
break;
|
||||
default:
|
||||
if (strictLHS && !qt && *start != '$' &&
|
||||
!isdigit((unsigned char) *start)) {
|
||||
/* lhs must be quoted, a variable reference or number */
|
||||
if (*freeIt) {
|
||||
free(*freeIt);
|
||||
*freeIt = NULL;
|
||||
}
|
||||
str = NULL;
|
||||
goto cleanup;
|
||||
}
|
||||
Buf_AddByte(&buf, *condExpr);
|
||||
break;
|
||||
}
|
||||
@ -648,7 +667,7 @@ compare_expression(Boolean doEval)
|
||||
* Parse the variable spec and skip over it, saving its
|
||||
* value in lhs.
|
||||
*/
|
||||
lhs = CondGetString(doEval, &lhsQuoted, &lhsFree);
|
||||
lhs = CondGetString(doEval, &lhsQuoted, &lhsFree, lhsStrict);
|
||||
if (!lhs)
|
||||
goto done;
|
||||
|
||||
@ -709,7 +728,7 @@ compare_expression(Boolean doEval)
|
||||
goto done;
|
||||
}
|
||||
|
||||
rhs = CondGetString(doEval, &rhsQuoted, &rhsFree);
|
||||
rhs = CondGetString(doEval, &rhsQuoted, &rhsFree, FALSE);
|
||||
if (!rhs)
|
||||
goto done;
|
||||
|
||||
@ -1135,7 +1154,7 @@ CondE(Boolean doEval)
|
||||
*-----------------------------------------------------------------------
|
||||
*/
|
||||
int
|
||||
Cond_EvalExpression(const struct If *info, char *line, Boolean *value, int eprint)
|
||||
Cond_EvalExpression(const struct If *info, char *line, Boolean *value, int eprint, Boolean strictLHS)
|
||||
{
|
||||
static const struct If *dflt_info;
|
||||
const struct If *sv_if_info = if_info;
|
||||
@ -1143,6 +1162,8 @@ Cond_EvalExpression(const struct If *info, char *line, Boolean *value, int eprin
|
||||
Token sv_condPushBack = condPushBack;
|
||||
int rval;
|
||||
|
||||
lhsStrict = strictLHS;
|
||||
|
||||
while (*line == ' ' || *line == '\t')
|
||||
line++;
|
||||
|
||||
@ -1359,7 +1380,7 @@ Cond_Eval(char *line)
|
||||
}
|
||||
|
||||
/* And evaluate the conditional expresssion */
|
||||
if (Cond_EvalExpression(ifp, line, &value, 1) == COND_INVALID) {
|
||||
if (Cond_EvalExpression(ifp, line, &value, 1, TRUE) == COND_INVALID) {
|
||||
/* Syntax error in conditional, error message already output. */
|
||||
/* Skip everything to matching .endif */
|
||||
cond_state[cond_depth] = SKIP_TO_ELSE;
|
||||
|
@ -2,7 +2,7 @@
|
||||
# derrived from /etc/rc_d/os.sh
|
||||
|
||||
# RCSid:
|
||||
# $Id: machine.sh,v 1.16 2010/10/17 00:05:51 sjg Exp $
|
||||
# $Id: machine.sh,v 1.17 2015/05/05 00:10:54 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 1994-2002 Simon J. Gerraty
|
||||
#
|
||||
@ -49,6 +49,10 @@ OpenBSD)
|
||||
arch=`Which arch /usr/bin:/usr/ucb:$PATH`
|
||||
MACHINE_ARCH=`$arch -s`;
|
||||
;;
|
||||
Bitrig)
|
||||
MACHINE=$OS$OSMAJOR.$machine
|
||||
MACHINE_ARCH=`uname -m`;
|
||||
;;
|
||||
*BSD)
|
||||
MACHINE=$OS$OSMAJOR.$machine
|
||||
;;
|
||||
|
@ -1,3 +1,9 @@
|
||||
2015-04-30 Simon J. Gerraty <sjg@bad.crufty.net>
|
||||
|
||||
* install-mk (MK_VERSION): 20150430
|
||||
|
||||
* dirdeps.mk: fix _count_dirdeps for non-cache case.
|
||||
|
||||
2015-04-16 Simon J. Gerraty <sjg@bad.crufty.net>
|
||||
|
||||
* install-mk (MK_VERSION): 20150411
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $Id: dirdeps.mk,v 1.49 2015/03/11 21:39:28 sjg Exp $
|
||||
# $Id: dirdeps.mk,v 1.51 2015/05/06 06:07:30 sjg Exp $
|
||||
|
||||
# Copyright (c) 2010-2013, Juniper Networks, Inc.
|
||||
# All rights reserved.
|
||||
@ -349,7 +349,7 @@ BUILD_DIRDEPS ?= yes
|
||||
.if !defined(NO_DIRDEPS)
|
||||
.if ${MK_DIRDEPS_CACHE} == "yes"
|
||||
# this is where we will cache all our work
|
||||
DIRDEPS_CACHE?= ${_OBJDIR}/dirdeps.cache${.TARGETS:Nall:O:u:ts-:S,^,.,:N.}
|
||||
DIRDEPS_CACHE?= ${_OBJDIR}/dirdeps.cache${.TARGETS:Nall:O:u:ts-:S,/,_,g:S,^,.,:N.}
|
||||
|
||||
# just ensure this exists
|
||||
build-dirdeps:
|
||||
@ -394,13 +394,14 @@ _count_dirdeps: .NOMETA
|
||||
@echo '.info $${.newline}$${TRACER}Makefiles read: total=${.MAKE.MAKEFILES:[#]} depend=${.MAKE.MAKEFILES:M*depend*:[#]} dirdeps=${.ALLTARGETS:M${SRCTOP}*:O:u:[#]}' >&3
|
||||
|
||||
.endif
|
||||
.endif
|
||||
.elif !target(_count_dirdeps)
|
||||
.elif !make(dirdeps) && !target(_count_dirdeps)
|
||||
beforedirdeps: _count_dirdeps
|
||||
_count_dirdeps: .NOMETA
|
||||
@echo "${TRACER}Makefiles read: total=${.MAKE.MAKEFILES:[#]} depend=${.MAKE.MAKEFILES:M*depend*:[#]} dirdeps=${.ALLTARGETS:M${SRCTOP}*:O:u:[#]} seconds=`expr ${now_utc} - ${start_utc}`"
|
||||
|
||||
.endif
|
||||
.endif
|
||||
|
||||
.if ${BUILD_DIRDEPS} == "yes"
|
||||
.if ${DEBUG_DIRDEPS:@x@${DEP_RELDIR:M$x}${${DEP_RELDIR}.${DEP_MACHINE}:L:M$x}@} != ""
|
||||
_debug_reldir = 1
|
||||
|
@ -55,7 +55,7 @@
|
||||
# Simon J. Gerraty <sjg@crufty.net>
|
||||
|
||||
# RCSid:
|
||||
# $Id: install-mk,v 1.109 2015/04/16 16:59:00 sjg Exp $
|
||||
# $Id: install-mk,v 1.110 2015/05/01 06:37:49 sjg Exp $
|
||||
#
|
||||
# @(#) Copyright (c) 1994 Simon J. Gerraty
|
||||
#
|
||||
@ -70,7 +70,7 @@
|
||||
# sjg@crufty.net
|
||||
#
|
||||
|
||||
MK_VERSION=20150411
|
||||
MK_VERSION=20150430
|
||||
OWNER=
|
||||
GROUP=
|
||||
MODE=444
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: nonints.h,v 1.67 2014/09/07 20:55:34 joerg Exp $ */
|
||||
/* $NetBSD: nonints.h,v 1.68 2015/05/05 21:51:09 sjg Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1988, 1989, 1990, 1993
|
||||
@ -91,7 +91,7 @@ int Compat_Make(void *, void *);
|
||||
|
||||
/* cond.c */
|
||||
struct If;
|
||||
int Cond_EvalExpression(const struct If *, char *, Boolean *, int);
|
||||
int Cond_EvalExpression(const struct If *, char *, Boolean *, int, Boolean);
|
||||
int Cond_Eval(char *);
|
||||
void Cond_restore_depth(unsigned int);
|
||||
unsigned int Cond_save_depth(void);
|
||||
|
@ -1,6 +1,6 @@
|
||||
# $Id: Makefile.in,v 1.46 2014/11/06 01:47:57 sjg Exp $
|
||||
# $Id: Makefile.in,v 1.47 2015/05/05 21:58:06 sjg Exp $
|
||||
#
|
||||
# $NetBSD: Makefile,v 1.51 2014/10/20 23:21:11 sjg Exp $
|
||||
# $NetBSD: Makefile,v 1.52 2015/05/05 21:51:09 sjg Exp $
|
||||
#
|
||||
# Unit tests for make(1)
|
||||
# The main targets are:
|
||||
@ -27,6 +27,7 @@ UNIT_TESTS:= ${srcdir}
|
||||
TESTNAMES= \
|
||||
comment \
|
||||
cond1 \
|
||||
cond2 \
|
||||
error \
|
||||
export \
|
||||
export-all \
|
||||
|
7
contrib/bmake/unit-tests/cond2.exp
Normal file
7
contrib/bmake/unit-tests/cond2.exp
Normal file
@ -0,0 +1,7 @@
|
||||
make: Bad conditional expression ` == "empty"' in == "empty"?oops:ok
|
||||
make: "cond2.mk" line 13: Malformed conditional ({TEST_TYPO} == "Ok")
|
||||
TEST_NOT_SET is empty or not defined
|
||||
make: "cond2.mk" line 20: Malformed conditional (${TEST_NOT_SET} == "empty")
|
||||
make: Fatal errors encountered -- cannot continue
|
||||
make: stopped in unit-tests
|
||||
exit status 1
|
25
contrib/bmake/unit-tests/cond2.mk
Normal file
25
contrib/bmake/unit-tests/cond2.mk
Normal file
@ -0,0 +1,25 @@
|
||||
# $Id: cond2.mk,v 1.1.1.1 2015/05/05 21:53:13 sjg Exp $
|
||||
|
||||
TEST_UNAME_S= NetBSD
|
||||
|
||||
# this should be ok
|
||||
X:= ${${TEST_UNAME_S} == "NetBSD":?Ok:fail}
|
||||
.if $X == "Ok"
|
||||
Y= good
|
||||
.endif
|
||||
# expect: Bad conditional expression ` == "empty"' in == "empty"?oops:ok
|
||||
X:= ${${TEST_NOT_SET} == "empty":?oops:ok}
|
||||
# expect: Malformed conditional ({TEST_TYPO} == "Ok")
|
||||
.if {TEST_TYPO} == "Ok"
|
||||
Y= oops
|
||||
.endif
|
||||
.if empty(TEST_NOT_SET)
|
||||
Y!= echo TEST_NOT_SET is empty or not defined >&2; echo
|
||||
.endif
|
||||
# expect: Malformed conditional (${TEST_NOT_SET} == "empty")
|
||||
.if ${TEST_NOT_SET} == "empty"
|
||||
Y= oops
|
||||
.endif
|
||||
|
||||
all:
|
||||
@echo $@
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: var.c,v 1.191 2014/09/14 02:32:51 dholland Exp $ */
|
||||
/* $NetBSD: var.c,v 1.192 2015/05/05 21:51:09 sjg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988, 1989, 1990, 1993
|
||||
@ -69,14 +69,14 @@
|
||||
*/
|
||||
|
||||
#ifndef MAKE_NATIVE
|
||||
static char rcsid[] = "$NetBSD: var.c,v 1.191 2014/09/14 02:32:51 dholland Exp $";
|
||||
static char rcsid[] = "$NetBSD: var.c,v 1.192 2015/05/05 21:51:09 sjg Exp $";
|
||||
#else
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94";
|
||||
#else
|
||||
__RCSID("$NetBSD: var.c,v 1.191 2014/09/14 02:32:51 dholland Exp $");
|
||||
__RCSID("$NetBSD: var.c,v 1.192 2015/05/05 21:51:09 sjg Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
#endif
|
||||
@ -3261,7 +3261,7 @@ ApplyModifiers(char *nstr, const char *tstr,
|
||||
|
||||
termc = *--cp;
|
||||
delim = '\0';
|
||||
if (Cond_EvalExpression(NULL, v->name, &value, 0)
|
||||
if (Cond_EvalExpression(NULL, v->name, &value, 0, FALSE)
|
||||
== COND_INVALID) {
|
||||
Error("Bad conditional expression `%s' in %s?%s:%s",
|
||||
v->name, v->name, pattern.lhs, pattern.rhs);
|
||||
|
@ -22,7 +22,7 @@
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id: addr2line.1 2066 2011-10-26 15:40:28Z jkoshy $
|
||||
.\" $Id: addr2line.1 3195 2015-05-12 17:22:19Z emaste $
|
||||
.\"
|
||||
.Dd July 25, 2010
|
||||
.Os
|
||||
@ -99,7 +99,7 @@ Print a help message.
|
||||
Print a version identifier and exit.
|
||||
.El
|
||||
.Sh OUTPUT FORMAT
|
||||
If the
|
||||
If the
|
||||
.Fl f
|
||||
option was not specified,
|
||||
.Nm
|
||||
@ -156,4 +156,4 @@ its source file and line number use:
|
||||
The
|
||||
.Nm
|
||||
utility was written by
|
||||
.An "Kai Wang" Aq kaiwang27@users.sourceforge.net .
|
||||
.An Kai Wang Aq Mt kaiwang27@users.sourceforge.net .
|
||||
|
@ -39,7 +39,7 @@
|
||||
|
||||
#include "_elftc.h"
|
||||
|
||||
ELFTC_VCSID("$Id: addr2line.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||
ELFTC_VCSID("$Id: addr2line.c 3197 2015-05-12 21:01:31Z emaste $");
|
||||
|
||||
static struct option longopts[] = {
|
||||
{"target" , required_argument, NULL, 'b'},
|
||||
@ -84,6 +84,44 @@ version(void)
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Handle DWARF 4 'offset from' DW_AT_high_pc. Although we don't
|
||||
* fully support DWARF 4, some compilers (like FreeBSD Clang 3.5.1)
|
||||
* generate DW_AT_high_pc as an offset from DW_AT_low_pc.
|
||||
*
|
||||
* "If the value of the DW_AT_high_pc is of class address, it is the
|
||||
* relocated address of the first location past the last instruction
|
||||
* associated with the entity; if it is of class constant, the value
|
||||
* is an unsigned integer offset which when added to the low PC gives
|
||||
* the address of the first location past the last instruction
|
||||
* associated with the entity."
|
||||
*
|
||||
* DWARF4 spec, section 2.17.2.
|
||||
*/
|
||||
static int
|
||||
handle_high_pc(Dwarf_Die die, Dwarf_Unsigned lopc, Dwarf_Unsigned *hipc)
|
||||
{
|
||||
Dwarf_Error de;
|
||||
Dwarf_Half form;
|
||||
Dwarf_Attribute at;
|
||||
int ret;
|
||||
|
||||
ret = dwarf_attr(die, DW_AT_high_pc, &at, &de);
|
||||
if (ret == DW_DLV_ERROR) {
|
||||
warnx("dwarf_attr failed: %s", dwarf_errmsg(de));
|
||||
return (ret);
|
||||
}
|
||||
ret = dwarf_whatform(at, &form, &de);
|
||||
if (ret == DW_DLV_ERROR) {
|
||||
warnx("dwarf_whatform failed: %s", dwarf_errmsg(de));
|
||||
return (ret);
|
||||
}
|
||||
if (dwarf_get_form_class(2, 0, 0, form) == DW_FORM_CLASS_CONSTANT)
|
||||
*hipc += lopc;
|
||||
|
||||
return (DW_DLV_OK);
|
||||
}
|
||||
|
||||
static void
|
||||
search_func(Dwarf_Debug dbg, Dwarf_Die die, Dwarf_Addr addr,
|
||||
const char **rlt_func)
|
||||
@ -108,6 +146,8 @@ search_func(Dwarf_Debug dbg, Dwarf_Die die, Dwarf_Addr addr,
|
||||
if (dwarf_attrval_unsigned(die, DW_AT_low_pc, &lopc, &de) ||
|
||||
dwarf_attrval_unsigned(die, DW_AT_high_pc, &hipc, &de))
|
||||
goto cont_search;
|
||||
if (handle_high_pc(die, lopc, &hipc) != DW_DLV_OK)
|
||||
goto cont_search;
|
||||
if (addr < lopc || addr >= hipc)
|
||||
goto cont_search;
|
||||
|
||||
@ -202,6 +242,8 @@ translate(Dwarf_Debug dbg, const char* addrstr)
|
||||
* Check if the address falls into the PC range of
|
||||
* this CU.
|
||||
*/
|
||||
if (handle_high_pc(die, lopc, &hipc) != DW_DLV_OK)
|
||||
continue;
|
||||
if (addr < lopc || addr >= hipc)
|
||||
continue;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# $Id: native-elf-format 3167 2015-02-24 19:10:08Z emaste $
|
||||
# $Id: native-elf-format 3186 2015-04-16 22:16:40Z emaste $
|
||||
#
|
||||
# Find the native ELF format for a host platform by compiling a
|
||||
# test object and examining the resulting object.
|
||||
@ -33,7 +33,7 @@ $1 ~ "Data:" {
|
||||
$1 ~ "Machine:" {
|
||||
if (match($0, "Intel.*386")) {
|
||||
elfarch = "EM_386";
|
||||
} else if (match($0, ".*X86-64")) {
|
||||
} else if (match($0, ".*[xX]86-64")) {
|
||||
elfarch = "EM_X86_64";
|
||||
} else {
|
||||
elfarch = "unknown";
|
||||
|
@ -22,7 +22,7 @@
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id: c++filt.1 2175 2011-11-16 05:51:49Z jkoshy $
|
||||
.\" $Id: c++filt.1 3195 2015-05-12 17:22:19Z emaste $
|
||||
.\"
|
||||
.Dd August 24, 2011
|
||||
.Os
|
||||
@ -106,4 +106,4 @@ and exit.
|
||||
The
|
||||
.Nm
|
||||
utility was written by
|
||||
.An "Kai Wang" Aq kaiwang27@users.sourceforge.net .
|
||||
.An Kai Wang Aq Mt kaiwang27@users.sourceforge.net .
|
||||
|
@ -21,7 +21,7 @@
|
||||
.\" out of the use of this software, even if advised of the possibility of
|
||||
.\" such damage.
|
||||
.\"
|
||||
.\" $Id: elfcopy.1 3173 2015-03-27 16:46:13Z emaste $
|
||||
.\" $Id: elfcopy.1 3195 2015-05-12 17:22:19Z emaste $
|
||||
.\"
|
||||
.Dd March 27, 2015
|
||||
.Os
|
||||
@ -330,4 +330,4 @@ Do not copy symbols that are not needed for relocation processing.
|
||||
.Sh HISTORY
|
||||
.Nm
|
||||
has been implemented by
|
||||
.An "Kai Wang" Aq kaiwang27@users.sourceforge.net .
|
||||
.An Kai Wang Aq Mt kaiwang27@users.sourceforge.net .
|
||||
|
@ -34,7 +34,7 @@
|
||||
|
||||
#include "elfcopy.h"
|
||||
|
||||
ELFTC_VCSID("$Id: sections.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||
ELFTC_VCSID("$Id: sections.c 3185 2015-04-11 08:56:34Z kaiwang27 $");
|
||||
|
||||
static void add_gnu_debuglink(struct elfcopy *ecp);
|
||||
static uint32_t calc_crc32(const char *p, size_t len, uint32_t crc);
|
||||
@ -1223,6 +1223,14 @@ update_shdr(struct elfcopy *ecp, int update_link)
|
||||
osh.sh_info != 0)
|
||||
osh.sh_info = ecp->secndx[osh.sh_info];
|
||||
|
||||
/*
|
||||
* sh_info of SHT_GROUP section needs to point to the correct
|
||||
* string in the symbol table.
|
||||
*/
|
||||
if (s->type == SHT_GROUP && (ecp->flags & SYMTAB_EXIST) &&
|
||||
(ecp->flags & SYMTAB_INTACT) == 0)
|
||||
osh.sh_info = ecp->symndx[osh.sh_info];
|
||||
|
||||
if (!gelf_update_shdr(s->os, &osh))
|
||||
errx(EXIT_FAILURE, "gelf_update_shdr() failed: %s",
|
||||
elf_errmsg(-1));
|
||||
|
@ -34,7 +34,7 @@
|
||||
|
||||
#include "elfcopy.h"
|
||||
|
||||
ELFTC_VCSID("$Id: segments.c 3177 2015-03-30 18:19:41Z emaste $");
|
||||
ELFTC_VCSID("$Id: segments.c 3196 2015-05-12 17:33:48Z emaste $");
|
||||
|
||||
static void insert_to_inseg_list(struct segment *seg, struct section *sec);
|
||||
|
||||
@ -442,7 +442,7 @@ copy_phdr(struct elfcopy *ecp)
|
||||
s = seg->v_sec[i];
|
||||
seg->msz = s->vma + s->sz - seg->addr;
|
||||
if (s->type != SHT_NOBITS)
|
||||
seg->fsz = seg->msz;
|
||||
seg->fsz = s->off + s->sz - seg->off;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#include "elfcopy.h"
|
||||
|
||||
ELFTC_VCSID("$Id: symbols.c 3174 2015-03-27 17:13:41Z emaste $");
|
||||
ELFTC_VCSID("$Id: symbols.c 3191 2015-05-04 17:07:01Z jkoshy $");
|
||||
|
||||
/* Symbol table buffer structure. */
|
||||
struct symbuf {
|
||||
@ -1090,7 +1090,7 @@ str_hash(const char *s)
|
||||
{
|
||||
uint32_t hash;
|
||||
|
||||
for (hash = 2166136261; *s; s++)
|
||||
for (hash = 2166136261UL; *s; s++)
|
||||
hash = (hash ^ *s) * 16777619;
|
||||
|
||||
return (hash & (STHASHSIZE - 1));
|
||||
|
@ -21,7 +21,7 @@
|
||||
.\" out of the use of this software, even if advised of the possibility of
|
||||
.\" such damage.
|
||||
.\"
|
||||
.\" $Id: dwarf.3 3130 2014-12-21 20:06:29Z jkoshy $
|
||||
.\" $Id: dwarf.3 3195 2015-05-12 17:22:19Z emaste $
|
||||
.\"
|
||||
.Dd December 21, 2014
|
||||
.Os
|
||||
@ -44,7 +44,7 @@ is defined by the DWARF standard, see
|
||||
.Xr dwarf 4 .
|
||||
.Pp
|
||||
The
|
||||
.Xr DWARF 3
|
||||
.Xr DWARF 3
|
||||
API has two parts:
|
||||
.Bl -bullet
|
||||
.It
|
||||
@ -349,7 +349,7 @@ Retrieve a debugging information entry given an offset.
|
||||
.It Fn dwarf_siblingof , Fn dwarf_siblingof_b
|
||||
Retrieve the sibling descriptor for a debugging information entry.
|
||||
.It Fn dwarf_srclang
|
||||
Retrive the source language attribute for a debugging information
|
||||
Retrieve the source language attribute for a debugging information
|
||||
entry.
|
||||
.It Fn dwarf_tag
|
||||
Retrieve the tag for a debugging information entry.
|
||||
@ -742,12 +742,12 @@ The DWARF standard is defined by
|
||||
The DWARF(3) API originated at Silicon Graphics Inc.
|
||||
.Pp
|
||||
A BSD-licensed implementation of a subset of the API was written by
|
||||
.An "John Birrell" Aq jb@FreeBSD.org
|
||||
.An John Birrell Aq Mt jb@FreeBSD.org
|
||||
for the FreeBSD project.
|
||||
The implementation was subsequently revised and completed by
|
||||
.An "Kai Wang" Aq kaiwang27@users.sourceforge.net .
|
||||
.An Kai Wang Aq Mt kaiwang27@users.sourceforge.net .
|
||||
.Pp
|
||||
Manual pages for this implementation were written by
|
||||
.An "Joseph Koshy" Aq jkoshy@users.sourceforge.net
|
||||
.An Joseph Koshy Aq Mt jkoshy@users.sourceforge.net
|
||||
and
|
||||
.An "Kai Wang" Aq kaiwang27@users.sourceforge.net .
|
||||
.An Kai Wang Aq Mt kaiwang27@users.sourceforge.net .
|
||||
|
@ -22,7 +22,7 @@
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id: dwarf_add_line_entry.3 2953 2013-06-30 20:21:38Z kaiwang27 $
|
||||
.\" $Id: dwarf_add_line_entry.3 3182 2015-04-10 16:08:10Z emaste $
|
||||
.\"
|
||||
.Dd June 30, 2013
|
||||
.Os
|
||||
@ -66,7 +66,8 @@ Valid source file indices are those returned by the function
|
||||
.Pp
|
||||
Argument
|
||||
.Ar off
|
||||
specifies a relocatable program address. The ELF symbol to be used
|
||||
specifies a relocatable program address.
|
||||
The ELF symbol to be used
|
||||
for relocation is set by a prior call to the function
|
||||
.Xr dwarf_lne_set_address 3 .
|
||||
.Pp
|
||||
|
@ -22,7 +22,7 @@
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id: dwarf_def_macro.3 2122 2011-11-09 15:35:14Z jkoshy $
|
||||
.\" $Id: dwarf_def_macro.3 3182 2015-04-10 16:08:10Z emaste $
|
||||
.\"
|
||||
.Dd November 9, 2011
|
||||
.Os
|
||||
@ -72,7 +72,7 @@ Argument
|
||||
.Ar value
|
||||
should point to a NUL-terminated string containing the value
|
||||
of the macro.
|
||||
If the macro doesn't have a value, argument
|
||||
If the macro does not have a value, argument
|
||||
.Ar value
|
||||
should be set to NULL.
|
||||
.Pp
|
||||
|
@ -22,14 +22,14 @@
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id: dwarf_expand_frame_instructions.3 2122 2011-11-09 15:35:14Z jkoshy $
|
||||
.\" $Id: dwarf_expand_frame_instructions.3 3181 2015-04-10 13:22:51Z emaste $
|
||||
.\"
|
||||
.Dd November 9, 2011
|
||||
.Os
|
||||
.Dt DWARF_EXPAND_FRAME_INSTRUCTIONS 3
|
||||
.Sh NAME
|
||||
.Nm dwarf_expand_frame_instructions
|
||||
.Nd expand frame instructions
|
||||
.Nd expand frame instructions
|
||||
.Sh LIBRARY
|
||||
.Lb libdwarf
|
||||
.Sh SYNOPSIS
|
||||
|
@ -22,7 +22,7 @@
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id: dwarf_formblock.3 2073 2011-10-27 03:30:47Z jkoshy $
|
||||
.\" $Id: dwarf_formblock.3 3182 2015-04-10 16:08:10Z emaste $
|
||||
.\"
|
||||
.Dd July 23, 2010
|
||||
.Os
|
||||
@ -69,7 +69,7 @@ the DWARF(3) library.
|
||||
The application should not attempt to free this memory
|
||||
area.
|
||||
Portable code may indicate that the memory area is to be freed by
|
||||
by using
|
||||
using
|
||||
.Xr dwarf_dealloc 3 .
|
||||
.Sh RETURN VALUES
|
||||
Function
|
||||
|
@ -22,7 +22,7 @@
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id: dwarf_formflag.3 2073 2011-10-27 03:30:47Z jkoshy $
|
||||
.\" $Id: dwarf_formflag.3 3181 2015-04-10 13:22:51Z emaste $
|
||||
.\"
|
||||
.Dd June 21, 2010
|
||||
.Os
|
||||
@ -58,7 +58,7 @@ or
|
||||
If argument
|
||||
.Ar err
|
||||
is not NULL, it will be used to return an error descriptor in case
|
||||
of an error.
|
||||
of an error.
|
||||
.Sh RETURN VALUES
|
||||
Function
|
||||
.Fn dwarf_formflag
|
||||
|
@ -22,7 +22,7 @@
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id: dwarf_formref.3 2073 2011-10-27 03:30:47Z jkoshy $
|
||||
.\" $Id: dwarf_formref.3 3181 2015-04-10 13:22:51Z emaste $
|
||||
.\"
|
||||
.Dd June 21, 2010
|
||||
.Os
|
||||
@ -101,7 +101,7 @@ ELF section.
|
||||
If argument
|
||||
.Ar err
|
||||
is not NULL, it will be used to return an error descriptor in case
|
||||
of an error.
|
||||
of an error.
|
||||
.Sh RETURN VALUES
|
||||
These functions return
|
||||
.Dv DW_DLV_OK
|
||||
|
@ -22,7 +22,7 @@
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id: dwarf_formsig8.3 2073 2011-10-27 03:30:47Z jkoshy $
|
||||
.\" $Id: dwarf_formsig8.3 3181 2015-04-10 13:22:51Z emaste $
|
||||
.\"
|
||||
.Dd July 24, 2010
|
||||
.Os
|
||||
@ -56,7 +56,7 @@ must be
|
||||
If argument
|
||||
.Ar err
|
||||
is not NULL, it will be used to return an error descriptor in case
|
||||
of an error.
|
||||
of an error.
|
||||
.Sh RETURN VALUES
|
||||
Function
|
||||
.Fn dwarf_formsig8
|
||||
|
@ -22,7 +22,7 @@
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id: dwarf_formudata.3 2073 2011-10-27 03:30:47Z jkoshy $
|
||||
.\" $Id: dwarf_formudata.3 3181 2015-04-10 13:22:51Z emaste $
|
||||
.\"
|
||||
.Dd June 21, 2010
|
||||
.Os
|
||||
@ -88,7 +88,7 @@ and
|
||||
If argument
|
||||
.Ar err
|
||||
is not NULL, it will be used to return an error descriptor in case
|
||||
of an error.
|
||||
of an error.
|
||||
.Sh RETURN VALUES
|
||||
These functions return
|
||||
.Dv DW_DLV_OK
|
||||
|
@ -22,7 +22,7 @@
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id: dwarf_get_fde_info_for_all_regs.3 2071 2011-10-27 03:20:00Z jkoshy $
|
||||
.\" $Id: dwarf_get_fde_info_for_all_regs.3 3182 2015-04-10 16:08:10Z emaste $
|
||||
.\"
|
||||
.Dd June 4, 2011
|
||||
.Os
|
||||
@ -90,7 +90,8 @@ typedef struct {
|
||||
For each of the register rules returned,
|
||||
the
|
||||
.Va dw_offset_relevant
|
||||
field is set to 1 if the register rule has a offset value. The
|
||||
field is set to 1 if the register rule has a offset value.
|
||||
The
|
||||
.Va dw_regnum
|
||||
field is set to the register number associated with the regsiter rule.
|
||||
The
|
||||
|
@ -22,7 +22,7 @@
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id: dwarf_get_fde_info_for_reg.3 2071 2011-10-27 03:20:00Z jkoshy $
|
||||
.\" $Id: dwarf_get_fde_info_for_reg.3 3181 2015-04-10 13:22:51Z emaste $
|
||||
.\"
|
||||
.Dd June 4, 2011
|
||||
.Os
|
||||
@ -99,7 +99,7 @@ counter address associated with the register rule found.
|
||||
If argument
|
||||
.Ar err
|
||||
is not NULL, it will be used to return an error descriptor in case
|
||||
of an error.
|
||||
of an error.
|
||||
.Ss COMPATIBILITY
|
||||
Function
|
||||
.Fn dwarf_get_fde_info_for_reg
|
||||
|
@ -22,7 +22,7 @@
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id: dwarf_get_ranges.3 2122 2011-11-09 15:35:14Z jkoshy $
|
||||
.\" $Id: dwarf_get_ranges.3 3182 2015-04-10 16:08:10Z emaste $
|
||||
.\"
|
||||
.Dd November 9, 2011
|
||||
.Os
|
||||
@ -137,7 +137,7 @@ For this type of entry, the field
|
||||
.Va dwr_addr1
|
||||
is the value of the largest representable address offset, and
|
||||
.Va dwr_addr2
|
||||
is a base address for the begining and ending address offsets of
|
||||
is a base address for the beginning and ending address offsets of
|
||||
subsequent address range entries in the list.
|
||||
.It Dv DW_RANGES_END
|
||||
An end of list mark.
|
||||
|
@ -22,7 +22,7 @@
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id: dwarf_hasattr.3 3142 2015-01-29 23:11:14Z jkoshy $
|
||||
.\" $Id: dwarf_hasattr.3 3181 2015-04-10 13:22:51Z emaste $
|
||||
.\"
|
||||
.Dd April 17, 2010
|
||||
.Os
|
||||
@ -64,7 +64,7 @@ If the named attribute is not present, a zero is written instead.
|
||||
If argument
|
||||
.Ar err
|
||||
is not NULL, it will be used to return an error descriptor in case
|
||||
of an error.
|
||||
of an error.
|
||||
.Sh RETURN VALUES
|
||||
On success, function
|
||||
.Fn dwarf_hasattr
|
||||
|
@ -22,7 +22,7 @@
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id: dwarf_next_cu_header.3 3128 2014-12-21 20:06:22Z jkoshy $
|
||||
.\" $Id: dwarf_next_cu_header.3 3182 2015-04-10 16:08:10Z emaste $
|
||||
.\"
|
||||
.Dd December 21, 2014
|
||||
.Os
|
||||
@ -220,8 +220,7 @@ unit in the section.
|
||||
.Ss Iterating Through Type Units in a Debug Context
|
||||
When a DWARF debug context is allocated using
|
||||
.Xr dwarf_init 3 ,
|
||||
an internal pointer assoicated with the context will point to the
|
||||
fisrt
|
||||
an internal pointer associated with the context will point to the first
|
||||
.Dq \&.debug_types
|
||||
section found in the debug object.
|
||||
The first call to function
|
||||
|
@ -22,7 +22,7 @@
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id: dwarf_producer_init.3 2074 2011-10-27 03:34:33Z jkoshy $
|
||||
.\" $Id: dwarf_producer_init.3 3182 2015-04-10 16:08:10Z emaste $
|
||||
.\"
|
||||
.Dd August 20, 2011
|
||||
.Os
|
||||
@ -58,7 +58,7 @@ descriptor representing a DWARF producer instance.
|
||||
.Pp
|
||||
The argument
|
||||
.Ar errhand
|
||||
should contain the adddress of a function to be called in case of an
|
||||
should contain the address of a function to be called in case of an
|
||||
error.
|
||||
If this argument is
|
||||
.Dv NULL ,
|
||||
|
@ -22,7 +22,7 @@
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id: dwarf_whatattr.3 3142 2015-01-29 23:11:14Z jkoshy $
|
||||
.\" $Id: dwarf_whatattr.3 3181 2015-04-10 13:22:51Z emaste $
|
||||
.\"
|
||||
.Dd May 22, 2010
|
||||
.Os
|
||||
@ -51,7 +51,7 @@ and writes it to the location pointed to by argument
|
||||
If argument
|
||||
.Ar err
|
||||
is not NULL, it will be used to return an error descriptor in case
|
||||
of an error.
|
||||
of an error.
|
||||
.Sh RETURN VALUES
|
||||
On success, function
|
||||
.Fn dwarf_whatattr
|
||||
|
@ -21,7 +21,7 @@
|
||||
.\" out of the use of this software, even if advised of the possibility of
|
||||
.\" such damage.
|
||||
.\"
|
||||
.\" $Id: elf.3 3142 2015-01-29 23:11:14Z jkoshy $
|
||||
.\" $Id: elf.3 3195 2015-05-12 17:22:19Z emaste $
|
||||
.\"
|
||||
.Dd July 28, 2014
|
||||
.Os
|
||||
@ -555,7 +555,7 @@ flag on an ELF descriptor using
|
||||
.Xr elf_flagelf 3 ,
|
||||
following which the library will use the data offsets and alignments
|
||||
specified by the application when laying out the file.
|
||||
Application control of file layout is described further in the
|
||||
Application control of file layout is described further in the
|
||||
.Xr elf_update 3
|
||||
manual page.
|
||||
.Pp
|
||||
@ -608,5 +608,4 @@ The current implementation of the ELF(3) API appeared in
|
||||
.Fx 7.0 .
|
||||
.Sh AUTHORS
|
||||
The ELF library was written by
|
||||
.An "Joseph Koshy"
|
||||
.Aq jkoshy@FreeBSD.org .
|
||||
.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org .
|
||||
|
@ -21,7 +21,7 @@
|
||||
.\" out of the use of this software, even if advised of the possibility of
|
||||
.\" such damage.
|
||||
.\"
|
||||
.\" $Id: elf_begin.3 2313 2011-12-11 06:19:24Z jkoshy $
|
||||
.\" $Id: elf_begin.3 3182 2015-04-10 16:08:10Z emaste $
|
||||
.\"
|
||||
.Dd December 11, 2011
|
||||
.Os
|
||||
@ -272,7 +272,7 @@ was created.
|
||||
.It Bq Er ELF_E_ARGUMENT
|
||||
An
|
||||
.Xr ar 1
|
||||
archive was opened with with
|
||||
archive was opened with
|
||||
.Ar cmd
|
||||
set to
|
||||
.Dv ELF_C_RDWR .
|
||||
|
@ -21,7 +21,7 @@
|
||||
.\" out of the use of this software, even if advised of the possibility of
|
||||
.\" such damage.
|
||||
.\"
|
||||
.\" $Id: elf_cntl.3 289 2009-01-08 08:26:08Z jkoshy $
|
||||
.\" $Id: elf_cntl.3 3181 2015-04-10 13:22:51Z emaste $
|
||||
.\"
|
||||
.Dd August 9, 2006
|
||||
.Os
|
||||
|
@ -21,7 +21,7 @@
|
||||
.\" out of the use of this software, even if advised of the possibility of
|
||||
.\" such damage.
|
||||
.\"
|
||||
.\" $Id: elf_getdata.3 1766 2011-08-22 06:01:03Z jkoshy $
|
||||
.\" $Id: elf_getdata.3 3181 2015-04-10 13:22:51Z emaste $
|
||||
.\"
|
||||
.Dd January 26, 2011
|
||||
.Os
|
||||
@ -174,7 +174,7 @@ These functions return a valid pointer to a data descriptor if successful, or
|
||||
NULL if an error occurs.
|
||||
.Sh ERRORS
|
||||
These functions may fail with the following errors:
|
||||
.Bl -tag -width "[ELF_E_RESOURCE]"
|
||||
.Bl -tag -width "[ELF_E_RESOURCE]"
|
||||
.It Bq Er ELF_E_ARGUMENT
|
||||
Either of the arguments
|
||||
.Ar scn
|
||||
|
@ -21,11 +21,11 @@
|
||||
.\" out of the use of this software, even if advised of the possibility of
|
||||
.\" such damage.
|
||||
.\"
|
||||
.\" $Id: elf_open.3 2512 2012-05-31 06:15:57Z jkoshy $
|
||||
.\" $Id: elf_open.3 3181 2015-04-10 13:22:51Z emaste $
|
||||
.\"
|
||||
.Dd May 31, 2012
|
||||
.Os
|
||||
.Dt ELF_OPEN 3
|
||||
.Dt ELF_OPEN 3
|
||||
.Sh NAME
|
||||
.Nm elf_open
|
||||
.Nd open ELF objects and ar(1) archives
|
||||
|
@ -41,7 +41,7 @@
|
||||
#include <sys/mman.h>
|
||||
#endif
|
||||
|
||||
ELFTC_VCSID("$Id: elf_update.c 3013 2014-03-23 06:16:59Z jkoshy $");
|
||||
ELFTC_VCSID("$Id: elf_update.c 3190 2015-05-04 15:23:08Z jkoshy $");
|
||||
|
||||
/*
|
||||
* Layout strategy:
|
||||
@ -271,8 +271,10 @@ _libelf_compute_section_extents(Elf *e, Elf_Scn *s, off_t rc)
|
||||
* offsets and alignment for sanity.
|
||||
*/
|
||||
if (e->e_flags & ELF_F_LAYOUT) {
|
||||
if (scn_alignment > sh_align || sh_offset % sh_align ||
|
||||
sh_size < scn_size) {
|
||||
if (scn_alignment > sh_align ||
|
||||
sh_offset % sh_align ||
|
||||
sh_size < scn_size ||
|
||||
sh_offset % _libelf_falign(elftype, ec)) {
|
||||
LIBELF_SET_ERROR(LAYOUT, 0);
|
||||
return (0);
|
||||
}
|
||||
|
@ -21,7 +21,7 @@
|
||||
.\" out of the use of this software, even if advised of the possibility of
|
||||
.\" such damage.
|
||||
.\"
|
||||
.\" $Id: gelf.3 189 2008-07-20 10:38:08Z jkoshy $
|
||||
.\" $Id: gelf.3 3195 2015-05-12 17:22:19Z emaste $
|
||||
.\"
|
||||
.Dd September 1, 2006
|
||||
.Os
|
||||
@ -197,5 +197,4 @@ This implementation of the API first appeared in
|
||||
.Fx 7.0 .
|
||||
.Sh AUTHORS
|
||||
The GElf API was implemented by
|
||||
.An "Joseph Koshy"
|
||||
.Aq jkoshy@FreeBSD.org .
|
||||
.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org .
|
||||
|
@ -21,7 +21,7 @@
|
||||
.\" out of the use of this software, even if advised of the possibility of
|
||||
.\" such damage.
|
||||
.\"
|
||||
.\" $Id: elftc_demangle.3 2065 2011-10-26 15:24:47Z jkoshy $
|
||||
.\" $Id: elftc_demangle.3 3182 2015-04-10 16:08:10Z emaste $
|
||||
.\"
|
||||
.Dd August 24, 2011
|
||||
.Os
|
||||
@ -88,7 +88,7 @@ To decode a name that uses an unknown encoding style use:
|
||||
.Bd -literal -offset indent
|
||||
char buffer[1024];
|
||||
const char *funcname;
|
||||
|
||||
|
||||
funcname = ...; /* points to string to be demangled */
|
||||
if (elftc_demangle(funcname, buffer, sizeof(buffer), 0) == 0)
|
||||
printf("Demangled name: %\\n", buffer);
|
||||
|
@ -21,7 +21,7 @@
|
||||
.\" out of the use of this software, even if advised of the possibility of
|
||||
.\" such damage.
|
||||
.\"
|
||||
.\" $Id: elftc_symbol_table_create.3 2825 2012-12-29 14:25:33Z jkoshy $
|
||||
.\" $Id: elftc_symbol_table_create.3 3182 2015-04-10 16:08:10Z emaste $
|
||||
.\"
|
||||
.Dd December 29, 2012
|
||||
.Os
|
||||
@ -224,7 +224,7 @@ should point to a location that will be updated with one of
|
||||
the following values:
|
||||
.Bl -tag -width indent -compact -offset indent
|
||||
.It Dv ELFTC_INSERT_ERROR
|
||||
An error occured during insertion of the symbol.
|
||||
An error occurred during insertion of the symbol.
|
||||
.It Dv ELFTC_INSERT_EXISTING
|
||||
The name in argument
|
||||
.Ar symbolname
|
||||
|
@ -36,7 +36,7 @@
|
||||
|
||||
#include "_libelftc.h"
|
||||
|
||||
ELFTC_VCSID("$Id: libelftc_dem_gnu3.c 3123 2014-12-21 05:46:19Z kaiwang27 $");
|
||||
ELFTC_VCSID("$Id: libelftc_dem_gnu3.c 3194 2015-05-05 17:55:16Z emaste $");
|
||||
|
||||
/**
|
||||
* @file cpp_demangle.c
|
||||
@ -316,7 +316,7 @@ cpp_demangle_push_fp(struct cpp_demangle_data *ddata,
|
||||
|
||||
rtn = 0;
|
||||
if ((len = strlen(f)) > 0)
|
||||
rtn = cpp_demangle_push_str(ddata, f, len);
|
||||
rtn = cpp_demangle_push_str(ddata, f, len);
|
||||
|
||||
free(f);
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id: nm.1 3145 2015-02-15 18:04:37Z emaste $
|
||||
.\" $Id: nm.1 3195 2015-05-12 17:22:19Z emaste $
|
||||
.\"
|
||||
.Dd February 15, 2015
|
||||
.Os
|
||||
@ -335,4 +335,4 @@ were specified.
|
||||
The
|
||||
.Nm
|
||||
utility and this manual page were written by
|
||||
.An Hyogeol Lee Aq hyogeollee@gmail.com .
|
||||
.An Hyogeol Lee Aq Mt hyogeollee@gmail.com .
|
||||
|
@ -22,7 +22,7 @@
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id: readelf.1 3059 2014-06-02 00:42:32Z kaiwang27 $
|
||||
.\" $Id: readelf.1 3195 2015-05-12 17:22:19Z emaste $
|
||||
.\"
|
||||
.Dd September 13, 2012
|
||||
.Os
|
||||
@ -194,4 +194,4 @@ separate lines.
|
||||
The
|
||||
.Nm
|
||||
utility was written by
|
||||
.An "Kai Wang" Aq kaiwang27@users.sourceforge.net .
|
||||
.An Kai Wang Aq Mt kaiwang27@users.sourceforge.net .
|
||||
|
@ -46,7 +46,7 @@
|
||||
|
||||
#include "_elftc.h"
|
||||
|
||||
ELFTC_VCSID("$Id: readelf.c 3178 2015-03-30 18:29:13Z emaste $");
|
||||
ELFTC_VCSID("$Id: readelf.c 3189 2015-04-20 17:02:01Z emaste $");
|
||||
|
||||
/*
|
||||
* readelf(1) options.
|
||||
@ -2673,7 +2673,7 @@ dump_phdr(struct readelf *re)
|
||||
{
|
||||
const char *rawfile;
|
||||
GElf_Phdr phdr;
|
||||
size_t phnum;
|
||||
size_t phnum, size;
|
||||
int i, j;
|
||||
|
||||
#define PH_HDR "Type", "Offset", "VirtAddr", "PhysAddr", "FileSiz", \
|
||||
@ -2726,10 +2726,14 @@ dump_phdr(struct readelf *re)
|
||||
" 0x%16.16jx 0x%16.16jx %c%c%c"
|
||||
" %#jx\n", PH_CT);
|
||||
if (phdr.p_type == PT_INTERP) {
|
||||
if ((rawfile = elf_rawfile(re->elf, NULL)) == NULL) {
|
||||
if ((rawfile = elf_rawfile(re->elf, &size)) == NULL) {
|
||||
warnx("elf_rawfile failed: %s", elf_errmsg(-1));
|
||||
continue;
|
||||
}
|
||||
if (phdr.p_offset >= size) {
|
||||
warnx("invalid program header offset");
|
||||
continue;
|
||||
}
|
||||
printf(" [Requesting program interpreter: %s]\n",
|
||||
rawfile + phdr.p_offset);
|
||||
}
|
||||
@ -4378,13 +4382,22 @@ dump_mips_options(struct readelf *re, struct section *s)
|
||||
p = d->d_buf;
|
||||
pe = p + d->d_size;
|
||||
while (p < pe) {
|
||||
if (pe - p < 8) {
|
||||
warnx("Truncated MIPS option header");
|
||||
return;
|
||||
}
|
||||
kind = re->dw_decode(&p, 1);
|
||||
size = re->dw_decode(&p, 1);
|
||||
sndx = re->dw_decode(&p, 2);
|
||||
info = re->dw_decode(&p, 4);
|
||||
if (size < 8 || size - 8 > pe - p) {
|
||||
warnx("Malformed MIPS option header");
|
||||
return;
|
||||
}
|
||||
size -= 8;
|
||||
switch (kind) {
|
||||
case ODK_REGINFO:
|
||||
dump_mips_odk_reginfo(re, p, size - 8);
|
||||
dump_mips_odk_reginfo(re, p, size);
|
||||
break;
|
||||
case ODK_EXCEPTIONS:
|
||||
printf(" EXCEPTIONS FPU_MIN: %#x\n",
|
||||
@ -4435,7 +4448,7 @@ dump_mips_options(struct readelf *re, struct section *s)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
p += size - 8;
|
||||
p += size;
|
||||
}
|
||||
}
|
||||
|
||||
@ -7458,11 +7471,10 @@ main(int argc, char **argv)
|
||||
errx(EXIT_FAILURE, "ELF library initialization failed: %s",
|
||||
elf_errmsg(-1));
|
||||
|
||||
for (i = 0; i < argc; i++)
|
||||
if (argv[i] != NULL) {
|
||||
re->filename = argv[i];
|
||||
dump_object(re);
|
||||
}
|
||||
for (i = 0; i < argc; i++) {
|
||||
re->filename = argv[i];
|
||||
dump_object(re);
|
||||
}
|
||||
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user